Add

[POST] .../v1/ordertopartneroperation/add

Creates a new operation partner order document. Use this method to add one or more requested item lines to a DocOrderToPartner supplier order before the order is converted into a purchase workflow. The request body is a JSON array batch; every operation must contain document_id, item_id, positive quantity up to 999999999 and cost from 0 to 99999999999; vat_value is optional and uses the item's VAT rate when omitted; description is optional up to 300 characters and all array items must reference the same document_id. The parent DocOrderToPartner must be locked by the current user and eligible for editing and the item must be an active non-compound leaf item; null, empty or oversized arrays, invalid values, mixed document_ids, denied access, production setting restrictions or document/item state conflicts are returned as HTTP 200 ErrorResult business errors.

Request Parameters

Name Type Required Description
cost Decimal Required Ordered item cost. Required; zero is allowed, negative values are rejected, the value must be no greater than 99999999999 and quantity multiplied by cost must not exceed 99999999999.
description String Optional Operation note. Maximum length is 300 characters.
document_id Int64 Required Order-to-partner document ID.
item_id Int64 Required Item ID.
quantity Decimal Required Ordered item quantity. Must be greater than zero and no greater than 999999999.
vat_value Decimal Optional VAT rate value. Null uses the item's VAT rate; -1 is accepted for document/default VAT behavior.

Request Example

[
  {
    "document_id": 4501,
    "item_id": 1001,
    "quantity": 10,
    "cost": 12.5,
    "vat_value": 12,
    "description": "Supplier requested line"
  }
]

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,
    "ids": [
      8401
    ]
  }
}