POST /trending/orders/:orderId/cancel
Cancel an unpaid order. Once an order is paid or in progress it
cannot be cancelled and the call answers 409 with the order's
current state.
Use case
The user abandons checkout before paying.
Headers
| Header | Required | Description |
|---|---|---|
Authorization | yes | Bearer <accessToken> |
x-user-id | yes | End-user id, 1–256 chars [A-Za-z0-9_-]. |
Path params
| Param | Required | Description |
|---|---|---|
orderId | yes | The orderId of one of the user's orders. A 24-char hex id. |
Response 200
{ "order": { "orderId": "…", "providerOrderId": "…" } }
The cancelled order, same shape as in
POST /trending/orders.
Errors
| Status | Meaning |
|---|---|
400 | orderId is not a valid id. |
401 / 403 | Token missing, invalid, expired or revoked / API inactive. |
404 | Order not found — missing, or not this user's. |
409 | The order can no longer be cancelled. Body: { "message": "…", "order": { … } } with the order's current state. |
429 | Per-client rate limit hit. |
503 | Trending disabled or unavailable. |
Example
curl -X POST "$BASE_URL/trending/orders/<orderId>/cancel" \
-H "Authorization: Bearer $ACCESS" \
-H "x-user-id: $USER_ID"