Swiftazu

Orders

Cancel order

Cancel an order that has not been collected yet.

POST/v1/orders/{orderId}/cancel
Bearer tokenReturns JSONSuccess 200

A reason is required. If the order was already dispatched, what was charged for it is given back.

Request

Headers

FieldTypeDescription
AuthorizationrequiredstringThe access token from Get token, as "Bearer <token>".
Content-TyperequiredstringAlways application/json when a body is sent.

Path parameters

FieldTypeDescription
orderIdrequiredstringThe order's id (the UUID, not the short Order ID).

Request body

FieldTypeDescription
reasonrequiredstringWhy 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

HTTPCodeMeaning
404not_foundThe record does not exist, or it is not yours.
400invalid_requestThe request broke a business rule. message says which one.

Every call can also return the shared errors listed on the Overview page. Overview