POST /getCostEstimate

This API is available only for merchants operating in Australia, the EU, and the UK.

Use the Adyen Cost Estimation API to pre-calculate interchange and scheme fee costs. Knowing these costs prior actual payment authorisation gives you an opportunity to charge those costs to the cardholder, if necessary.

To retrieve this information, make the call to the /getCostEstimate endpoint. The response to this call contains the amount of the interchange and scheme fees charged by the network for this transaction, and also which surcharging policy is possible (based on current regulations).

Since not all information is known in advance (for example, if the cardholder will successfully authenticate via 3D Secure or if you also plan to provide additional Level 2/3 data), the returned amounts are based on a set of assumption criteria you define in the assumptions parameter.

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
shopperInteraction String No

Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default.

This field has the following possible values:

  • Ecommerce - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request.
  • ContAuth - Card on file and/or subscription transactions, where the card holder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment).
  • Moto - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone.
  • POS - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal.

Possible values:

  • "ContAuth"
  • "Ecommerce"
  • "POS"
  • "Moto"
shopperReference String No

Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters.

Your reference must not include personally identifiable information (PII), for example name or email address.

amount Object Yes

The transaction amount used as a base for the cost estimation.

amount.value Integer Yes

The amount of the transaction, in minor units.

amount.currency String Yes

The three-character ISO currency code.

cardNumber String No

The card number (4-19 characters) for PCI compliant use cases. Do not use any separators.

Either the cardNumber or encryptedCardNumber field must be provided in a payment request.

merchantDetails Object No

Additional data for merchants who don't use Adyen as the payment authorisation gateway.

merchantDetails.enrolledIn3DSecure Boolean No

If true, indicates that the merchant is enrolled in 3D Secure for the card network.

merchantDetails.mcc String No

The merchant category code (MCC) is a four-digit number which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant.

The list of MCCs can be found here.

merchantDetails.countryCode String No

2-letter ISO 3166 country code of the card acceptor location.

This parameter is required for the merchants who don't use Adyen as the payment authorisation gateway.

recurring Object No

The recurring settings for the payment. Use this property when you want to enable recurring payments.

recurring.contract String No

The type of recurring contract to be used. Possible values:

  • ONECLICK – Payment details can be used to initiate a one-click payment, where the shopper enters the card security code (CVC/CVV).
  • RECURRING – Payment details can be used without the card security code to initiate card-not-present transactions.
  • ONECLICK,RECURRING – Payment details can be used regardless of whether the shopper is on your site or not.
  • PAYOUT – Payment details can be used to make a payout.

Possible values:

  • "ONECLICK"
  • "PAYOUT"
  • "RECURRING"
recurring.recurringExpiry String No

Date after which no further authorisations shall be performed. Only for 3D Secure 2.

recurring.recurringFrequency String No

Minimum number of days between authorisations. Only for 3D Secure 2.

recurring.tokenService String No

The name of the token service.

Possible values:

  • "MCTOKENSERVICE"
  • "AMEXTOKENSERVICE"
  • "VISATOKENSERVICE"
  • "TOKEN_SHARING"
recurring.recurringDetailName String No

A descriptive name for this detail.

assumptions Object No

Assumptions made for the expected characteristics of the transaction, for which the charges are being estimated.

assumptions.installments Integer No

If not zero, the number of installments.

assumptions.assume3DSecureAuthenticated Boolean No

If true, the cardholder is expected to successfully authorise via 3D Secure.

assumptions.assumeLevel3Data Boolean No

If true, the transaction is expected to have valid Level 3 data.

merchantAccount String Yes

The merchant account identifier you want to process the (transaction) request with.

selectedRecurringDetailReference String No

The recurringDetailReference you want to use for this cost estimate. The value LATEST can be used to select the most recently stored recurring detail.

encryptedCardNumber String No

Encrypted data that stores card information for non PCI-compliant use cases. The encrypted data must be created with the Checkout Card Component or Secured Fields Component, and must contain the encryptedCardNumber field.

Either the cardNumber or encryptedCardNumber field must be provided in a payment request.

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.