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:

Copied!
order/complete_from_history&params={"itemId":<long>,
				    "orders":[long]}

Parameters

Parameter Description
itemId Resource ID.
orders Array of order IDs.

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

Copied!
{
    "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.

If you find a mistake in the text, please select it and press Ctrl+Enter.