[POST] .../v1/docorderdelivery/tobeginning
Returns retail order in initial status: in status New - for unfinished document or in status Finished - for completed document during return Use this workflow method to reset a retail order delivery document to the beginning of the current sale or return flow. The request requires id and locks the document by id while the persistent layer decides whether the order returns to New, Finished or another beginning state based on the current status. The method requires the retail order edit permission, calls the same beginning logic used by some status transitions, sends the reset webhook and returns row_affected. Business errors such as a missing request body, invalid id, denied access, invalid current status, locked or deleted document state, missing active row, database errors or persistence failures are returned as HTTP 200 ErrorResult.
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| id | Int64 | Required | Retail order document ID. |
Request Example
{
"id": 1
}
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
}
}