Cancel Checkout Order
Cancel an incomplete or pending checkout order by order reference
Overview
The Cancel Order API allows you to invalidate a checkout order that has not yet been completed. This is useful when a customer abandons a payment flow, an order expires, or you need to programmatically void a pending transaction before any funds are captured.Cancel Order applies only to orders that have not been paid. For completed transactions where funds have already been collected, use the Refund API instead.
When to Use
| Scenario | Action |
|---|---|
| Customer abandons the checkout page | Cancel the pending order |
| Order session expires on your platform | Cancel to clean up the order |
| Merchant needs to void an order before payment | Cancel the order |
| Transaction completed and funds captured | Use Refund instead |
Cancel an Order
To cancel an order, send a POST request to/v1/checkout/order/cancel with the orderReference of the order you want to cancel.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
orderReference | string | Yes | The unique reference of the checkout order to cancel. This is the orderReference returned when the order was created. |
Important Considerations
Order Status
Idempotency
If an order is already cancelled, subsequent cancel requests for the sameorderReference will return an error. Always check the success field in the response to confirm the cancellation.
Best Practices
- Cancel promptly: Cancel orders as soon as you know they will not be completed to keep your order state clean.
- Distinguish cancel from refund: Cancel is for pre-payment orders; refund is for post-payment transactions. Using the wrong endpoint will result in an error.
Next Steps
Create Checkout Order
Learn how to create a checkout order
Verify Transactions
Verify transaction status after a payment attempt
Refund a Checkout Order
Process refunds for completed transactions