complete_from_history
If the orders were not completed online, you may use the order/complete_from_history method to complete the orders using history messages:
order/complete_from_history¶ms={"itemId":<long>,
"orders":[long]}
Parameters
Parameter | Description |
---|---|
itemId | Resource ID. |
orders | Array of order IDs. |
Make sure the unit is assigned to the order.
Use:
- ./update with callMode=‘‘create’’ to create an order with the unit assigned;
- ./update with callMode=‘‘assign’’ to assign a unit to the order that has already been created.
Response
{
"completed":<bool> /* checked the aggregated status of the orders:
1 - completed (if at least one order is completed during the request processing, the status of this order will be changed to "s":2),
0 - not completed (no order has been completed during request processing) */
}
Error codes
Error code | Description |
---|---|
7 | Couldn't get the item with the provided itemId. |
6 | Failed to create the order collection. |
4 | No order was provided or one of the orders was erroneous. |