Cancel an order
Orders
Cancel Order
Cancels a pending order. Cannot cancel orders that have fulfilled subscriptions.
POST
Cancel an order
Overview
Cancel a pending order before it’s been fulfilled. Use this when a customer changes their mind, the order was created in error, or the items are no longer available.When to Use Cancellation
| Scenario | Use This |
|---|---|
| Customer changed their mind | Cancel Order |
| Order created in error | Cancel Order |
| Items no longer available | Cancel Order |
| Order already has subscriptions | Cancel subscriptions instead |
Request Fields
| Field | Required | Description |
|---|---|---|
reason | No | Reason for cancellation (max 1000 chars) |
Example Request
Response Fields
| Field | Description |
|---|---|
success | Always true on success |
message | Confirmation message |
orderId | The cancelled order ID |
What Happens
When you cancel an order:- Order status changes to
cancelled - Order items are released (no longer reserved)
- Cancellation logged with reason and timestamp
- No subscriptions can be created from this order
Example: Cancel with Reason
Example: Check Before Cancelling
Error Handling
| Error Code | Cause | Solution |
|---|---|---|
NOT_FOUND | Order doesn’t exist | Verify order ID |
ORDER_NOT_CANCELLABLE | Order has active subscriptions | Cancel subscriptions first |
ALREADY_CANCELLED | Order already cancelled | No action needed |
Related Endpoints
- Get Order - Check order status before cancelling
- List Orders - Find orders to cancel
- Cancel Subscription - Cancel individual subscriptions
Authorizations
API key obtained from FlexPortal dashboard
Headers
Your tenant identifier
Path Parameters
The order ID
Body
application/json
Maximum string length:
1000