- API reference
- Order Management API
Cancel an order
https://api.kustom.co/ordermanagement/v1/orders/{order_id}/cancel
Cancel order. Read more on Cancelling an order
Order id
This header will guarantee the idempotency of the operation. The key should be unique and is recommended to be a UUID version 4. Retries of requests are safe to be applied in case of errors such as network errors, socket errors and timeouts. Input values of the operation are disregarded when evaluating the idempotency of the operation, only the key matters.
No field here matches the current filters.
Order was cancelled.
No response body — this status returns headers only.
No field here matches the current filters.
Cancel not allowed (e.g. order has captures or is closed)
Correlation id. For searching logs.
Error code
Error messages
No field here matches the current filters.
Not Found
- INTERNAL_ERROR
- NOT_FOUND
- TOO_MANY_REQUESTS
- REFUND_NOT_ALLOWED
- CAPTURE_NOT_ALLOWED
- CANCEL_NOT_ALLOWED
- UPDATE_NOT_ALLOWED
- NO_SUCH_ORDER
- BAD_REQUEST
- PAYLOAD_TOO_LARGE
- NO_SUCH_CAPTURE
- RESOURCE_NOT_FOUND
- +4 more
No field here matches the current filters.
Conflict
No response body — this status returns headers only.
No field here matches the current filters.
Errors
| Code | Status | What it means | Retry |
|---|---|---|---|
CANCEL_NOT_ALLOWED | 403 | The order has captures, so it can only be refunded. Needs AUTHORIZED. | Never retry |
NO_SUCH_ORDER | 404 | The order_id does not exist, or belongs to the other environment. | Never retry |
This page is also available as Markdown — append .md to its URL — and is indexed in llms.txt.