Edit

[POST] .../v1/docordertopartner/edit

Edits partner order document. Use this method to update a supplier order header before its lock or state restrictions prevent changes. The document id and a valid DocOrderToPartner status_id are required by the current validation path; optional date, partner_id, currency_id, contract_id, exchange_rate, vat_calculation_type, description and attached_user_id update only when their change marker is present. Date 0 means no change, partner_id or currency_id 0 means no change, 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 and the caller must have partner order edit permission; missing body, invalid id/status, unavailable tariff, invalid exchange rate, missing update fields, lock 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.
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-to-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 Partner order document ID.
partner_id Int64 Optional Partner ID. If 0 or negative, the stored partner is not changed.
status_id Int64 Required Partner order status ID. Required by the current persistent validation and must belong to DocOrderToPartner document type.
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": 4501,
  "date": 1767229200,
  "partner_id": 201,
  "currency_id": 1,
  "status_id": 3,
  "contract_id": 301,
  "exchange_rate": 1,
  "vat_calculation_type": "Exclude",
  "attached_user_id": 5,
  "description": "Updated supplier 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
  }
}