[POST] .../v1/docpurchase/edit
Edits partner receipt document. Use this method to update an existing receipt-from-partner document header while it is still editable and before posting. It changes header fields such as date, partner, stock, currency, contract, exchange rate, description, VAT calculation mode, responsible user, price type and custom fields and returns row_affected. The caller must have edit permission; the controller requires id and limits description to 300 escaped characters, while the persistent layer rejects missing documents, posted documents, locked documents, posted additional-expense children, unavailable custom fields, closed periods, invalid references and other business errors as HTTP 200 ErrorResult.
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| attached_user_id | Int64 | Optional | Responsible user ID. |
| contract_id | Int64 | Optional | Contract ID. |
| currency_id | Int64 | Optional | Currency ID. |
| date | Int64 | Optional | Receipt-from-partner document date as Unix time in seconds. |
| description | String | Optional | Additional description. |
| exchange_rate | Decimal | Optional | Exchange rate. |
| fields | Array of FieldValueEdit | Optional | Custom field values for add or edit operations. |
| id | Int64 | Required | Receipt-from-partner document ID. |
| partner_id | Int64 | Optional | Partner ID. |
| price_type_id | Int64 | Optional | Price type ID. |
| stock_id | Int64 | Optional | Stock ID. |
| vat_calculation_type | String | Optional | VAT calculation mode: No - do not accrue, Exclude - included in the amount, Include - added on top. Allowed values: No, Exclude, Include. |
Request Example
{
"attached_user_id": 1,
"contract_id": 1,
"currency_id": 1,
"date": 1,
"description": "string",
"exchange_rate": 1.0,
"fields": [
{
"deleted": true,
"key": "string",
"value": "string"
}
],
"id": 1,
"partner_id": 1,
"price_type_id": 1,
"stock_id": 1,
"vat_calculation_type": "No"
}
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
}
}