[POST] .../v1/returnstopartneroperation/setcostbylastpurchase
Sets item prices in operations according to last receipt prices from the partner. Use this method to recalculate costs on all editable item lines of a DocReturnsToPartner document from the last posted purchase cost of each item. The request body must contain document_id; the document must be locked by the current user, must be a return-to-partner document and must have editable, not posted operations. The current request user must have return-to-partner operation edit permission; missing document_id, denied access, lock conflicts, posted or deleted documents, no matching operations or persistence errors are returned as HTTP 200 ErrorResult business errors.
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| document_id | Int64 | Required | Return-to-partner document ID. |
Request Example
{
"document_id": 4501
}
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": [
8401
]
}
}