[POST] .../v1/docinvoice/setstatus
Sets invoice EDI status. Use this method from integration workflows to record the latest EDI status for an invoice after sending, receiving or provider callbacks. The request body must contain document_id and a non-default status; error_message is stored only for ErrorSent or ErrorReceived statuses and is cleared for all other statuses and a successful response returns OkResult. The invoice must exist and be locked by the current request user before the status can be changed. The current request user must have invoice edit permission; missing body, invalid document_id or status, denied access, unlocked document, missing invoice, database or transaction failures are returned as HTTP 200 ErrorResult business errors.
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| document_id | Int64 | Required | Invoice ID. |
| error_message | String | Optional | Error message to store when status is ErrorSent or ErrorReceived. Maximum length is 1024 characters. |
| status | String | Required | New invoice status. ErrorSent and ErrorReceived can store error_message; other statuses clear the stored error text. Allowed values: Default, New, InSentProgress, Sent, InReceivedProgress, Received, ErrorSent, ErrorReceived, Unknown. |
Request Example
{
"document_id": 9101,
"status": "Sent",
"error_message": ""
}
Response Parameters
| Name | Type | Description |
|---|---|---|
| ok | Boolean | Indicates whether the request completed successfully. |
Response Example
{
"ok": true
}