SetPriceByPriceType

[POST] .../v1/movementoperation/setpricebypricetype

Sets item prices in operations according to the price type. Use this method to recalculate prices on all editable item lines of a DocMovement document from the selected catalog price type, for example after changing the price type in the movement workflow. The request body must contain document_id and price_type_id; the document must be locked by the current user, must be a DocMovement document and must have editable, not posted operations. The current request user must have movement operation edit permission; missing ids, unknown price_type_id, denied access, posted documents, lock conflicts, no matching operations or persistence errors are returned as HTTP 200 ErrorResult business errors.

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": 4301,
  "price_type_id": 7
}

Response Parameters

Name Type Description
ok Boolean Indicates whether the request completed successfully.
result Update Update operation result.

Response Example

{
  "ok": true,
  "result": {
    "row_affected": 2,
    "ids": [
      8201,
      8202
    ]
  }
}