[POST] .../v1/docorderdelivery/setstock
Sets warehouse for retail order document Use this method to assign the warehouse that will fulfill a retail order before the order is approved. The request requires id and stock_id, locks the document by id and checks that the stock exists and is available to the current request user. The controller currently requires the retail order unlock permission for this operation and the persistent layer rejects orders that are already Approved or later; the method writes the action log, sends the stock-set webhook and returns row_affected. Business errors such as a missing request body, invalid id or stock_id, denied access, disabled tariff, inaccessible stock, missing stock, order already approved, missing active row, database errors or persistence failures are returned as HTTP 200 ErrorResult.
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| id | Int64 | Required | Retail order document ID. |
| stock_id | Int64 | Required | Stock ID for the retail order document. |
Request Example
{
"id": 1,
"stock_id": 1
}
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
}
}