API
API ReferenceOrdersOrderidCancel

Cancel order

Cancels an order that is still `NEW` — roughly the first two hours after creation, before it is accepted for fulfilment — or one whose payment failed. The merchant is refunded as if they had canceled it from their dashboard, and `order.canceled` is sent to your webhooks. Canceling an order that is already canceled answers 200 again, so a retry is safe.

POST
/v1/orders/{orderId}/cancel

Cancels an order that is still NEW — roughly the first two hours after creation, before it is accepted for fulfilment — or one whose payment failed. The merchant is refunded as if they had canceled it from their dashboard, and order.canceled is sent to your webhooks. Canceling an order that is already canceled answers 200 again, so a retry is safe.

Authorization

apiKey
AuthorizationBearer <token>

An API connection key, sent as Authorization: Bearer <key>. The x-api-key header is accepted as an alternative.

In: header

Path Parameters

orderId*string

Our order id, or your own externalOrderId.

Length1 <= length <= 200

Response Body

application/json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

curl -X POST "https://example.com/v1/orders/string/cancel"
{  "id": "string",  "testMode": true,  "externalOrderId": "string",  "status": "NEW",  "onHold": true,  "onHoldReasons": [    "out_of_stock"  ],  "createdAt": "2019-08-24T14:15:22Z",  "shippingAddress": {    "name": "string",    "firstName": "string",    "lastName": "string",    "company": "string",    "phone": "string",    "address1": "string",    "address2": "string",    "city": "string",    "stateCode": "string",    "zip": "string",    "countryCode": "string"  },  "lines": [    {      "id": "string",      "productId": "dcd53ddb-8104-4e48-8cc0-5df1088c6113",      "quantity": 0,      "shipmentId": "string"    }  ],  "shipments": [    {      "id": "string",      "status": "pending",      "trackingNumber": "string",      "trackingUrl": "http://example.com",      "createdAt": "2019-08-24T14:15:22Z",      "lineIds": [        "string"      ]    }  ]}