Cancel in Customer Area
You can also cancel payments in your Customer Area. For more information, see Manage payments.
If you want to revert a payment, you can cancel the authorization. This is possible while the authorization hasn't been captured yet: the payment is in the AuthorisedPending state, or in the Authorised state.
If the authorization has already been captured, you cannot cancel the payment anymore. You'll have to issue a refund instead.
To specify the payment that you want to cancel, use the pspReference of the authorization. You can find the pspReference in the hosttohostpaymentgateway/v#/payments response and in the AUTHORISATION webhook.
Cancel an authorization
To cancel a payment that has been authorized but not captured yet:
-
From the authorization response or the AUTHORISATION webhook, get the
pspReferenceof the authorization you want to cancel. -
Make a POST request to the /payments/{paymentPspReference}/cancels endpoint, where
paymentPspReferenceis the PSP reference of the authorization you want to cancel.If you are not sure whether the authorization has been captured, use the
/payments/{paymentPspReference}/reversalsendpoint instead.In your request, include:
Parameter Required Description merchantAccount
The name of your merchant account that is used to process the payment. referenceYour reference for the cancel request. The following example shows how to cancel an authorization that has the
pspReferenceXB7XNCQ8HXSKGK82. -
When you receive the /payments/{paymentPspReference}/cancels response, note:
paymentPspReference: the PSP reference of the authorization you want to cancel.pspReference: Adyen's unique reference associated with this cancel request.
{ "merchantAccount": "ADYEN_MERCHANT_ACCOUNT", "paymentPspReference": "XB7XNCQ8HXSKGK82", "pspReference" : "JDD6LKT8MBLZNN84", "reference": "YOUR_UNIQUE_REFERENCE", "status" : "received" } -
Wait for the CANCELLATION webhook to learn the outcome of the cancel request.
CANCELLATION webhook
You receive the outcome of the cancel request asynchronously, in a webhook that includes :
eventCode: CANCELLATION.originalReference: The PSP reference of the authorization.pspReference: The same as thepspReferencein the /payments/{paymentPspReference}/cancels response.-
success: Indicates whether the cancel request was successful. Possible values:- true: The cancel request was successful.
- false: The cancel request failed. The webhook event includes a
reasonfield with a short description of the problem. Review the reason, fix the issue if possible, and resubmit the cancel request.
For more information about the included fields, see the CANCELLATION webhook reference.