[POST] .../v1/docinout/edit
Edits cash in/out document. Use this method to update an editable manual stock receipt or write-off document before it is posted. The request requires the cash in/out document edit permission and id is required; the document must satisfy the lock contract, remain not posted and not deleted and must not be an automatically created document. Optional patch fields leave existing values unchanged when omitted; attached_user_id = 0 clears the responsible user and at least one editable field must be supplied. Business errors such as missing body, invalid id, denied access, disabled tariff option, lock failure, closed period, stock access denial, automatic-document state, no editable fields, no affected row, database failures or action log failures are returned as HTTP 200 ErrorResult.
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| attached_user_id | Int64 | Optional | Responsible user patch value. Null leaves it unchanged; 0 clears the responsible user. |
| date | Int64 | Optional | New document date as Unix time in seconds. Values less than or equal to 0 leave it unchanged; changed dates must not fall into a closed period. |
| description | String | Optional | Document note patch value. Null leaves it unchanged; an empty string clears the note. Maximum length is 300 characters. |
| id | Int64 | Required | Required stock receipt/write-off document ID. |
| inout_type | String | Optional | New document type: income - stock receipt, outcome - stock write-off. Null leaves it unchanged. Allowed values: all, income, outcome. |
| stock_id | Int64 | Optional | New stock ID. Values less than or equal to 0 leave it unchanged; a changed stock must be visible to the current request user. |
Request Example
{
"id": 42,
"date": 1714554000,
"stock_id": 3,
"description": "Updated write-off note",
"attached_user_id": 5
}
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
}
}