[POST] .../v1/purchaseoperation/setpricebypricetype
Sets item prices in operations according to the price type. Use this method to set sale prices in receipt-from-partner operations from a configured price type after the purchase document and price type are known. The request requires document_id and price_type_id and the response returns row_affected with ids of operations whose price was updated. The caller must have purchase-operation edit permission; missing body, invalid document_id or price_type_id, denied access, unavailable prices, document state conflicts or persistent 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": 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
}
}