[POST] .../v1/docorderdelivery/addfull
Creates a retail order document with initial operations. Request must include document and non-empty operations. document.from_id is required (integer >= 1). Each operation row must include item_id or item_code, quantity > 0 and price >= 0; document_id is not sent. The API creates the document, assigns new_id to the rows and saves everything in one transaction. Requires retail order add and operation add permissions. Errors return HTTP 200 ErrorResult with the failed field path and no partial data. Success returns new_id.
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| document | DocOrderDeliveryAdd | Required | New retail order document. |
| operations | Array of OrderDeliveryOperationAddFullItem | Required | Initial retail order operation rows. The server creates the document first and assigns its ID to these rows. |
Request Example
{
"document": {
"address": "string",
"card_id": 1,
"courier_id": 1,
"customer_id": 1,
"date": 1,
"delivery_date": 1,
"delivery_type_id": 1,
"description": "string",
"external_code": "string",
"from_id": 1,
"location": {
"latitude": 1.0,
"longitude": 1.0
},
"payment_type_id": 1,
"phone": "string",
"price_type_id": 1,
"qrcodeurl": "string",
"stock_id": 1
},
"operations": [
{
"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 | Insert | Created record result. |
Response Example
{
"ok": true,
"result": {
"new_id": 1
}
}