Cancel order
When order items should no longer be delivered to the end customer, use this endpoint to cancel every remaining item that has not yet been captured.
Once you cancel, the remaining items are released for good. There is no way to bring them back, so check the order before you call this.
Canceled items should not be delivered to the customer. If the order used a direct payment method, the customer is refunded the amount of the canceled rows.
NotActivated, PartActivated, and Expired ordersCaptured items are unaffected. See Order lifecycle for what each status allows.
- Request
- Response
POST /manage/orders/{{orderId}}/cancel HTTP/1.1
Host: api.uat.walleydev.com // Test environment. Production uses a different hostname.
Authorization: Bearer {{accessToken}}
Content-Type: application/json
/* Optional body */
{
"actionReference": "test-cancelref-123"
}
HTTP/1.1 202 Accepted
Location: /manage/orders/1b1f5ef6-92n1-4b46-b1dc-ae2e00c4c315
/* No body */
| Http status code | Description |
|---|---|
| 202 | Cancel accepted |
| 401 | Token missing, expired, or invalid |
| 403 | No permission for this store, or the order has not finished syncing |
| 404 | Order not found, or the order has not finished syncing |
| 409 | A request with the same idempotency key is already in progress |
See Errors for what to do about each of these.
Data Modelβ
Requestβ
Request headersβ
| Header | Required | Explanation |
|---|---|---|
| Authorization | Yes | See Authentication for how to generate the Bearer token value |
Request bodyβ
| Property | Required | Explanation | Type | Notes |
|---|---|---|---|---|
| actionReference | No | A reference to this specific cancellation. | string | This will be visible in the order events and searchable in the Merchant Hub. Maximum 255 characters. |
Responseβ
A successful cancel answers 202 Accepted with an empty body and a Location header pointing at
the order.
202 means Walley accepted the request, not that it has been applied. Reading the order back right
away usually returns the old version. See
Asynchronous operations for how to read the result
and retry safely.