Developers Guides Cancel a Payment

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.

Online API Payments In-Store

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

ScenarioDescription
Customer abandons checkoutPayment initiated but customer leaves
TimeoutPayment processing takes too long
Error detectedIssue found after payment initiation
Duplicate orderAccidentally 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 StateAction
In progress (not completed)CancelDELETE /payments/:paymentId
Completed, not settled (before 23:00 UTC)VoidPOST /payments/:paymentId/void
SettledRefund — create order with negative quantities

Reference

Ready to get started?

Create a sandbox account and start building your integration today.