[POST] .../v1/docorderfrompartner/edit
Edits order-from-partner document. Use this method to update a customer order header before its lock, reservation or state restrictions prevent changes. The document id and a valid DocOrderFromPartner status_id are required by the current validation path; optional date, partner_id, stock_id, currency_id, contract_id, exchange_rate, vat_calculation_type, booked, description and attached_user_id update only when their change marker is present. Date 0 means no change, stock_id cannot be changed when the stored document is booked, contract_id null means no change, contract_id 0 clears the contract, attached_user_id null means no change and attached_user_id 0 clears the responsible user. The document must be locked by the current user, stock_id must be allowed for the current user and the caller must have order-from-partner edit permission; missing body, invalid id/status, unavailable tariff, forbidden stock, invalid exchange rate, missing update fields, lock conflicts, reservation conflicts, denied access or storage failures are returned as HTTP 200 ErrorResult business errors.
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. |
| booked | Boolean | Optional | Ordered item reservation status: true - reserve ordered items so they are unavailable for shipment to another partner; stock_id cannot be changed in this case. false - ordered items are not reserved and can be shipped to another partner if needed. |
| 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 or negative, the stored currency is not changed. |
| date | Int64 | Optional | Order-from-partner document date as Unix time in seconds. If 0, the stored date is not changed. |
| description | String | Optional | Document note. Maximum length is 300 characters; null means no change. |
| exchange_rate | Decimal | Optional | Exchange rate. Negative values are rejected; for the base currency the API stores 1. |
| id | Int64 | Required | Order-from-partner document ID. |
| partner_id | Int64 | Optional | Partner ID. If 0 or negative, the stored partner is not changed. |
| status_id | Int64 | Required | Order-from-partner status ID. Required by the current persistent validation and must belong to DocOrderFromPartner document type. |
| stock_id | Int64 | Optional | Stock ID. If 0 or negative, the stored stock is not changed. If the document is booked, stock_id cannot be 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": 4601,
"date": 1767229200,
"status_id": 3,
"contract_id": 301,
"partner_id": 201,
"stock_id": 101,
"currency_id": 1,
"booked": true,
"exchange_rate": 1,
"vat_calculation_type": "Include",
"attached_user_id": 5,
"description": "Updated customer order note"
}
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
}
}