You can cancel a payment before you capture it, in the following scenario: if the payment was made with a payment method that allows you to capture it separately from authorization. When you cancel the payment, the financial institution releases the funds back to the shopper's bank account.
Requirements
| Requirement | Description |
|---|---|
| Integration type | An online payments integration. |
| Customer Area roles | Make sure that you have the following roles:
|
| Webhooks | Listen for webhook messages with the following eventCode values:
|
| Limitations | After a payment has been captured, you can no longer cancel it. |
Ways to cancel a payment
After you determine that a payment has not been captured, you can cancel it in the following using one of the following:
Cancel a payment using the Customer Area
To cancel a payment in your Customer Area:
- Go to Transactions > Payments.
- Select the PSP reference of the payment that you want to cancel.
This opens the Payment details page. - Select Manage payment > Cancel payment. The Cancel payment button is available only if the payment has not been captured.
- Enter the confirmation code.
- Select Cancel payment.
Cancel a payment using the Checkout API
You can cancel a payment with the following information:
- Adyen's PSP reference: the
pspReferencefrom the AUTHORISATION webhook to cancel the payment. - Your payment reference: the
referencethat you included in the /payments or /sessions request for the original payment. You can do this up to 24 hours after authorization.
Cancel with PSP reference
To cancel a payment that has been authorized but not captured yet:
-
Get the PSP reference of the authorized payment you want to cancel. You can get it from your transaction list in Customer Area or the AUTHORISATION webhook for the payment.
-
Make a /payments/{paymentPspReference}/cancels request including the following:
Parameter Required Description paymentPspReferenceThe PSP reference of the payment that you want to cancel. merchantAccountThe name of your merchant account that is used to process the payment. referenceYour reference for this cancel request. If you do not know if the payment has been captured, use the /payments/{paymentPspReference}/reversals endpoint instead.
The response includes the following:
Parameter Description paymentPspReferenceThe PSP reference of the payment you want to cancel. pspReferenceThe unique reference for this request to cancel the payment. -
Get the outcome of the cancellation request in the CANCELLATION webhook.
Cancel with your reference
Canceling a payment using your reference is possible up to 24 hours after authorization.
We recommend that you only cancel using the reference if you generate a unique references for each payment request and do not have the pspReference available.
-
Make a /cancels request including the following:
Parameter Required Description paymentReferenceYour reference for the payment that you want to cancel. This is the referencethat you included in the /payments or /sessions request for the original the payment.merchantAccountThe name of your merchant account that is used to process the payment. referenceYour reference for this cancel request. The response includes the following:
Parameter Description paymentReferenceYour reference for the payment you want to cancel. pspReferenceThe unique reference for this request to cancel the payment. -
Get the outcome of the cancellation request in the TECHNICAL_CANCEL webhook.
Webhooks for cancellations
The webhook that you get depends on if you made the cancel request with the PSP reference or with your own reference.
CANCELLATION webhook
If you made the cancel request with the PSP reference, you get the outcome of the cancel request in the CANCELLATION webhook. It contains the following:
eventCode: CANCELLATION.originalReference: the PSP reference for the payment that you requested to cancel.pspReference: the PSP reference for the cancel request. 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.
Reasons for an unsuccessful cancel request
When a cancel request fails, you receive a CANCELLATION webhook with success: false and the reason for the failure. The table below shows the most common reasons:
| Reason | Description |
|---|---|
| Insufficient balance on payment | There is not enough remaining balance on your payment to process the cancel. Note: The balance on the payment refers to the amount that remains from the original payment. For example, if a transaction has a total of EUR 10 and no refund or chargeback is processed, the balance on the payment is EUR 10. After a refund or chargeback of EUR 3 is processed, the remaining balance on the payment is EUR 7. This transaction-specific balance is independent of, and not to be confused with, your merchant or company account balances. Check the payment status in your Customer Area. |
| Transaction not found | The cancel failed because:
paymentReference you provided is correct and linked to the right account. |
| Transaction is expired | The authorization for this payment has expired. You can no longer cancel it. |
| Operation not available | The cancel operation is not available for this payment. |
For more information about the included fields, see the CANCELLATION webhook reference.
TECHNICAL_CANCEL webhook
If you made the cancel request with your reference, you get the outcome of the request in the TECHNICAL_CANCEL webhook. It contains the following:
eventCode: TECHNICAL_CANCELpspReference: The PSP reference for the cancel request. This is the same as thepspReferencefrom the /cancels response.originalReference: The PSP reference for the payment that you requested to cancel.success: Indicates whether the cancel request was successful.
For more information about the included fields, see the TECHNICAL_CANCEL webhook reference.