Add

[POST] .../v1/orderdeliveryoperation/add

Creates a new operation retail order. Use this batch method to add item rows to a retail order delivery document while the document is still editable. The request body is an array of one to 250 rows; all rows must target the same document_id, each row must provide item_id or item_code, positive quantity, non-negative price and values within quantity, price and total amount limits. The method requires the retail order operation add permission, locks the target document by document_id, checks document state, resolves item references, applies document price type when price is zero, inserts the rows, updates the document amount and returns row_affected with ids. Business errors such as a missing or empty array body, batch-size violations, mixed document_id values, invalid item, quantity, price or amount values, denied access, invalid document state, missing related records, database errors or persistence failures are returned as HTTP 200 ErrorResult.

Request Parameters

Name Type Required Description
document_id Int64 Required Retail order document ID that receives the operation.
item_code Int64 Optional Item code to add to the retail order when item_id is not used.
item_id Int64 Optional Item ID to add to the retail order.
price Decimal Required Ordered item price. Required; zero is allowed and negative values are rejected.
quantity Decimal Required Ordered item quantity.

Request Example

[
  {
    "document_id": 1,
    "item_code": 1,
    "item_id": 1,
    "price": 1.0,
    "quantity": 1.0
  }
]

Response Parameters

Name Type Description
ok Boolean Indicates whether the request completed successfully.
result Update Update operation result.

Response Example

{
  "ok": true,
  "result": {
    "ids": [
      null
    ],
    "row_affected": 1
  }
}