Cancel a Payment
Stop an in-progress payment before it completes. Use cancellation when a customer abandons checkout or a payment needs to be halted mid-process.
Overview
Cancellation stops a payment before it completes — for example, if the customer abandons checkout while payment is processing, or you need to halt a transaction before funds are transferred.
Cancel vs. Void: Cancel applies to in-progress payments (before completion). If the payment has already completed, use Void a Payment instead.
When to Use Cancel
| Scenario | Description |
|---|---|
| Customer abandons checkout | Payment initiated but customer leaves |
| Timeout | Payment processing takes too long |
| Error detected | Issue found after payment initiation |
| Duplicate order | Accidentally created a second payment |
Step 1: Cancel the Payment
Call the delete endpoint with the paymentId from the original order:
DELETE /payments/:paymentId
// Response
{
"status": "SUCCESS",
"data": {
"paymentStatus": "PAYMENT_CANCELLED"
},
"message": "Payment cancelled successfully"
}
Possible paymentStatus values: PAYMENT_COMPLETED | PAYMENT_FAILED | PAYMENT_CANCELLED
If the payment already completed before your cancel request was processed, the status will show PAYMENT_COMPLETED and you should use a void or refund instead.
Step 2: Verify Order Status
Confirm the order reflects the cancellation:
GET /merchants/:merchantId/orders/:orderId/status
// Response
{
"status": "SUCCESS",
"data": {
"orderStatus": "PAYMENT_CANCELLED",
"payments": [
{
"paymentId": "83a1ba3264bd500106",
"paymentStatus": "PAYMENT_CANCELLED",
"paymentMethod": "CARD",
"amount": 50000
}
]
}
}
Decision Guide
| Payment State | Action |
|---|---|
| In progress (not completed) | Cancel — DELETE /payments/:paymentId |
| Completed, not settled (before 23:00 UTC) | Void — POST /payments/:paymentId/void |
| Settled | Refund — create order with negative quantities |
Reference
Ready to get started?
Create a sandbox account and start building your integration today.