Cancel

Cancel the authorisation on an uncaptured payment.


 

Payments lifecycle

Cancelling a payment transfers its status from Authorised to Cancelled. For more information, refer to Payments lifecycle.

For some payment methods, the payment is completed in two steps:

  1. Authorisation – The payment details of the shopper are verified, and the funds are reserved.
  2. Capture –  The reserved funds are transferred from the shopper to your account. 

When the payment has been authorised but not yet captured, you can cancel the authorisation on the payment.

There are two ways to cancel a payment: 

If you are not sure whether the payment has been captured, use the Cancel or refund modification instead.

Cancel with PSP reference 

To cancel a payment, make a request to the  /cancel endpoint. You need to specify: 
  • merchantAccount: The name of your merchant account that is used to process the payment.
  • originalReference: The original pspReference of the payment that you want to cancel. This reference is returned in the response to your payment request, and in the AUTHORISATION notification.
{
    "merchantAccount" : "YourMerchantAccount",
    "originalReference" : "8313547924770610",
    "reference" : "YourModificationReference"
}

You will receive a /cancel response containing: 

  • pspReference: The PSP reference associated with this /cancel request. Note that this is different from the PSP reference associated with the original payment request. 
{
    "pspReference" : "8412534564722331",
    "response" : "[cancel-received]"
}

Notifications

Once we have processed your cancel request, we will send you a notification with:

  • eventCodeCANCELLATION.
  • pspReference: Same as the pspReference in the /cancel response.
  • success: Indicates whether the cancel request was successful. Possible values:
    • true: the cancel request was successful.
    • false the cancel request failed. The notification includes a reason field with a short description of the problem. Review the reason, fix the issue if possible, and resubmit the cancel request.
{
   "live":"false",
   "notificationItems":[
      {
         "NotificationRequestItem":{
            "amount":{
               "currency":"EUR",
               "value":500
            },
            "eventCode":"CANCELLATION",
            "eventDate":"2018-03-05T09:08:05+01:00",
            "merchantAccountCode":"YourMerchantAccount",
            "originalReference":"8313547924770610",
            "paymentMethod":"mc",
            "pspReference":"8412534564722331",
            "reason":"",
            "success":"true"
         }
      }
   ]
}
{
   "live":"false",
   "notificationItems":[
      {
         "NotificationRequestItem":{
            "amount":{
               "currency":"EUR",
               "value":500
            },
            "eventCode":"CANCELLATION",
            "eventDate":"2018-03-05T09:08:05+01:00",
            "merchantAccountCode":"YourMerchantAccount",
            "originalReference":"8313547924770610",
            "paymentMethod":"mc",
            "pspReference":"8412534564722331",
            "reason":"Transaction not found",
            "success":"false"
         }
      }
   ]
}

For more information about the fields included in the CANCELLATION notification, refer to Notifications API

Cancel without PSP reference

If you don't have the pspReference of the original payment, you can instead cancel a payment by specifying your unique reference from the original payment.

Only use technical cancel if you don't have the PSP reference of the original payment available. Otherwise, use the standard cancel instead.

Make a request to the  /technicalCancel endpoint, specifying:
  • merchantAccountThe name of your merchant account that is used to process the payment.
  • originalMerchantReference: The value that you used as your reference in the payment request.
{
  "merchantAccount": "YourMerchantAccount",
  "originalMerchantReference": "YourMerchantReference",
  "reference": "YourModificationReference"
}

You will receive a /technicalCancel response containing: 

  • pspReferenceThe PSP reference associated with this /technicalCancel request. Note that this is different from the PSP reference associated with the original payment request.  
{
   "pspReference":"8515208516304269",
   "response":"[technical-cancel-received]"
}

Notifications

Once we have processed your cancel request, we send you a notification with:

  • eventCodeTECHNICAL_CANCEL
  • pspReference: Same as the pspReference in the /technicalCancel response. 
  • success: Indicates whether the cancel request was successful. 
{
   "live":"false",
   "notificationItems":[
      {
         "NotificationRequestItem":{
            "additionalData":{
               "paymentMethodVariant":"visa"
            },
            "amount":{
               "currency":"EUR",
               "value":5000
            },
            "eventCode":"TECHNICAL_CANCEL",
            "eventDate":"2018-07-18T22:35:14+02:00",
            "merchantAccountCode":"YourMerchantAccount",
            "merchantReference":"YourMerchantReference"
            "originalReference":"8313547924770610",
            "paymentMethod":"visa",
            "pspReference":"8515208516304269",
            "reason":"",
            "success":"true"
         }
      }
   ]
}

For more information about the fields included in the TECHNICAL_CANCEL notification, refer to Notifications API

See also