Orders
Cancel order
Cancel an order that has not been collected yet.
POST
/v1/orders/{orderId}/cancelBearer tokenReturns JSONSuccess 200
A reason is required. If the order was already dispatched, what was charged for it is given back.
Request
Headers
| Field | Type | Description |
|---|---|---|
Authorizationrequired | string | The access token from Get token, as "Bearer <token>". |
Content-Typerequired | string | Always application/json when a body is sent. |
Path parameters
| Field | Type | Description |
|---|---|---|
orderIdrequired | string | The order's id (the UUID, not the short Order ID). |
Request body
| Field | Type | Description |
|---|---|---|
reasonrequired | string | Why the order is cancelled, up to 500 characters. |
Example request
curl -X POST "https://api.swiftazu.com/v1/orders/dffcd25d-6eb3-4b90-868c-6deca160ad74/cancel" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"reason": "Customer changed their mind"
}'Response
Example response · 200
{
"status": "ok"
}Errors
| HTTP | Code | Meaning |
|---|---|---|
| 404 | not_found | The record does not exist, or it is not yours. |
| 400 | invalid_request | The request broke a business rule. message says which one. |
Every call can also return the shared errors listed on the Overview page. Overview