Deletes one or more items (products) from an order and returns the new order total. To keep a record of the items, cancel them with OrderItemList_Cancel instead.
Before you begin#
- The API token needs
OrderItemList_Delete, either assigned directly under Functions or through a group. See Create an API token. - Requests must be signed if the token requires it. See Make a signed request with HMAC.
- You need the order ID and the
line_idof each item.OrderList_Load_Queryreturns both.
Example requests#
Delete items#
Deletes lines 153 and 165 from order 200100.
{
"Store_Code": "{{Store_Code}}",
"Miva_Request_Timestamp": "{{$timestamp}}",
"Function": "OrderItemList_Delete",
"Order_Id": "200100",
"line_ids": [153, 165]
}
Request parameters#
| Parameter | Type | Required | Description |
|---|---|---|---|
order_id |
Number | Order ID | |
line_ids |
Array | Yes | Array of line ids to delete |
Example response#
{
"success": 1,
"data": {
"total": 0.0,
"formatted_total": "$0.00"
}
}
Response parameters#
| Parameter | Type | Description |
|---|---|---|
total |
Number | Order Total after new item has been added |
formatted_total |
String | Currency Formatted Order Total |
Error responses#
| Error Code | Error Message | Error Description |
|---|---|---|
| MER-JSN-ORD-00025 | Order number not found. | Order number not found. |
| MER-JSN-00023 | One or more parameters are invalid | Missing line_ids parameter |
Related functions#
| Function | Use it to |
|---|---|
OrderList_Load_Query |
Find the order and its line IDs |
OrderItem_Add |
Add an item to an order |
OrderItem_Update |
Change an item in an order |
OrderItemList_Cancel |
Cancel items and keep a record of them |
Order_Delete |
Delete the whole order |
Try in Postman#
In the Miva: JSON API: Authenticated collection, open Orders > OrderItemList_Delete. See Set Up Postman.