SetPriceByPriceType

[POST] .../v1/inventoryoperation/setpricebypricetype

Fills price by type prices in operations inventory document; Use this method to recalculate prices for all active rows of an inventory document from a selected price type. The request requires the inventory operation edit permission, document_id and price_type_id are required, the inventory document must exist and pass the document lock contract, and the selected price type must exist. The method sets all row prices for the document to 0 first, then fills prices from item price records for the requested price type and applies the price type currency exchange rate when it is not the base currency. Business errors such as missing body, invalid IDs, denied access, document not found, closed/deleted document restrictions, lock failure, unknown price type, missing active rows, database failures, or no affected rows are returned as HTTP 200 ErrorResult.

Request Parameters

Name Type Required Description
document_id Int64 Required Document ID for setting operation prices by price type. The supported document kind depends on the controller route.
price_type_id Int64 Required Price type ID.

Request Example

{
  "document_id": 1,
  "price_type_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
  }
}