Deletes an order. Everything attached to the order, such as custom order fields and the customer assignment, is deleted with it.
Warning
When an order is deleted, all resources attached to that order are also deleted. i.e custom order fields, customer assignment
Before you begin#
- The API token needs
Order_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’s
Order_ID.
Example requests#
Delete an order#
Deletes order 20010.
{
"Store_Code": "{{Store_Code}}",
"Miva_Request_Timestamp": "{{$timestamp}}",
"Function": "Order_Delete",
"Order_ID": 20010
}
Request parameters#
| Parameter | Type | Required | Description |
|---|---|---|---|
Order_ID |
Number | Id of order to delete |
Example response#
{
"success": 1
}
Response parameters#
| Parameter | Type | Description |
|---|---|---|
success |
boolean | boolean value for if the request was successful |
Error responses#
| Error Code | Error Message | Error Description |
|---|---|---|
| MER-JSN-ORD-00025 | Order number not found. | Order number not found. |
| MER-JSN-ORD-00058 | Unable to load order: Order_ID must be specified | Order_id is a required parameter |
Related functions#
| Function | Use it to |
|---|---|
OrderList_Load_Query |
Find the order and its Order_ID |
OrderList_Archive |
Remove payment data and shipping labels but keep the order |
Order_Create |
Create an order |
OrderItemList_Delete |
Delete items from an order instead of the whole order |
Try in Postman#
In the Miva: JSON API: Authenticated collection, open Orders > Order_Delete. See Set Up Postman.