Void a Payment

Void a Payment

A void operation cancels a payment that has been authorized but not yet settled. Unlike a refund, a void prevents the transaction from being processed entirely, which means no funds are actually transferred.


Void vs Refund

AspectVoidRefund
TimingBefore settlement (before 23:00 UTC)After settlement
Funds TransferNo funds transferredFunds returned to customer
ProcessingImmediate cancellationCredit transaction processed
Customer ExperienceAuthorization disappearsRefund appears on statement
Time Limit

Void operations must be performed before 23:00 UTC on the day of the transaction. After this time, the transaction will be settled and a refund will be required instead.


Void Payment Flow


Initiate Void Payment

To void a payment, send a PUT request to the void endpoint with the paymentId.

Request

$curl -X PUT \
> -H 'Content-Type: application/json' \
> -H 'API-KEY: YOUR_API_KEY' \
> -H 'API-SECRET: YOUR_API_SECRET' \
> -H 'MERCHANT-ID: YOUR_MERCHANT_ID' \
> YOUR_API_URL/payments/:paymentId/void

Response

The response returns the voidStatus indicating the state of the void request.

1{
2 "paymentId": "550e8400-e29b-41d4-a716-446655440000",
3 "orderId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
4 "voidStatus": "VOIDED"
5}

Void Status Values

StatusDescription
VOID_INITIATEDThe void request has been initiated and is being processed
VOIDEDThe payment was successfully voided
CANNOT_VOIDThe payment cannot be voided (already settled or past deadline)

When Void is Not Possible

A void operation will fail in the following scenarios:

  1. Past Settlement Time: The 23:00 UTC deadline has passed
  2. Already Settled: The transaction has already been settled
  3. Already Refunded: A refund has already been processed
  4. Already Voided: The payment was previously voided

Error Response

1{
2 "error": "CANNOT_VOID",
3 "message": "Payment has already been settled and cannot be voided",
4 "paymentId": "550e8400-e29b-41d4-a716-446655440000",
5 "voidStatus": "CANNOT_VOID",
6 "suggestion": "Use refund endpoint instead"
7}

Void vs Return/Refund Comparison

FeatureVoidReturn/Refund
Processing TimeImmediate3-5 business days
Customer ImpactAuthorization removedCredit to account
Merchant FeesUsually avoidedMay apply
Time WindowSame day (before 23:00 UTC)Unlimited (within policy)
Use CaseOrder cancellationPost-delivery returns

Best Practice Workflow

Recommendation

Always check the current time against the 23:00 UTC deadline before deciding between void and refund. Voiding is preferable as it avoids fund transfer and associated fees.