Voids
Using the paymentId
and authorization
values returned from a previous payment, void requests are submitted as POST requests to the /payments/paymentId/void
path.
For example, let's assume we've created a payment and received a paymentId
of 64af98cfc79c5e590217a23b
and an authorization
of EP273834
in the response.
Then, to void the payment, we'd send the request to /payments/64af98cfc79c5e590217a23b/void
, as follows:
POST /payments/64af98cfc79c5e590217a23b/void
{
"amount": 1000,
"authorization": "EP273834"
}
{
"paymentId": "64aca4e5c79c5e590217a16a",
"type": "void",
"status": "completed",
"approved": true,
"captured": false,
"authorization": "EP273834",
"amount": 1000,
...
}
Now, if you look up the original transaction, you will see that its status
has changed to 'voided'
and that there is a voidDetails
attribute which is an array containing the paymentId
of the void transaction.
GET /payments/64acad09c79c5e590217a1a5
{
"paymentId": "64af98cfc79c5e590217a23b",
"type": "payment",
"status": "voided",
"approved": true,
"captured": true,
"voided": true,
...
"voidDetails": {
"voids": [
"64af98f3c79c5e590217a250"
]
}
}
Usage Notes
When voiding a payment, the amount being voided must exactly match the original amount of the payment.
Once a payment has been settled, you cannot void it. If you need to "undo" a settled transaction, you must refund it.
You can void an authorization, at which point no further captures against that authorization are permitted. However, any captures up to that point are not voided.