Cancel a Payment
Cancel a Payment
When a payment is initiated, you have the option to cancel it before the payment is confirmed by the customer. This feature is particularly useful when a customer changes their mind about a purchase or if the payment needs to be aborted for any reason.
Cancel Payment Flow
Initiate Cancel Payment
To cancel a payment, send a DELETE request to the Payments endpoint with the paymentId.
Request
Response
The response returns the paymentStatus indicating the state of the cancel request.
Payment Status Values
After calling the cancel endpoint, the payment status will transition to one of the following:
Cancel vs Void vs Refund
Understanding when to use each operation:
Best Practice
Always attempt to cancel a payment first. If the payment has already been confirmed, try to void it. If settlement has already occurred, process a refund.
Error Handling
If you attempt to cancel a payment that has already been completed or settled, you will receive an error response:
In such cases, consider using Void or Refund operations instead.