Cancel an order Run in API Explorer
Ask AI
Request cancellation of an order. Only warehouse orders in 'new' or 'backordered' status can be cancelled. Orders that have progressed to batched, picked, packed, departed, or complete cannot be cancelled.
Cancellation is asynchronous — the response confirms that cancellation has been initiated, not that it is complete. When an order has multiple warehouse orders, some may be cancelled while others cannot, resulting in a partial cancellation (HTTP 206).
POST
/v1/orders/cancel_order
curl \
--request POST 'https://api.pattern.com/hub/v1/orders/cancel_order?market_order_id=string' \
--header "Authorization: Bearer $ACCESS_TOKEN"
Response examples (422)
{
"errors": [
"string"
]
}
Response examples (200)
{
"market_order_id": "string",
"success": true,
"message": "string",
"cancelled_orders": [
{
"warehouse_order_id": 42,
"status": "string"
}
],
"non_cancellable_orders": [
{
"warehouse_order_id": 42,
"status": "string",
"reason": "string"
}
]
}
Response examples (206)
{
"market_order_id": "string",
"success": true,
"message": "string",
"cancelled_orders": [
{
"warehouse_order_id": 42,
"status": "string"
}
],
"non_cancellable_orders": [
{
"warehouse_order_id": 42,
"status": "string",
"reason": "string"
}
]
}
Response examples (409)
{
"market_order_id": "string",
"success": true,
"message": "string",
"cancelled_orders": [
{
"warehouse_order_id": 42,
"status": "string"
}
],
"non_cancellable_orders": [
{
"warehouse_order_id": 42,
"status": "string",
"reason": "string"
}
]
}