POST /v1/orders/cancel_order

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).

Query parameters

  • market_order_id string Required

    Marketplace order ID to cancel

Responses

  • 422 application/json

    Missing or invalid parameters

    Hide response attribute Show response attribute object
    • errors array[string]
  • 200 application/json

    All warehouse orders successfully initiated for cancellation

    Hide response attributes Show response attributes object
    • market_order_id string

      Marketplace order ID

    • success boolean

      Whether any warehouse orders were successfully cancelled

    • message string

      Cancellation result message

    • cancelled_orders array[object]

      Warehouse orders that were successfully initiated for cancellation

      Hide cancelled_orders attributes Show cancelled_orders attributes object
      • warehouse_order_id integer

        Warehouse order ID

      • status string

        Status after cancellation (cancelled)

    • non_cancellable_orders array[object]

      Warehouse orders that could not be cancelled

      Hide non_cancellable_orders attributes Show non_cancellable_orders attributes object
      • warehouse_order_id integer

        Warehouse order ID

      • status string

        Current warehouse status preventing cancellation

      • reason string

        Reason the order cannot be cancelled

  • 206 application/json

    Partial cancellation — some warehouse orders cancelled, others could not be

    Hide response attributes Show response attributes object
    • market_order_id string

      Marketplace order ID

    • success boolean

      Whether any warehouse orders were successfully cancelled

    • message string

      Cancellation result message

    • cancelled_orders array[object]

      Warehouse orders that were successfully initiated for cancellation

      Hide cancelled_orders attributes Show cancelled_orders attributes object
      • warehouse_order_id integer

        Warehouse order ID

      • status string

        Status after cancellation (cancelled)

    • non_cancellable_orders array[object]

      Warehouse orders that could not be cancelled

      Hide non_cancellable_orders attributes Show non_cancellable_orders attributes object
      • warehouse_order_id integer

        Warehouse order ID

      • status string

        Current warehouse status preventing cancellation

      • reason string

        Reason the order cannot be cancelled

  • 409 application/json

    No warehouse orders could be cancelled — all beyond cancellable status

    Hide response attributes Show response attributes object
    • market_order_id string

      Marketplace order ID

    • success boolean

      Whether any warehouse orders were successfully cancelled

    • message string

      Cancellation result message

    • cancelled_orders array[object]

      Warehouse orders that were successfully initiated for cancellation

      Hide cancelled_orders attributes Show cancelled_orders attributes object
      • warehouse_order_id integer

        Warehouse order ID

      • status string

        Status after cancellation (cancelled)

    • non_cancellable_orders array[object]

      Warehouse orders that could not be cancelled

      Hide non_cancellable_orders attributes Show non_cancellable_orders attributes object
      • warehouse_order_id integer

        Warehouse order ID

      • status string

        Current warehouse status preventing cancellation

      • reason string

        Reason the order cannot be cancelled

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"
    }
  ]
}