pending status can be canceled.
Cancellation Behavior
| Current Status | Action | Result Status |
|---|---|---|
pending | Immediate cancel | canceled |
completed | Rejected | unchanged (terminal) |
canceled | Rejected | unchanged (terminal) |
- pending: The order is canceled immediately and its status becomes
canceled - The underlying PSP checkout session expires automatically — there is no separate PSP cancel call to make
completedandcanceledare terminal states and cannot be canceled again
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
orderId | string | Yes | One-time order ID (Short ID format ORD_xxx) |
Example Request
Success Response (200)
Response Fields
| Field | Type | Description |
|---|---|---|
orderId | string | Order ID (Short ID) |
status | string | New order status (always canceled on success) |
Errors
Retry policy: Never retry 4xx — fix the request and resubmit. Retry 5xx with exponential backoff (start 5s, max 3 attempts).
| Status | errors[0].message | What it means | Recommended handling |
|---|---|---|---|
| 400 | Missing required field: orderId | orderId was not provided in the body | Fix the request body, then resubmit |
| 400 | Expected format: ORD_xxx, got "..." | orderId Short ID could not be decoded | Fix the orderId format, then resubmit |
| 400 | Order cannot be canceled, current status: X | Order status is not pending (e.g. already completed or canceled) | The order is no longer cancellable |
| 401 | Authentication failed | Session token invalid, expired, or malformed | Re-mint the session token via Issue Session Token |
| 403 | Order does not belong to user | Ownership check failed | Verify the caller owns the order |
| 404 | Order not found | Order does not exist | Verify the order ID |
| 500 | Internal server error | Unexpected server-side failure | Retry with exponential backoff (start 5s, max 3 attempts) |