SetStock

[POST] .../v1/docorderdelivery/setstock

Assigns a fulfillment warehouse to a retail order. 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 method currently requires the retail order unlock permission for this operation and the method rejects orders that are already Approved or later; the method sends the stock-set webhook and returns row_affected. 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, storage errors 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
  }
}