POST /cancelOrRefund

Cancels a payment if it has not been captured yet, or refunds it if it has already been captured. This is useful when it is not certain if the payment has been captured or not (for example, when using auto-capture).

Do not use this endpoint for payments that involve:

Instead, check if the payment has been captured and make a corresponding /refund or /cancel call.

For more information, refer to Cancel or refund.

This endpoint is part of our classic API integration. If using a newer integration, use the /payments/{paymentPspReference}/reversals endpoint under Checkout API instead.

Servers

Request headers

Name Type Required Description
Content-Type String Yes The media type of the request body.

Default value: "application/json"

Request body fields

Name Type Required Description
uniqueTerminalId String No

Unique terminal ID for the PED that originally processed the request. For point-of-sale integrations only.

originalReference String Yes

The original pspReference of the payment to modify. This reference is returned in:

  • authorisation response
  • authorisation notification
tenderReference String No

The transaction reference provided by the PED. For point-of-sale integrations only.

merchantAccount String Yes

The merchant account that is used to process the payment.

mpiData Object No

Authentication data produced by an MPI (Mastercard SecureCode, Visa Secure, or Cartes Bancaires).

mpiData.riskScore String No

Risk score calculated by Directory Server (DS). Required for Cartes Bancaires integrations.

mpiData.eci String No

The electronic commerce indicator.

mpiData.cavvAlgorithm String No

The CAVV algorithm used. Include this only for 3D Secure 1.

mpiData.authenticationResponse String No

In 3D Secure 1, the authentication response if the shopper was redirected.

In 3D Secure 2, this is the transStatus from the challenge result. If the transaction was frictionless, omit this parameter.

Possible values:

  • "A"
  • "N"
  • "Y"
  • "U"
mpiData.directoryResponse String No

In 3D Secure 1, this is the enrollment response from the 3D directory server.

In 3D Secure 2, this is the transStatus from the ARes.

Possible values:

  • "D"
  • "C"
  • "R"
  • "A"
  • "N"
  • "I"
  • "Y"
  • "U"
mpiData.threeDSVersion String No

The version of the 3D Secure protocol.

mpiData.challengeCancel String No

Indicator informing the Access Control Server (ACS) and the Directory Server (DS) that the authentication has been cancelled. For possible values, refer to 3D Secure API reference.

Possible values:

  • "07"
  • "06"
  • "05"
  • "04"
  • "03"
  • "02"
  • "01"
mpiData.dsTransID String No

Supported for 3D Secure 2. The unique transaction identifier assigned by the Directory Server (DS) to identify a single transaction.

mpiData.tokenAuthenticationVerificationValue String No

Network token authentication verification value (TAVV). The network token cryptogram.

mpiData.xid String No

Supported for 3D Secure 1. The transaction identifier (Base64-encoded, 20 bytes in a decoded form).

mpiData.transStatusReason String No

Provides information on why the transStatus field has the specified value. For possible values, refer to our docs.

mpiData.cavv String No

The cardholder authentication value (base64 encoded, 20 bytes in a decoded form).

originalMerchantReference String No

The original merchant reference to cancel.

reference String No

Your reference for the payment modification. This reference is visible in Customer Area and in reports. Maximum length: 80 characters.

additionalData Object No

This field contains additional data, which may be required for a particular modification request.

The additionalData object consists of entries, each of which includes the key and value.

platformChargebackLogic Object No

Defines how to book chargebacks when using Adyen for Platforms.

platformChargebackLogic.costAllocationAccount String No

The unique identifier of the balance account to which the chargeback fees are booked. By default, the chargeback fees are booked to your liable balance account.

platformChargebackLogic.targetAccount String No

The unique identifier of the balance account against which the disputed amount is booked.

Required if behavior is deductFromOneBalanceAccount.

platformChargebackLogic.behavior String No

The method of handling the chargeback.

Possible values: deductFromLiableAccount, deductFromOneBalanceAccount, deductAccordingToSplitRatio.

Possible values:

  • "deductAccordingToSplitRatio"
  • "deductFromOneBalanceAccount"
  • "deductFromLiableAccount"

How to start integrating

  1. Add HTTP Task to your workflow definition.
  2. Search for the API you want to integrate with and click on the name.
    • This loads the API reference documentation and prepares the Http request settings.
  3. Click Test request to test run your request to the API and see the API's response.