[POST] .../v1/docorderdelivery/setstatus
Sets status retail order document Use this workflow method to move a retail order delivery document through its lifecycle statuses, such as New, Approved, Processing, Paying, Finished, Canceled, ReturnPaying and ReturnProcessing. The request requires id and a non-default status and the method locks the document by id while validating the transition. The method requires the retail order edit permission, checks that the target status belongs to retail orders, enforces allowed transitions, requires a stock and at least one operation before approving a New order, may delegate reset transitions to DocOrderDelivery/ToBeginning, sends status-change notifications/webhooks and returns row_affected. Business errors such as a missing request body, invalid id or status, denied access, missing order, invalid status type, invalid status transition, missing stock, empty order, disabled tariff, missing active row or persistence failures are returned as HTTP 200 ErrorResult.
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| id | Int64 | Required | Retail order document ID. |
| status | String | Required | Retail order document status: New, Approved, Processing, Paying, Finished, Canceled, ReturnPaying or ReturnProcessing. Allowed values: Default, New, Approved, Processing, Paying, Finished, Canceled, ReturnPaying, ReturnProcessing. |
Request Example
{
"id": 1,
"status": "New"
}
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
}
}