SetNewPriceByPriceType

[POST] .../v1/setpriceoperation/setnewpricebypricetype

Fills the new price by price type in price setting document operations; Use this method to replace new_value in all non-deleted, unposted operations of a price setting document with item prices from another price type. The request body must contain document_id and price_type_id; the persistent layer loads the target DocSetPrice, loads the source price type, applies currency-rate conversion when currencies differ and updates every editable operation row in the document. The parent document must exist, remain editable and be locked by the current user and the response returns row_affected plus ids of operations selected for the update. The current request user must have price setting operation edit permission; missing body, invalid ids, denied access, missing price type or document, lock conflicts, no editable operations and storage failures 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": 6101,
  "price_type_id": 2
}

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": 1,
    "ids": [
      8101
    ]
  }
}