API Reference
Endpoints

Cancel an order

Cancel an order by any of its identifiers. Before a driver picks it up, cancellation is free and refunds to your balance; after pickup it can no longer be cancelled.

POST/orders/:identifier/cancel

Cancel an order before it is picked up. The identifier is id-agnostic (your client_order_id or external_waybill, or our order id or waybill).

Headers
Authorizationstringrequired
Your API key: Bearer rly_live_....
Idempotency-Keystring (uuid)required
A unique key so retries are safe.
Path parameters
identifierstringrequired
The order to cancel, by any of the four id types.
curl -X POST https://dev-api.rely7.com/api/v1/orders/order-9001/cancel \
  -H "Authorization: Bearer rly_live_xxx" \
  -H "Idempotency-Key: 3b1f...c44"
{
  "statusCode": 200,
  "success": true,
  "data": {
    "client_order_id": "order-9001",
    "status": "CANCELLED",
    "refunded": true
  }
}
Cancellation window
Once an order is picked up or delivered, cancelling returns 409 with CANCEL_BOUNDARY_EXCEEDED. A pre-pickup cancel frees the client_order_id for reuse.