POST/v1/orders/cancel-items
Cancel Items
Cancelling items in an order may not always be possible depending on the order status. You should check the responses below carefully and manage successful/unsuccessful responses in your system. An orders items can not be cancelled once the order has been shipped.
Making a Request
Include the headers and order data in your request.
POST
/v1/orders/cancel-itemscurl -X POST https://api.mpodx.com/v1/orders/cancel-items \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{ //... your order data }'
The Cancel Items Model
Properties
- Name
- Type
- string
- Description
- The MPODx order reference (required).
- Name
- [
- Type
- array
- Description
An array of the items
Data Structure
Example data structure
{
"order_ref": "PKG12345",
"items": [
{
"item_ref": "1234567",
"quantity": 1,
"cancelled_quantity": 1
},
{
"item_ref": "1234568",
"quantity": 2,
"cancelled_quantity": 1
}
]
}
Cancel Items
Used when you want to cancel specific items in an order
This information shows you how to cancel items within an order without cancelling the whole order. Review the responses carefully and handle them in your system.
The data below shows the required fields for this API call.
Required Fields
{
"order_ref": "PKG12345",
"items": [
{
"item_ref": "1234567",
"cancelled_quantity": 1
},
{
"item_ref": "1234568",
"cancelled_quantity": 1
}
]
}
200 - Successful Response
{
"message":"Items cancelled successfully",
"status":"success",
"data":{
"order_ref": "PKG12345",
"items": [
{
"item_ref": "1234567",
"cancelled_quantity": 1
},
{
"item_ref": "1234568",
"cancelled_quantity": 1
}
]
}
}
200 - Error Response
{
"message":"Items cannot be cancelled",
"status":"error",
"data":{
"order_ref": "PKG12345"
}
}