[POST] .../v1/doccontract/edit
Edits a contract. Use this method to update existing contract header fields such as code, name, dates, party links, direction, amount, currency, details, description, active flag or responsible user. The request body must contain id; all other fields are optional patch fields, null attached_user_id means no change, 0 clears the responsible user and a positive attached_user_id sets a new responsible user. The contract tariff parameter must be enabled, referenced partner and firm records must exist when changed, the target contract must exist and the current request user must have contract edit permission. Missing body, invalid id, denied access, unavailable tariff, missing related records, no changed fields, no affected rows, database failures and action-log or webhook failures are returned as HTTP 200 ErrorResult business errors.
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| active | Boolean | Optional | Validity flag: true - valid, false - invalid. |
| amount | Decimal | Optional | Contract amount. |
| attached_user_id | Int64 | Optional | Responsible user ID. Null means no change, 0 clears the responsible user and a positive value sets the responsible user. |
| code | String | Optional | Contract code. |
| currency_id | Int64 | Optional | Contract currency ID. |
| date | Int64 | Optional | Contract date as Unix time in seconds. |
| description | String | Optional | Note. |
| details | String | Optional | Contract details. |
| direction | String | Optional | Contract direction: Income or Outcome. Allowed values: All, Income, Outcome. |
| end_date | Int64 | Optional | Contract work end date as Unix time in seconds. |
| firm_id | Int64 | Optional | Company ID. |
| id | Int64 | Required | Contract ID. |
| name | String | Optional | Contract name. |
| partner_id | Int64 | Optional | Partner ID. |
| start_date | Int64 | Optional | Contract work start date as Unix time in seconds. |
Request Example
{
"id": 9101,
"name": "January supply contract, updated",
"amount": 27500,
"description": "Updated after agreement review",
"attached_user_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": 1
}
}