Edit
[POST] .../v1/docwholesalereturn/edit
Updates a wholesale customer return document. Update an existing wholesale return document header before it is posted. For price_type_id, omitted or null leaves the value unchanged, 0 clears it and a positive ID assigns an existing price type. Existing item line prices are not recalculated. Unknown price types return HTTP 200 ErrorResult with error 1044. The request body must contain id; optional fields update only provided values, contract_id and attached_user_id can be reset with 0 and description is limited to 300 characters. The document must be locked by the current request user and editable, stock access and closed-period rules are enforced and contract/currency combinations must remain valid; missing id, no changed fields, denied access, lock conflicts, posted or deleted documents, period, contract, currency, stock access, database, webhook or persistence errors are returned as HTTP 200 ErrorResult.
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| attached_user_id | Int64 | Optional | Responsible user ID. Null means no change, 0 clears the responsible user and a positive value assigns that user. |
| contract_id | Int64 | Optional | Contract ID. Null means no change, 0 clears the contract and a positive value assigns that contract. |
| currency_id | Int64 | Optional | Currency ID. If 0, the stored currency is not changed; when changed with a contract, the currency must match the contract currency. |
| date | Int64 | Optional | Return-from-partner document date as Unix time in seconds. If 0, the stored date is not changed. |
| description | String | Optional | Additional description. Maximum length is 300 characters; null means no change. |
| exchange_rate | Decimal | Optional | Exchange rate. If 0, the stored rate is not changed unless currency_id is changed; negative values are invalid. |
| id | Int64 | Required | Return-from-partner document ID. |
| partner_id | Int64 | Optional | Partner ID. If 0, the stored partner is not changed. |
| price_type_id | Int64 | Optional | Price type ID. Null means no change, 0 clears the price type and a positive value assigns that price type. Existing item line prices are not recalculated. |
| stock_id | Int64 | Optional | Stock ID. If 0, the stored stock is not changed. |
| vat_calculation_type | String | Optional | VAT calculation mode: No - do not accrue, Exclude - included in the amount, Include - added on top. Allowed values: No, Exclude, Include. |
Request Example
{
"id": 6601,
"date": 1767229200,
"partner_id": 301,
"stock_id": 11,
"currency_id": 1,
"exchange_rate": 1,
"vat_calculation_type": "Exclude",
"attached_user_id": 5,
"description": "Adjusted return header"
}
Response Parameters
| Name | Type | Description |
|---|---|---|
| ok | Boolean | Indicates whether the request completed successfully. |
| result | Update | Update operation result. |
Response Example
{
"ok": true,
"result": {
"row_affected": 1
}
}