--- title: "Implement SCA compliance" description: "Learn how to implement required PSD2 SCA compliance for your transactions." url: "https://docs.adyen.com/online-payments/psd2-sca-compliance-and-implementation-guide/sca-options" source_url: "https://docs.adyen.com/online-payments/psd2-sca-compliance-and-implementation-guide/sca-options.md" canonical: "https://docs.adyen.com/online-payments/psd2-sca-compliance-and-implementation-guide/sca-options" last_modified: "2023-04-07T15:29:00+02:00" language: "en" --- # Implement SCA compliance Learn how to implement required PSD2 SCA compliance for your transactions. [View source](/online-payments/psd2-sca-compliance-and-implementation-guide/sca-options.md) [Do your transactions need to be PSD2 SCA compliant?](/online-payments/psd2-sca-compliance-and-implementation-guide#are-my-payments-affected) If yes, you need to [implement 3D Secure](/online-payments/3d-secure). After you have implemented 3D Secure with Adyen, choose one of the [compliance options](#compliance-options) on this page to comply with PSD2 SCA. ## Requirements Before you begin, take into account the following requirements: | Requirement | Description | | -------------------- | ----------------------------------------------------------------------------------------------------------------------- | | **Integration type** | An [online payments integration](/online-payments/build-your-integration) with [3D Secure](/online-payments/3d-secure). | ## Guidelines for compliance PSD2 mandates strong customer authentication for online payments and online banking transactions. This means that before issuing banks authenticate a transaction, the shopper is required to provide two out of three factors: * Something only the shopper knows. * Something only the shopper possesses. * Something the shopper is. For example, before an issuing bank authenticates and authorizes a payment, a shopper is required to supply an account password (something the shopper knows) and a one-time authentication code (something the shopper possesses). Along with 3D Secure, you can ensure your transactions meet SCA requirements by using local payment methods and international wallets. Depending on your market and use case, using these may result in significantly higher conversion rates. See our [payment method overview](/payment-methods) page for all payment method options. Regardless of the option you choose, note that the general rule for chargeback liability shift applies: * If you, Adyen on your behalf, or your acquirer requests an exemption and the request is accepted by the issuer, the liability stays with you. * If the exemption is applied by the issuer, the liability shifts to the issuer. ## SCA requirements for online payments ### One-off payments SCA can be required for one-off payments depending on regulations and scheme rules. | Payment request parameter | Initial payment | Later payment | | -------------------------- | --------------- | -------------- | | `recurringProcessingModel` | **CardOnFile** | **CardOnFile** | | `shopperInteraction` | **Ecommerce** | **ContAuth** | ### Subscriptions SCA is required for the initial payment of a subscription. | Payment request parameter | Initial payment | Later payment | | -------------------------- | ---------------- | ---------------- | | `recurringProcessingModel` | **Subscription** | **Subscription** | | `shopperInteraction` | **Ecommerce** | **ContAuth** | ### Automatic top-ups and other non-fixed schedule contracts SCA is required for the initial payment of automatic top-ups and other non-fixed schedule contracts. | Payment request parameter | Initial payment | Later payment | | -------------------------- | ------------------------- | ------------------------- | | `recurringProcessingModel` | **UnscheduledCardOnFile** | **UnscheduledCardOnFile** | | `shopperInteraction` | **Ecommerce** | **ContAuth** | SCA is also required for subscriptions and non-fixed schedule contracts when the *initial payment* takes place at the *point of sale*. The physical card plus PIN authenticates the cardholder. ## Compliance options with Adyen Adyen offers the following methods for complying with PSD2 SCA: * [Let Adyen handle PSD2 compliance by default.](#option-1-default-compliance) * [Configure rules using Dynamic 3D Secure.](#option-2-dynamic-3ds) * [Submit your preference for each transaction in your API request.](#option-3-specify-your-preference-in-the-api-request) ### Option 1: Default compliance With this option, you let Adyen handle PSD2 compliance by default. Our Authentication Engine will handle PSD2 SCA compliance for you. We will not trigger 3D Secure for out-of-scope transactions or if the issuing bank does not enforce 3D Secure. Our Authentication Engine will also handle requesting an exemption whenever applicable. ### Option 2: Dynamic 3DS With this option you use [Dynamic 3D Secure](/risk-management/dynamic-3d-secure) to define additional conditions for transactions that you want to apply 3D Secure authentication on. For example, you can set conditions to use 3D Secure for transactions that you deem as high risk. | Scenarios | Action from Adyen | | -------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Transaction meets condition with a **Use 3DS: Always** rule | We will request the issuer to perform 3D Secure 1 or 2 depending on the version supported by the issuer. | | Transaction meets condition with a **Use 3DS: Prefer no** rule | We will not request 3D Secure authentication unless the issuing bank requires it to complete the authorization. | | Transaction does not meet any of your configured rules | Our [Authentication Engine](https://www.adyen.com/knowledge-hub/psd2-simplified-with-our-new-authentication-engine) will automatically trigger 3D Secure (1 or 2) if a transaction is in scope of PSD2 and SCA is mandated. We expect issuers to soft decline unauthenticated transactions more as the transition period continues in 2020 and 2021. If an exemption is applicable for a transaction, we will manage the exemption request. For more information on how different countries/regions and issuers plan to handle PSD2 SCA compliance, refer to our [Support guide](https://help.adyen.com/knowledge/compliance/psd2-compliance/what-do-i-need-to-know-about-psd2-compliance). | See [Dynamic 3D Secure](/risk-management/dynamic-3d-secure) to learn how you can configure rules. ### Option 3: Specify your preference in the API request With this option, you specify your preference in the API request. This option overrides our default PSD2 compliance handling logic, including checking if the transaction is out of scope, determining the most suitable exemption type, and evaluating whether to send the exemption in the authentication or authorization request. We recommend you use the API fields only if you have an extensive knowledge of PSD2 SCA regulations and the 3D Secure protocol. We support the following scenarios using the API request: ### Tab: **Perform 3DS authentication** With this option, you specify whether to perform 3D Secure on a per-transaction basis. If you include one of the following parameters, it overrides any Dynamic 3D Secure rules that you have configured. #### Checkout API v69 and later * [authenticationData.attemptAuthentication](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-authenticationData-attemptAuthentication): Optional Indicates if you want to perform 3D Secure authentication for the particular transaction. Possible values: * **always**: Perform 3D Secure authentication. * **never**: Do not perform 3D Secure authentication. If PSD2 SCA regulations require that you must perform authentication, the transaction gets declined. **\/payments\ request to perform 3D Secure authentication** #### curl ```bash curl https://checkout-test.adyen.com/v72/payments \ -H 'x-api-key: ADYEN_API_KEY' \ -H 'content-type: application/json' \ -d '{ "amount":{ "currency":"EUR", "value":1000 }, "reference":"YOUR_ORDER_NUMBER", "paymentMethod":{ "type":"scheme", "encryptedCardNumber":"adyenjs_0_1_18$MT6ppy0FAMVMLH...", "encryptedExpiryMonth":"adyenjs_0_1_18$MT6ppy0FAMVMLH...", "encryptedExpiryYear":"adyenjs_0_1_18$MT6ppy0FAMVMLH...", "encryptedSecurityCode":"adyenjs_0_1_18$MT6ppy0FAMVMLH...", "holderName":"S. Hopper" }, "authenticationData" : { "attemptAuthentication" : "always", "threeDSRequestData": { "nativeThreeDS": "preferred" } }, "browserInfo":{ "userAgent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/70.0.3538.110 Safari\/537.36", "acceptHeader":"text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8", "language":"nl-NL", "colorDepth":24, "screenHeight":723, "screenWidth":1536, "timeZoneOffset":0, "javaEnabled": true }, "shopperIP": "192.0.2.1", "channel" : "web", "origin" : "https://your-company.example.com/", "returnUrl" : "https://your-company.example.com/checkout/", "merchantAccount":"YOUR_MERCHANT_ACCOUNT" }' ``` #### Java ```java // Adyen Java API Library v27.0.0 import com.adyen.Client; import com.adyen.enums.Environment; import com.adyen.model.checkout.*; import java.time.OffsetDateTime; import java.util.*; import com.adyen.model.RequestOptions; import com.adyen.service.checkout.*; // For the live environment, additionally include your liveEndpointUrlPrefix. Client client = new Client("ADYEN_API_KEY", Environment.TEST); // Create the request object(s) ThreeDSRequestData threeDSRequestData = new ThreeDSRequestData() .nativeThreeDS(ThreeDSRequestData.NativeThreeDSEnum.PREFERRED); AuthenticationData authenticationData = new AuthenticationData() .threeDSRequestData(threeDSRequestData) .attemptAuthentication(AuthenticationData.AttemptAuthenticationEnum.ALWAYS); Amount amount = new Amount() .currency("EUR") .value(1000L); CardDetails cardDetails = new CardDetails() .encryptedCardNumber("adyenjs_0_1_18$MT6ppy0FAMVMLH...") .holderName("S. Hopper") .encryptedSecurityCode("adyenjs_0_1_18$MT6ppy0FAMVMLH...") .encryptedExpiryYear("adyenjs_0_1_18$MT6ppy0FAMVMLH...") .encryptedExpiryMonth("adyenjs_0_1_18$MT6ppy0FAMVMLH...") .type(CardDetails.TypeEnum.SCHEME); BrowserInfo browserInfo = new BrowserInfo() .acceptHeader("text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8") .screenWidth(1536) .javaEnabled(true) .screenHeight(723) .timeZoneOffset(0) .userAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36") .language("nl-NL") .colorDepth(24); PaymentRequest paymentRequest = new PaymentRequest() .reference("YOUR_ORDER_NUMBER") .authenticationData(authenticationData) .amount(amount) .merchantAccount("YOUR_MERCHANT_ACCOUNT") .origin("https://your-company.example.com/") .channel(PaymentRequest.ChannelEnum.WEB) .paymentMethod(new CheckoutPaymentMethod(cardDetails)) .shopperIP("192.0.2.1") .returnUrl("https://your-company.example.com/checkout/") .browserInfo(browserInfo); // Send the request PaymentsApi service = new PaymentsApi(client); PaymentResponse response = service.payments(paymentRequest, new RequestOptions().idempotencyKey("UUID")); ``` #### PHP ```php // Adyen PHP API Library v19.0.0 use Adyen\Client; use Adyen\Environment; use Adyen\Model\Checkout\ThreeDSRequestData; use Adyen\Model\Checkout\AuthenticationData; use Adyen\Model\Checkout\Amount; use Adyen\Model\Checkout\CheckoutPaymentMethod; use Adyen\Model\Checkout\BrowserInfo; use Adyen\Model\Checkout\PaymentRequest; use Adyen\Service\Checkout\PaymentsApi; $client = new Client(); $client->setXApiKey("ADYEN_API_KEY"); // For the live environment, additionally include your liveEndpointUrlPrefix. $client->setEnvironment(Environment::TEST); // Create the request object(s) $threeDSRequestData = new ThreeDSRequestData(); $threeDSRequestData ->setNativeThreeDS("preferred"); $authenticationData = new AuthenticationData(); $authenticationData ->setThreeDSRequestData($threeDSRequestData) ->setAttemptAuthentication("always"); $amount = new Amount(); $amount ->setCurrency("EUR") ->setValue(1000); $checkoutPaymentMethod = new CheckoutPaymentMethod(); $checkoutPaymentMethod ->setEncryptedCardNumber("adyenjs_0_1_18\$MT6ppy0FAMVMLH...") ->setHolderName("S. Hopper") ->setEncryptedSecurityCode("adyenjs_0_1_18\$MT6ppy0FAMVMLH...") ->setEncryptedExpiryYear("adyenjs_0_1_18\$MT6ppy0FAMVMLH...") ->setEncryptedExpiryMonth("adyenjs_0_1_18\$MT6ppy0FAMVMLH...") ->setType("scheme"); $browserInfo = new BrowserInfo(); $browserInfo ->setAcceptHeader("text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8") ->setScreenWidth(1536) ->setJavaEnabled(true) ->setScreenHeight(723) ->setTimeZoneOffset(0) ->setUserAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36") ->setLanguage("nl-NL") ->setColorDepth(24); $paymentRequest = new PaymentRequest(); $paymentRequest ->setReference("YOUR_ORDER_NUMBER") ->setAuthenticationData($authenticationData) ->setAmount($amount) ->setMerchantAccount("YOUR_MERCHANT_ACCOUNT") ->setOrigin("https://your-company.example.com/") ->setChannel("web") ->setPaymentMethod($checkoutPaymentMethod) ->setShopperIP("192.0.2.1") ->setReturnUrl("https://your-company.example.com/checkout/") ->setBrowserInfo($browserInfo); $requestOptions['idempotencyKey'] = 'UUID'; // Send the request $service = new PaymentsApi($client); $response = $service->payments($paymentRequest, $requestOptions); ``` #### C\# ```cs // Adyen .net API Library v17.0.0 using Adyen; using Environment = Adyen.Model.Environment; using Adyen.Model; using Adyen.Model.Checkout; using Adyen.Service.Checkout; // For the live environment, additionally include your liveEndpointUrlPrefix. var config = new Config() { XApiKey = "ADYEN_API_KEY", Environment = Environment.Test }; var client = new Client(config); // Create the request object(s) ThreeDSRequestData threeDSRequestData = new ThreeDSRequestData { NativeThreeDS = ThreeDSRequestData.NativeThreeDSEnum.Preferred }; AuthenticationData authenticationData = new AuthenticationData { ThreeDSRequestData = threeDSRequestData, AttemptAuthentication = AuthenticationData.AttemptAuthenticationEnum.Always }; Amount amount = new Amount { Currency = "EUR", Value = 1000 }; CardDetails cardDetails = new CardDetails { EncryptedCardNumber = "adyenjs_0_1_18$MT6ppy0FAMVMLH...", HolderName = "S. Hopper", EncryptedSecurityCode = "adyenjs_0_1_18$MT6ppy0FAMVMLH...", EncryptedExpiryYear = "adyenjs_0_1_18$MT6ppy0FAMVMLH...", EncryptedExpiryMonth = "adyenjs_0_1_18$MT6ppy0FAMVMLH...", Type = CardDetails.TypeEnum.Scheme }; BrowserInfo browserInfo = new BrowserInfo { AcceptHeader = "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", ScreenWidth = 1536, JavaEnabled = true, ScreenHeight = 723, TimeZoneOffset = 0, UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", Language = "nl-NL", ColorDepth = 24 }; PaymentRequest paymentRequest = new PaymentRequest { Reference = "YOUR_ORDER_NUMBER", AuthenticationData = authenticationData, Amount = amount, MerchantAccount = "YOUR_MERCHANT_ACCOUNT", Origin = "https://your-company.example.com/", Channel = PaymentRequest.ChannelEnum.Web, PaymentMethod = new CheckoutPaymentMethod(cardDetails), ShopperIP = "192.0.2.1", ReturnUrl = "https://your-company.example.com/checkout/", BrowserInfo = browserInfo }; // Send the request var service = new PaymentsService(client); var response = service.Payments(paymentRequest, requestOptions: new RequestOptions { IdempotencyKey = "UUID"}); ``` #### NodeJS (JavaScript) ```js // Adyen Node API Library v18.0.0 // Require the parts of the module you want to use const { Client, CheckoutAPI } = require('@adyen/api-library'); // Initialize the client object // For the live environment, additionally include your liveEndpointUrlPrefix. const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"}); // Create the request object(s) const paymentRequest = { amount: { currency: "EUR", value: 1000 }, reference: "YOUR_ORDER_NUMBER", paymentMethod: { type: "scheme", encryptedCardNumber: "adyenjs_0_1_18$MT6ppy0FAMVMLH...", encryptedExpiryMonth: "adyenjs_0_1_18$MT6ppy0FAMVMLH...", encryptedExpiryYear: "adyenjs_0_1_18$MT6ppy0FAMVMLH...", encryptedSecurityCode: "adyenjs_0_1_18$MT6ppy0FAMVMLH...", holderName: "S. Hopper" }, authenticationData: { attemptAuthentication: "always", threeDSRequestData: { nativeThreeDS: "preferred" } }, browserInfo: { userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", acceptHeader: "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", language: "nl-NL", colorDepth: 24, screenHeight: 723, screenWidth: 1536, timeZoneOffset: 0, javaEnabled: true }, shopperIP: "192.0.2.1", channel: "web", origin: "https://your-company.example.com/", returnUrl: "https://your-company.example.com/checkout/", merchantAccount: "YOUR_MERCHANT_ACCOUNT" } // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` #### Go ```go // Adyen Go API Library v10.4.0 import ( "context" "github.com/adyen/adyen-go-api-library/v9/src/common" "github.com/adyen/adyen-go-api-library/v9/src/adyen" "github.com/adyen/adyen-go-api-library/v9/src/checkout" ) // For the live environment, additionally include your liveEndpointUrlPrefix. client := adyen.NewClient(&common.Config{ ApiKey: "ADYEN_API_KEY", Environment: common.TestEnv, }) // Create the request object(s) threeDSRequestData := checkout.ThreeDSRequestData{ NativeThreeDS: common.PtrString("preferred"), } authenticationData := checkout.AuthenticationData{ ThreeDSRequestData: &threeDSRequestData, AttemptAuthentication: common.PtrString("always"), } amount := checkout.Amount{ Currency: "EUR", Value: 1000, } cardDetails := checkout.CardDetails{ EncryptedCardNumber: common.PtrString("adyenjs_0_1_18$MT6ppy0FAMVMLH..."), HolderName: common.PtrString("S. Hopper"), EncryptedSecurityCode: common.PtrString("adyenjs_0_1_18$MT6ppy0FAMVMLH..."), EncryptedExpiryYear: common.PtrString("adyenjs_0_1_18$MT6ppy0FAMVMLH..."), EncryptedExpiryMonth: common.PtrString("adyenjs_0_1_18$MT6ppy0FAMVMLH..."), Type: common.PtrString("scheme"), } browserInfo := checkout.BrowserInfo{ AcceptHeader: "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", ScreenWidth: 1536, JavaEnabled: true, ScreenHeight: 723, TimeZoneOffset: 0, UserAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", Language: "nl-NL", ColorDepth: 24, } paymentRequest := checkout.PaymentRequest{ Reference: "YOUR_ORDER_NUMBER", AuthenticationData: &authenticationData, Amount: amount, MerchantAccount: "YOUR_MERCHANT_ACCOUNT", Origin: common.PtrString("https://your-company.example.com/"), Channel: common.PtrString("web"), PaymentMethod: checkout.CardDetailsAsCheckoutPaymentMethod(&cardDetails), ShopperIP: common.PtrString("192.0.2.1"), ReturnUrl: "https://your-company.example.com/checkout/", BrowserInfo: &browserInfo, } // Send the request service := client.Checkout() req := service.PaymentsApi.PaymentsInput().IdempotencyKey("UUID").PaymentRequest(paymentRequest) res, httpRes, err := service.PaymentsApi.Payments(context.Background(), req) ``` #### Python ```py # Adyen Python API Library v12.5.1 import Adyen adyen = Adyen.Adyen() adyen.client.xapikey = "ADYEN_API_KEY" # For the live environment, additionally include your liveEndpointUrlPrefix. adyen.client.platform = "test" # The environment to use library in. # Create the request object(s) json_request = { "amount": { "currency": "EUR", "value": 1000 }, "reference": "YOUR_ORDER_NUMBER", "paymentMethod": { "type": "scheme", "encryptedCardNumber": "adyenjs_0_1_18$MT6ppy0FAMVMLH...", "encryptedExpiryMonth": "adyenjs_0_1_18$MT6ppy0FAMVMLH...", "encryptedExpiryYear": "adyenjs_0_1_18$MT6ppy0FAMVMLH...", "encryptedSecurityCode": "adyenjs_0_1_18$MT6ppy0FAMVMLH...", "holderName": "S. Hopper" }, "authenticationData": { "attemptAuthentication": "always", "threeDSRequestData": { "nativeThreeDS": "preferred" } }, "browserInfo": { "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "acceptHeader": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "language": "nl-NL", "colorDepth": 24, "screenHeight": 723, "screenWidth": 1536, "timeZoneOffset": 0, "javaEnabled": True }, "shopperIP": "192.0.2.1", "channel": "web", "origin": "https://your-company.example.com/", "returnUrl": "https://your-company.example.com/checkout/", "merchantAccount": "YOUR_MERCHANT_ACCOUNT" } # Send the request result = adyen.checkout.payments_api.payments(request=json_request, idempotency_key="UUID") ``` #### Ruby ```rb # Adyen Ruby API Library v9.5.1 require "adyen-ruby-api-library" adyen = Adyen::Client.new adyen.api_key = 'ADYEN_API_KEY' # For the live environment, additionally include your liveEndpointUrlPrefix. adyen.env = :test # Set to "live" for live environment # Create the request object(s) request_body = { :amount => { :currency => 'EUR', :value => 1000 }, :reference => 'YOUR_ORDER_NUMBER', :paymentMethod => { :type => 'scheme', :encryptedCardNumber => 'adyenjs_0_1_18$MT6ppy0FAMVMLH...', :encryptedExpiryMonth => 'adyenjs_0_1_18$MT6ppy0FAMVMLH...', :encryptedExpiryYear => 'adyenjs_0_1_18$MT6ppy0FAMVMLH...', :encryptedSecurityCode => 'adyenjs_0_1_18$MT6ppy0FAMVMLH...', :holderName => 'S. Hopper' }, :authenticationData => { :attemptAuthentication => 'always', :threeDSRequestData => { :nativeThreeDS => 'preferred' } }, :browserInfo => { :userAgent => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36', :acceptHeader => 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8', :language => 'nl-NL', :colorDepth => 24, :screenHeight => 723, :screenWidth => 1536, :timeZoneOffset => 0, :javaEnabled => true }, :shopperIP => '192.0.2.1', :channel => 'web', :origin => 'https://your-company.example.com/', :returnUrl => 'https://your-company.example.com/checkout/', :merchantAccount => 'YOUR_MERCHANT_ACCOUNT' } # Send the request result = adyen.checkout.payments_api.payments(request_body, headers: { 'Idempotency-Key' => 'UUID' }) ``` #### NodeJS (TypeScript) ```ts // Adyen Node API Library v18.0.0 // Require the parts of the module you want to use import { Client, CheckoutAPI, Types } from "@adyen/api-library"; // Initialize the client object // For the live environment, additionally include your liveEndpointUrlPrefix. const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"}); // Create the request object(s) const threeDSRequestData: Types.checkout.ThreeDSRequestData = { nativeThreeDS: Types.checkout.ThreeDSRequestData.NativeThreeDSEnum.Preferred }; const authenticationData: Types.checkout.AuthenticationData = { threeDSRequestData: threeDSRequestData, attemptAuthentication: Types.checkout.AuthenticationData.AttemptAuthenticationEnum.Always }; const amount: Types.checkout.Amount = { currency: "EUR", value: 1000 }; const cardDetails: Types.checkout.CardDetails = { encryptedCardNumber: "adyenjs_0_1_18$MT6ppy0FAMVMLH...", holderName: "S. Hopper", encryptedSecurityCode: "adyenjs_0_1_18$MT6ppy0FAMVMLH...", encryptedExpiryYear: "adyenjs_0_1_18$MT6ppy0FAMVMLH...", encryptedExpiryMonth: "adyenjs_0_1_18$MT6ppy0FAMVMLH...", type: Types.checkout.CardDetails.TypeEnum.Scheme }; const browserInfo: Types.checkout.BrowserInfo = { acceptHeader: "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", screenWidth: 1536, javaEnabled: true, screenHeight: 723, timeZoneOffset: 0, userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", language: "nl-NL", colorDepth: 24 }; const paymentRequest: Types.checkout.PaymentRequest = { reference: "YOUR_ORDER_NUMBER", authenticationData: authenticationData, amount: amount, merchantAccount: "YOUR_MERCHANT_ACCOUNT", origin: "https://your-company.example.com/", channel: Types.checkout.PaymentRequest.ChannelEnum.Web, paymentMethod: cardDetails, shopperIP: "192.0.2.1", returnUrl: "https://your-company.example.com/checkout/", browserInfo: browserInfo }; // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` #### Checkout API v68 and earlier * [executeThreeD](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-additionalData-AdditionalData3DSecure-executeThreeD): Indicates if you want to perform 3D Secure authentication for the particular transaction. Possible values: * **true**: Perform 3D Secure authentication. * **false**: Do not perform 3D Secure authentication. If PSD2 SCA or other national regulations require that you must perform authentication, the transaction gets declined. **\/payments\ request for 3D Secure authentication** #### curl ```bash curl https://checkout-test.adyen.com/v68/payments \ -H 'x-api-key: ADYEN_API_KEY' \ -H 'content-type: application/json' \ -d '{ "amount":{ "currency":"EUR", "value":1000 }, "reference":"YOUR_ORDER_NUMBER", "paymentMethod":{ "type":"scheme", "encryptedCardNumber":"adyenjs_0_1_18$MT6ppy0FAMVMLH...", "encryptedExpiryMonth":"adyenjs_0_1_18$MT6ppy0FAMVMLH...", "encryptedExpiryYear":"adyenjs_0_1_18$MT6ppy0FAMVMLH...", "encryptedSecurityCode":"adyenjs_0_1_18$MT6ppy0FAMVMLH...", "holderName":"S. Hopper" }, "additionalData" : { "executeThreeD": true, "allow3DS2": true }, "browserInfo":{ "userAgent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/70.0.3538.110 Safari\/537.36", "acceptHeader":"text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8", "language":"nl-NL", "colorDepth":24, "screenHeight":723, "screenWidth":1536, "timeZoneOffset":0, "javaEnabled": true }, "shopperIP": "192.0.2.1", "channel" : "web", "origin" : "https://your-company.example.com/", "returnUrl" : "https://your-company.example.com/checkout/", "merchantAccount":"YOUR_MERCHANT_ACCOUNT" }' ``` #### Java ```java // Adyen Java API Library v32.0.0 import com.adyen.Client; import com.adyen.enums.Environment; import com.adyen.model.checkout.*; import java.time.OffsetDateTime; import java.util.*; import com.adyen.model.RequestOptions; import com.adyen.service.checkout.*; // For the LIVE environment, also include your liveEndpointUrlPrefix. Client client = new Client("ADYEN_API_KEY", Environment.TEST); // Create the request object(s) Amount amount = new Amount() .currency("EUR") .value(1000L); CardDetails cardDetails = new CardDetails() .encryptedCardNumber("adyenjs_0_1_18$MT6ppy0FAMVMLH...") .holderName("S. Hopper") .encryptedSecurityCode("adyenjs_0_1_18$MT6ppy0FAMVMLH...") .encryptedExpiryYear("adyenjs_0_1_18$MT6ppy0FAMVMLH...") .encryptedExpiryMonth("adyenjs_0_1_18$MT6ppy0FAMVMLH...") .type(CardDetails.TypeEnum.SCHEME); BrowserInfo browserInfo = new BrowserInfo() .acceptHeader("text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8") .screenWidth(1536) .javaEnabled(true) .screenHeight(723) .timeZoneOffset(0) .userAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36") .language("nl-NL") .colorDepth(24); PaymentRequest paymentRequest = new PaymentRequest() .reference("YOUR_ORDER_NUMBER") .amount(amount) .merchantAccount("YOUR_MERCHANT_ACCOUNT") .origin("https://your-company.example.com/") .channel(PaymentRequest.ChannelEnum.WEB) .paymentMethod(new CheckoutPaymentMethod(cardDetails)) .shopperIP("192.0.2.1") .additionalData(new HashMap(Map.of( "allow3DS2", "true", "executeThreeD", "true" ))) .returnUrl("https://your-company.example.com/checkout/") .browserInfo(browserInfo); // Send the request PaymentsApi service = new PaymentsApi(client); PaymentResponse response = service.payments(paymentRequest, new RequestOptions().idempotencyKey("UUID")); ``` #### PHP ```php setXApiKey("ADYEN_API_KEY"); // For the LIVE environment, also include your liveEndpointUrlPrefix. $client->setEnvironment(Environment::TEST); // Create the request object(s) $amount = new Amount(); $amount ->setCurrency("EUR") ->setValue(1000); $checkoutPaymentMethod = new CheckoutPaymentMethod(); $checkoutPaymentMethod ->setEncryptedCardNumber("adyenjs_0_1_18\$MT6ppy0FAMVMLH...") ->setHolderName("S. Hopper") ->setEncryptedSecurityCode("adyenjs_0_1_18\$MT6ppy0FAMVMLH...") ->setEncryptedExpiryYear("adyenjs_0_1_18\$MT6ppy0FAMVMLH...") ->setEncryptedExpiryMonth("adyenjs_0_1_18\$MT6ppy0FAMVMLH...") ->setType("scheme"); $browserInfo = new BrowserInfo(); $browserInfo ->setAcceptHeader("text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8") ->setScreenWidth(1536) ->setJavaEnabled(true) ->setScreenHeight(723) ->setTimeZoneOffset(0) ->setUserAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36") ->setLanguage("nl-NL") ->setColorDepth(24); $paymentRequest = new PaymentRequest(); $paymentRequest ->setReference("YOUR_ORDER_NUMBER") ->setAmount($amount) ->setMerchantAccount("YOUR_MERCHANT_ACCOUNT") ->setOrigin("https://your-company.example.com/") ->setChannel("web") ->setPaymentMethod($checkoutPaymentMethod) ->setShopperIP("192.0.2.1") ->setAdditionalData( array( "allow3DS2" => "true", "executeThreeD" => "true" ) ) ->setReturnUrl("https://your-company.example.com/checkout/") ->setBrowserInfo($browserInfo); $requestOptions['idempotencyKey'] = 'UUID'; // Send the request $service = new PaymentsApi($client); $response = $service->payments($paymentRequest, $requestOptions); ``` #### C\# ```cs // Adyen .net API Library v26.0.0 using Adyen; using Environment = Adyen.Model.Environment; using Adyen.Model; using Adyen.Model.Checkout; using Adyen.Service.Checkout; // For the LIVE environment, also include your liveEndpointUrlPrefix. var config = new Config() { XApiKey = "ADYEN_API_KEY", Environment = Environment.Test }; var client = new Client(config); // Create the request object(s) Amount amount = new Amount { Currency = "EUR", Value = 1000 }; CardDetails cardDetails = new CardDetails { EncryptedCardNumber = "adyenjs_0_1_18$MT6ppy0FAMVMLH...", HolderName = "S. Hopper", EncryptedSecurityCode = "adyenjs_0_1_18$MT6ppy0FAMVMLH...", EncryptedExpiryYear = "adyenjs_0_1_18$MT6ppy0FAMVMLH...", EncryptedExpiryMonth = "adyenjs_0_1_18$MT6ppy0FAMVMLH...", Type = CardDetails.TypeEnum.Scheme }; BrowserInfo browserInfo = new BrowserInfo { AcceptHeader = "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", ScreenWidth = 1536, JavaEnabled = true, ScreenHeight = 723, TimeZoneOffset = 0, UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", Language = "nl-NL", ColorDepth = 24 }; PaymentRequest paymentRequest = new PaymentRequest { Reference = "YOUR_ORDER_NUMBER", Amount = amount, MerchantAccount = "YOUR_MERCHANT_ACCOUNT", Origin = "https://your-company.example.com/", Channel = PaymentRequest.ChannelEnum.Web, PaymentMethod = new CheckoutPaymentMethod(cardDetails), ShopperIP = "192.0.2.1", AdditionalData = new Dictionary { { "allow3DS2", "true" }, { "executeThreeD", "true" } }, ReturnUrl = "https://your-company.example.com/checkout/", BrowserInfo = browserInfo }; // Send the request var service = new PaymentsService(client); var response = service.Payments(paymentRequest, requestOptions: new RequestOptions { IdempotencyKey = "UUID"}); ``` #### NodeJS (JavaScript) ```js // Adyen Node API Library v22.1.0 // Require the parts of the module you want to use const { Client, CheckoutAPI } = require('@adyen/api-library'); // For the LIVE environment, also include your liveEndpointUrlPrefix. const client = new Client({ apiKey: "ADYEN_API_KEY", environment: "TEST" }); // Create the request object(s) const paymentRequest = { amount: { currency: "EUR", value: 1000 }, reference: "YOUR_ORDER_NUMBER", paymentMethod: { type: "scheme", encryptedCardNumber: "adyenjs_0_1_18$MT6ppy0FAMVMLH...", encryptedExpiryMonth: "adyenjs_0_1_18$MT6ppy0FAMVMLH...", encryptedExpiryYear: "adyenjs_0_1_18$MT6ppy0FAMVMLH...", encryptedSecurityCode: "adyenjs_0_1_18$MT6ppy0FAMVMLH...", holderName: "S. Hopper" }, additionalData: { executeThreeD: true, allow3DS2: true }, browserInfo: { userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", acceptHeader: "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", language: "nl-NL", colorDepth: 24, screenHeight: 723, screenWidth: 1536, timeZoneOffset: 0, javaEnabled: true }, shopperIP: "192.0.2.1", channel: "web", origin: "https://your-company.example.com/", returnUrl: "https://your-company.example.com/checkout/", merchantAccount: "YOUR_MERCHANT_ACCOUNT" } // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` #### Go ```go // Adyen Go API Library v16.1.0 import ( "context" "github.com/adyen/adyen-go-api-library/v9/src/common" "github.com/adyen/adyen-go-api-library/v9/src/adyen" "github.com/adyen/adyen-go-api-library/v9/src/checkout" ) // For the LIVE environment, also include your liveEndpointUrlPrefix. client := adyen.NewClient(&common.Config{ ApiKey: "ADYEN_API_KEY", Environment: common.TestEnv, }) // Create the request object(s) amount := checkout.Amount{ Currency: "EUR", Value: 1000, } cardDetails := checkout.CardDetails{ EncryptedCardNumber: common.PtrString("adyenjs_0_1_18$MT6ppy0FAMVMLH..."), HolderName: common.PtrString("S. Hopper"), EncryptedSecurityCode: common.PtrString("adyenjs_0_1_18$MT6ppy0FAMVMLH..."), EncryptedExpiryYear: common.PtrString("adyenjs_0_1_18$MT6ppy0FAMVMLH..."), EncryptedExpiryMonth: common.PtrString("adyenjs_0_1_18$MT6ppy0FAMVMLH..."), Type: common.PtrString("scheme"), } browserInfo := checkout.BrowserInfo{ AcceptHeader: "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", ScreenWidth: 1536, JavaEnabled: true, ScreenHeight: 723, TimeZoneOffset: 0, UserAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", Language: "nl-NL", ColorDepth: 24, } paymentRequest := checkout.PaymentRequest{ Reference: "YOUR_ORDER_NUMBER", Amount: amount, MerchantAccount: "YOUR_MERCHANT_ACCOUNT", Origin: common.PtrString("https://your-company.example.com/"), Channel: common.PtrString("web"), PaymentMethod: checkout.CardDetailsAsCheckoutPaymentMethod(&cardDetails), ShopperIP: common.PtrString("192.0.2.1"), AdditionalData: &map[string]string{ "allow3DS2": "true", "executeThreeD": "true", }, ReturnUrl: "https://your-company.example.com/checkout/", BrowserInfo: &browserInfo, } // Send the request service := client.Checkout() req := service.PaymentsApi.PaymentsInput().IdempotencyKey("UUID").PaymentRequest(paymentRequest) res, httpRes, err := service.PaymentsApi.Payments(context.Background(), req) ``` #### Python ```py # Adyen Python API Library v13.2.0 import Adyen adyen = Adyen.Adyen() adyen.client.xapikey = "ADYEN_API_KEY" # For the LIVE environment, also include your liveEndpointUrlPrefix. adyen.client.platform = "test" # The environment to use library in. # Create the request object(s) json_request = { "amount": { "currency": "EUR", "value": 1000 }, "reference": "YOUR_ORDER_NUMBER", "paymentMethod": { "type": "scheme", "encryptedCardNumber": "adyenjs_0_1_18$MT6ppy0FAMVMLH...", "encryptedExpiryMonth": "adyenjs_0_1_18$MT6ppy0FAMVMLH...", "encryptedExpiryYear": "adyenjs_0_1_18$MT6ppy0FAMVMLH...", "encryptedSecurityCode": "adyenjs_0_1_18$MT6ppy0FAMVMLH...", "holderName": "S. Hopper" }, "additionalData": { "executeThreeD": True, "allow3DS2": True }, "browserInfo": { "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "acceptHeader": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "language": "nl-NL", "colorDepth": 24, "screenHeight": 723, "screenWidth": 1536, "timeZoneOffset": 0, "javaEnabled": True }, "shopperIP": "192.0.2.1", "channel": "web", "origin": "https://your-company.example.com/", "returnUrl": "https://your-company.example.com/checkout/", "merchantAccount": "YOUR_MERCHANT_ACCOUNT" } # Send the request result = adyen.checkout.payments_api.payments(request=json_request, idempotency_key="UUID") ``` #### Ruby ```rb # Adyen Ruby API Library v10.1.0 require "adyen-ruby-api-library" adyen = Adyen::Client.new adyen.api_key = 'ADYEN_API_KEY' # For the LIVE environment, also include your liveEndpointUrlPrefix. adyen.env = :test # Set to "live" for live environment # Create the request object(s) request_body = { :amount => { :currency => 'EUR', :value => 1000 }, :reference => 'YOUR_ORDER_NUMBER', :paymentMethod => { :type => 'scheme', :encryptedCardNumber => 'adyenjs_0_1_18$MT6ppy0FAMVMLH...', :encryptedExpiryMonth => 'adyenjs_0_1_18$MT6ppy0FAMVMLH...', :encryptedExpiryYear => 'adyenjs_0_1_18$MT6ppy0FAMVMLH...', :encryptedSecurityCode => 'adyenjs_0_1_18$MT6ppy0FAMVMLH...', :holderName => 'S. Hopper' }, :additionalData => { :executeThreeD => true, :allow3DS2 => true }, :browserInfo => { :userAgent => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36', :acceptHeader => 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8', :language => 'nl-NL', :colorDepth => 24, :screenHeight => 723, :screenWidth => 1536, :timeZoneOffset => 0, :javaEnabled => true }, :shopperIP => '192.0.2.1', :channel => 'web', :origin => 'https://your-company.example.com/', :returnUrl => 'https://your-company.example.com/checkout/', :merchantAccount => 'YOUR_MERCHANT_ACCOUNT' } # Send the request result = adyen.checkout.payments_api.payments(request_body, headers: { 'Idempotency-Key' => 'UUID' }) ``` #### NodeJS (TypeScript) ```ts // Adyen Node API Library v22.1.0 // Require the parts of the module you want to use import { Client, CheckoutAPI, Types } from "@adyen/api-library"; // For the LIVE environment, also include your liveEndpointUrlPrefix. const client = new Client({ apiKey: "ADYEN_API_KEY", environment: "TEST" }); // Create the request object(s) const amount: Types.checkout.Amount = { currency: "EUR", value: 1000 }; const cardDetails: Types.checkout.CardDetails = { encryptedCardNumber: "adyenjs_0_1_18$MT6ppy0FAMVMLH...", holderName: "S. Hopper", encryptedSecurityCode: "adyenjs_0_1_18$MT6ppy0FAMVMLH...", encryptedExpiryYear: "adyenjs_0_1_18$MT6ppy0FAMVMLH...", encryptedExpiryMonth: "adyenjs_0_1_18$MT6ppy0FAMVMLH...", type: Types.checkout.CardDetails.TypeEnum.Scheme }; const browserInfo: Types.checkout.BrowserInfo = { acceptHeader: "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", screenWidth: 1536, javaEnabled: true, screenHeight: 723, timeZoneOffset: 0, userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", language: "nl-NL", colorDepth: 24 }; const paymentRequest: Types.checkout.PaymentRequest = { reference: "YOUR_ORDER_NUMBER", amount: amount, merchantAccount: "YOUR_MERCHANT_ACCOUNT", origin: "https://your-company.example.com/", channel: Types.checkout.PaymentRequest.ChannelEnum.Web, paymentMethod: cardDetails, shopperIP: "192.0.2.1", additionalData: { "allow3DS2": "true", "executeThreeD": "true" }, returnUrl: "https://your-company.example.com/checkout/", browserInfo: browserInfo }; // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` ### Tab: **Request or apply an exemption** With this option, you request a specific exemption in the 3D Secure authentication flow. The issuer can grant or deny this request. If the exemption is granted, and you use the [authorization-only flow](/online-payments/3d-secure/other-3ds-flows/authorize-mpidata), you must also apply the exemption. Alternatively, Adyen can request exemptions for you. #### Step 1: Request an exemption To request exemption for a transaction during the authentication flow, include an additional field in your payment request, depending on your API version: ** #### Checkout API v69 and later * [threeDSRequestorChallengeInd](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-threeDS2RequestData-threeDSRequestorChallengeInd): Indicates your preference for a challenge for the particular transaction. Possible values: * **01**: No preference. Default if not set. * **02**: No challenge requested. * **03**: Challenge requested (3DS Requestor preference). * **04**: Challenge requested (Mandate). * **05**: No challenge (transactional risk analysis is already performed). The following table describes sample setting and request values: | Dynamic 3D Secure setting | scaExemption provided? | threeDSRequestorChallengeInd provided? | Action from Adyen | | ------------------------- | --------------------------------------------- | -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ALWAYS | No. | No. | Adyen performs 3D Secure authentication depending on the version the issuer supports. | | ALWAYS | Yes, for example **transactionRiskAnalysis**. | No. | Adyen applies and asks for the specified exemption in the authorization request. | | PREFERNO | Yes, for example **lowValue**. | No. | Adyen applies and asks for the specified exemption in an authorization request. Device fingerprinting isn't performed. | | PREFERNO | No. | No. | Adyen chooses the path with the highest authorization rate. | | ALWAYS | No. | Yes, for example **02**. | Adyen performs 3D Secure authentication depending on the version the issuer supports. We relay your challenge preference to the issuer. However, the issuer decides if the shopper gets a challenge. | **\/payments\ request with \No challenge requested\** #### curl ```bash curl https://checkout-test.adyen.com/v72/payments \ -H 'x-api-key: ADYEN_API_KEY' \ -H 'content-type: application/json' \ -d '{ "amount":{ "currency":"EUR", "value":1000 }, "reference":"YOUR_ORDER_NUMBER", "paymentMethod":{ "type":"scheme", "encryptedCardNumber":"adyenjs_0_1_18$MT6ppy0FAMVMLH...", "encryptedExpiryMonth":"adyenjs_0_1_18$MT6ppy0FAMVMLH...", "encryptedExpiryYear":"adyenjs_0_1_18$MT6ppy0FAMVMLH...", "encryptedSecurityCode":"adyenjs_0_1_18$MT6ppy0FAMVMLH...", "holderName":"S. Hopper" }, "threeDS2RequestData" : { "threeDSRequestorChallengeInd": "02" }, "browserInfo":{ "userAgent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/70.0.3538.110 Safari\/537.36", "acceptHeader":"text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8", "language":"nl-NL", "colorDepth":24, "screenHeight":723, "screenWidth":1536, "timeZoneOffset":0, "javaEnabled": true }, "shopperIP": "192.0.2.1", "channel" : "web", "origin" : "https://your-company.example.com/", "returnUrl" : "https://your-company.example.com/checkout/", "merchantAccount":"YOUR_MERCHANT_ACCOUNT" }' ``` #### Java ```java // Adyen Java API Library v27.0.0 import com.adyen.Client; import com.adyen.enums.Environment; import com.adyen.model.checkout.*; import java.time.OffsetDateTime; import java.util.*; import com.adyen.model.RequestOptions; import com.adyen.service.checkout.*; // For the live environment, additionally include your liveEndpointUrlPrefix. Client client = new Client("ADYEN_API_KEY", Environment.TEST); // Create the request object(s) Amount amount = new Amount() .currency("EUR") .value(1000L); ThreeDS2RequestFields threeDS2RequestFields = new ThreeDS2RequestFields() .threeDSRequestorChallengeInd(ThreeDS2RequestFields.ThreeDSRequestorChallengeIndEnum.02); CardDetails cardDetails = new CardDetails() .encryptedCardNumber("adyenjs_0_1_18$MT6ppy0FAMVMLH...") .holderName("S. Hopper") .encryptedSecurityCode("adyenjs_0_1_18$MT6ppy0FAMVMLH...") .encryptedExpiryYear("adyenjs_0_1_18$MT6ppy0FAMVMLH...") .encryptedExpiryMonth("adyenjs_0_1_18$MT6ppy0FAMVMLH...") .type(CardDetails.TypeEnum.SCHEME); BrowserInfo browserInfo = new BrowserInfo() .acceptHeader("text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8") .screenWidth(1536) .javaEnabled(true) .screenHeight(723) .timeZoneOffset(0) .userAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36") .language("nl-NL") .colorDepth(24); PaymentRequest paymentRequest = new PaymentRequest() .reference("YOUR_ORDER_NUMBER") .amount(amount) .threeDS2RequestData(threeDS2RequestFields) .merchantAccount("YOUR_MERCHANT_ACCOUNT") .origin("https://your-company.example.com/") .channel(PaymentRequest.ChannelEnum.WEB) .paymentMethod(new CheckoutPaymentMethod(cardDetails)) .shopperIP("192.0.2.1") .returnUrl("https://your-company.example.com/checkout/") .browserInfo(browserInfo); // Send the request PaymentsApi service = new PaymentsApi(client); PaymentResponse response = service.payments(paymentRequest, new RequestOptions().idempotencyKey("UUID")); ``` #### PHP ```php // Adyen PHP API Library v19.0.0 use Adyen\Client; use Adyen\Environment; use Adyen\Model\Checkout\Amount; use Adyen\Model\Checkout\ThreeDS2RequestFields; use Adyen\Model\Checkout\CheckoutPaymentMethod; use Adyen\Model\Checkout\BrowserInfo; use Adyen\Model\Checkout\PaymentRequest; use Adyen\Service\Checkout\PaymentsApi; $client = new Client(); $client->setXApiKey("ADYEN_API_KEY"); // For the live environment, additionally include your liveEndpointUrlPrefix. $client->setEnvironment(Environment::TEST); // Create the request object(s) $amount = new Amount(); $amount ->setCurrency("EUR") ->setValue(1000); $threeDS2RequestFields = new ThreeDS2RequestFields(); $threeDS2RequestFields ->setThreeDSRequestorChallengeInd("02"); $checkoutPaymentMethod = new CheckoutPaymentMethod(); $checkoutPaymentMethod ->setEncryptedCardNumber("adyenjs_0_1_18\$MT6ppy0FAMVMLH...") ->setHolderName("S. Hopper") ->setEncryptedSecurityCode("adyenjs_0_1_18\$MT6ppy0FAMVMLH...") ->setEncryptedExpiryYear("adyenjs_0_1_18\$MT6ppy0FAMVMLH...") ->setEncryptedExpiryMonth("adyenjs_0_1_18\$MT6ppy0FAMVMLH...") ->setType("scheme"); $browserInfo = new BrowserInfo(); $browserInfo ->setAcceptHeader("text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8") ->setScreenWidth(1536) ->setJavaEnabled(true) ->setScreenHeight(723) ->setTimeZoneOffset(0) ->setUserAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36") ->setLanguage("nl-NL") ->setColorDepth(24); $paymentRequest = new PaymentRequest(); $paymentRequest ->setReference("YOUR_ORDER_NUMBER") ->setAmount($amount) ->setThreeDS2RequestData($threeDS2RequestFields) ->setMerchantAccount("YOUR_MERCHANT_ACCOUNT") ->setOrigin("https://your-company.example.com/") ->setChannel("web") ->setPaymentMethod($checkoutPaymentMethod) ->setShopperIP("192.0.2.1") ->setReturnUrl("https://your-company.example.com/checkout/") ->setBrowserInfo($browserInfo); $requestOptions['idempotencyKey'] = 'UUID'; // Send the request $service = new PaymentsApi($client); $response = $service->payments($paymentRequest, $requestOptions); ``` #### C\# ```cs // Adyen .net API Library v17.0.0 using Adyen; using Environment = Adyen.Model.Environment; using Adyen.Model; using Adyen.Model.Checkout; using Adyen.Service.Checkout; // For the live environment, additionally include your liveEndpointUrlPrefix. var config = new Config() { XApiKey = "ADYEN_API_KEY", Environment = Environment.Test }; var client = new Client(config); // Create the request object(s) Amount amount = new Amount { Currency = "EUR", Value = 1000 }; ThreeDS2RequestFields threeDS2RequestFields = new ThreeDS2RequestFields { ThreeDSRequestorChallengeInd = ThreeDS2RequestFields.ThreeDSRequestorChallengeIndEnum.02 }; CardDetails cardDetails = new CardDetails { EncryptedCardNumber = "adyenjs_0_1_18$MT6ppy0FAMVMLH...", HolderName = "S. Hopper", EncryptedSecurityCode = "adyenjs_0_1_18$MT6ppy0FAMVMLH...", EncryptedExpiryYear = "adyenjs_0_1_18$MT6ppy0FAMVMLH...", EncryptedExpiryMonth = "adyenjs_0_1_18$MT6ppy0FAMVMLH...", Type = CardDetails.TypeEnum.Scheme }; BrowserInfo browserInfo = new BrowserInfo { AcceptHeader = "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", ScreenWidth = 1536, JavaEnabled = true, ScreenHeight = 723, TimeZoneOffset = 0, UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", Language = "nl-NL", ColorDepth = 24 }; PaymentRequest paymentRequest = new PaymentRequest { Reference = "YOUR_ORDER_NUMBER", Amount = amount, ThreeDS2RequestData = threeDS2RequestFields, MerchantAccount = "YOUR_MERCHANT_ACCOUNT", Origin = "https://your-company.example.com/", Channel = PaymentRequest.ChannelEnum.Web, PaymentMethod = new CheckoutPaymentMethod(cardDetails), ShopperIP = "192.0.2.1", ReturnUrl = "https://your-company.example.com/checkout/", BrowserInfo = browserInfo }; // Send the request var service = new PaymentsService(client); var response = service.Payments(paymentRequest, requestOptions: new RequestOptions { IdempotencyKey = "UUID"}); ``` #### NodeJS (JavaScript) ```js // Adyen Node API Library v18.0.0 // Require the parts of the module you want to use const { Client, CheckoutAPI } = require('@adyen/api-library'); // Initialize the client object // For the live environment, additionally include your liveEndpointUrlPrefix. const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"}); // Create the request object(s) const paymentRequest = { amount: { currency: "EUR", value: 1000 }, reference: "YOUR_ORDER_NUMBER", paymentMethod: { type: "scheme", encryptedCardNumber: "adyenjs_0_1_18$MT6ppy0FAMVMLH...", encryptedExpiryMonth: "adyenjs_0_1_18$MT6ppy0FAMVMLH...", encryptedExpiryYear: "adyenjs_0_1_18$MT6ppy0FAMVMLH...", encryptedSecurityCode: "adyenjs_0_1_18$MT6ppy0FAMVMLH...", holderName: "S. Hopper" }, threeDS2RequestData: { threeDSRequestorChallengeInd: "02" }, browserInfo: { userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", acceptHeader: "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", language: "nl-NL", colorDepth: 24, screenHeight: 723, screenWidth: 1536, timeZoneOffset: 0, javaEnabled: true }, shopperIP: "192.0.2.1", channel: "web", origin: "https://your-company.example.com/", returnUrl: "https://your-company.example.com/checkout/", merchantAccount: "YOUR_MERCHANT_ACCOUNT" } // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` #### Go ```go // Adyen Go API Library v10.4.0 import ( "context" "github.com/adyen/adyen-go-api-library/v9/src/common" "github.com/adyen/adyen-go-api-library/v9/src/adyen" "github.com/adyen/adyen-go-api-library/v9/src/checkout" ) // For the live environment, additionally include your liveEndpointUrlPrefix. client := adyen.NewClient(&common.Config{ ApiKey: "ADYEN_API_KEY", Environment: common.TestEnv, }) // Create the request object(s) amount := checkout.Amount{ Currency: "EUR", Value: 1000, } threeDS2RequestFields := checkout.ThreeDS2RequestFields{ ThreeDSRequestorChallengeInd: common.PtrString("02"), } cardDetails := checkout.CardDetails{ EncryptedCardNumber: common.PtrString("adyenjs_0_1_18$MT6ppy0FAMVMLH..."), HolderName: common.PtrString("S. Hopper"), EncryptedSecurityCode: common.PtrString("adyenjs_0_1_18$MT6ppy0FAMVMLH..."), EncryptedExpiryYear: common.PtrString("adyenjs_0_1_18$MT6ppy0FAMVMLH..."), EncryptedExpiryMonth: common.PtrString("adyenjs_0_1_18$MT6ppy0FAMVMLH..."), Type: common.PtrString("scheme"), } browserInfo := checkout.BrowserInfo{ AcceptHeader: "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", ScreenWidth: 1536, JavaEnabled: true, ScreenHeight: 723, TimeZoneOffset: 0, UserAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", Language: "nl-NL", ColorDepth: 24, } paymentRequest := checkout.PaymentRequest{ Reference: "YOUR_ORDER_NUMBER", Amount: amount, ThreeDS2RequestData: &threeDS2RequestFields, MerchantAccount: "YOUR_MERCHANT_ACCOUNT", Origin: common.PtrString("https://your-company.example.com/"), Channel: common.PtrString("web"), PaymentMethod: checkout.CardDetailsAsCheckoutPaymentMethod(&cardDetails), ShopperIP: common.PtrString("192.0.2.1"), ReturnUrl: "https://your-company.example.com/checkout/", BrowserInfo: &browserInfo, } // Send the request service := client.Checkout() req := service.PaymentsApi.PaymentsInput().IdempotencyKey("UUID").PaymentRequest(paymentRequest) res, httpRes, err := service.PaymentsApi.Payments(context.Background(), req) ``` #### Python ```py # Adyen Python API Library v12.5.1 import Adyen adyen = Adyen.Adyen() adyen.client.xapikey = "ADYEN_API_KEY" # For the live environment, additionally include your liveEndpointUrlPrefix. adyen.client.platform = "test" # The environment to use library in. # Create the request object(s) json_request = { "amount": { "currency": "EUR", "value": 1000 }, "reference": "YOUR_ORDER_NUMBER", "paymentMethod": { "type": "scheme", "encryptedCardNumber": "adyenjs_0_1_18$MT6ppy0FAMVMLH...", "encryptedExpiryMonth": "adyenjs_0_1_18$MT6ppy0FAMVMLH...", "encryptedExpiryYear": "adyenjs_0_1_18$MT6ppy0FAMVMLH...", "encryptedSecurityCode": "adyenjs_0_1_18$MT6ppy0FAMVMLH...", "holderName": "S. Hopper" }, "threeDS2RequestData": { "threeDSRequestorChallengeInd": "02" }, "browserInfo": { "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "acceptHeader": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "language": "nl-NL", "colorDepth": 24, "screenHeight": 723, "screenWidth": 1536, "timeZoneOffset": 0, "javaEnabled": True }, "shopperIP": "192.0.2.1", "channel": "web", "origin": "https://your-company.example.com/", "returnUrl": "https://your-company.example.com/checkout/", "merchantAccount": "YOUR_MERCHANT_ACCOUNT" } # Send the request result = adyen.checkout.payments_api.payments(request=json_request, idempotency_key="UUID") ``` #### Ruby ```rb # Adyen Ruby API Library v9.5.1 require "adyen-ruby-api-library" adyen = Adyen::Client.new adyen.api_key = 'ADYEN_API_KEY' # For the live environment, additionally include your liveEndpointUrlPrefix. adyen.env = :test # Set to "live" for live environment # Create the request object(s) request_body = { :amount => { :currency => 'EUR', :value => 1000 }, :reference => 'YOUR_ORDER_NUMBER', :paymentMethod => { :type => 'scheme', :encryptedCardNumber => 'adyenjs_0_1_18$MT6ppy0FAMVMLH...', :encryptedExpiryMonth => 'adyenjs_0_1_18$MT6ppy0FAMVMLH...', :encryptedExpiryYear => 'adyenjs_0_1_18$MT6ppy0FAMVMLH...', :encryptedSecurityCode => 'adyenjs_0_1_18$MT6ppy0FAMVMLH...', :holderName => 'S. Hopper' }, :threeDS2RequestData => { :threeDSRequestorChallengeInd => '02' }, :browserInfo => { :userAgent => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36', :acceptHeader => 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8', :language => 'nl-NL', :colorDepth => 24, :screenHeight => 723, :screenWidth => 1536, :timeZoneOffset => 0, :javaEnabled => true }, :shopperIP => '192.0.2.1', :channel => 'web', :origin => 'https://your-company.example.com/', :returnUrl => 'https://your-company.example.com/checkout/', :merchantAccount => 'YOUR_MERCHANT_ACCOUNT' } # Send the request result = adyen.checkout.payments_api.payments(request_body, headers: { 'Idempotency-Key' => 'UUID' }) ``` #### NodeJS (TypeScript) ```ts // Adyen Node API Library v18.0.0 // Require the parts of the module you want to use import { Client, CheckoutAPI, Types } from "@adyen/api-library"; // Initialize the client object // For the live environment, additionally include your liveEndpointUrlPrefix. const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"}); // Create the request object(s) const amount: Types.checkout.Amount = { currency: "EUR", value: 1000 }; const threeDS2RequestFields: Types.checkout.ThreeDS2RequestFields = { threeDSRequestorChallengeInd: Types.checkout.ThreeDS2RequestFields.ThreeDSRequestorChallengeIndEnum.02 }; const cardDetails: Types.checkout.CardDetails = { encryptedCardNumber: "adyenjs_0_1_18$MT6ppy0FAMVMLH...", holderName: "S. Hopper", encryptedSecurityCode: "adyenjs_0_1_18$MT6ppy0FAMVMLH...", encryptedExpiryYear: "adyenjs_0_1_18$MT6ppy0FAMVMLH...", encryptedExpiryMonth: "adyenjs_0_1_18$MT6ppy0FAMVMLH...", type: Types.checkout.CardDetails.TypeEnum.Scheme }; const browserInfo: Types.checkout.BrowserInfo = { acceptHeader: "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", screenWidth: 1536, javaEnabled: true, screenHeight: 723, timeZoneOffset: 0, userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", language: "nl-NL", colorDepth: 24 }; const paymentRequest: Types.checkout.PaymentRequest = { reference: "YOUR_ORDER_NUMBER", amount: amount, threeDS2RequestData: threeDS2RequestFields, merchantAccount: "YOUR_MERCHANT_ACCOUNT", origin: "https://your-company.example.com/", channel: Types.checkout.PaymentRequest.ChannelEnum.Web, paymentMethod: cardDetails, shopperIP: "192.0.2.1", returnUrl: "https://your-company.example.com/checkout/", browserInfo: browserInfo }; // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` ** #### Checkout API v68 and earlier * [challengeIndicator](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-threeDS2RequestData-challengeIndicator): Indicates your preference for a challenge for the particular transaction. Possible values: * **noPreference**: Default if not set. * **requestNoChallenge** * **requestChallenge** * **requestChallengeAsMandate** * **requestNoChallengeRiskAlreadyPerformed** The following table describes sample setting and request values: | Dynamic 3D Secure setting | scaExemption provided? | challengeIndicator provided? | Action from Adyen | | ------------------------- | --------------------------------------------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ALWAYS | No. | No. | Adyen performs 3D Secure authentication depending on the version the issuer supports. | | ALWAYS | Yes, for example **transactionRiskAnalysis**. | No. | Adyen applies and asks for the specified exemption in the authorization request. | | PREFERNO | Yes, for example **lowValue**. | No. | Adyen applies and asks for the specified exemption in an authorization request. Device fingerprinting isn't performed. | | PREFERNO | No. | No. | Adyen chooses the path with the highest authorization rate. | | ALWAYS | No. | Yes, for example **requestNoChallenge**. | Adyen performs 3D Secure authentication depending on the version the issuer supports. We relay your challenge preference to the issuer. However, the issuer decides if the shopper gets a challenge. | **\/payments\ request with \requestNoChallenge\** #### curl ```bash curl https://checkout-test.adyen.com/v68/payments \ -H 'x-api-key: ADYEN_API_KEY' \ -H 'content-type: application/json' \ -d '{ "amount":{ "currency":"EUR", "value":1000 }, "reference":"YOUR_ORDER_NUMBER", "paymentMethod":{ "type":"scheme", "encryptedCardNumber":"adyenjs_0_1_18$MT6ppy0FAMVMLH...", "encryptedExpiryMonth":"adyenjs_0_1_18$MT6ppy0FAMVMLH...", "encryptedExpiryYear":"adyenjs_0_1_18$MT6ppy0FAMVMLH...", "encryptedSecurityCode":"adyenjs_0_1_18$MT6ppy0FAMVMLH...", "holderName":"S. Hopper" }, "threeDS2RequestData" : { "challengeIndicator": "requestNoChallenge" }, "browserInfo":{ "userAgent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/70.0.3538.110 Safari\/537.36", "acceptHeader":"text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8", "language":"nl-NL", "colorDepth":24, "screenHeight":723, "screenWidth":1536, "timeZoneOffset":0, "javaEnabled": true }, "shopperIP": "192.0.2.1", "channel" : "web", "origin" : "https://your-company.example.com/", "returnUrl" : "https://your-company.example.com/checkout/", "merchantAccount":"YOUR_MERCHANT_ACCOUNT" }' ``` #### Java ```java // Adyen Java API Library v27.0.0 import com.adyen.Client; import com.adyen.enums.Environment; import com.adyen.model.checkout.*; import java.time.OffsetDateTime; import java.util.*; import com.adyen.model.RequestOptions; import com.adyen.service.checkout.*; // For the live environment, additionally include your liveEndpointUrlPrefix. Client client = new Client("ADYEN_API_KEY", Environment.TEST); // Create the request object(s) Amount amount = new Amount() .currency("EUR") .value(1000L); ThreeDS2RequestFields threeDS2RequestFields = new ThreeDS2RequestFields() .challengeIndicator(ThreeDS2RequestFields.ChallengeIndicatorEnum.REQUESTNOCHALLENGE); CardDetails cardDetails = new CardDetails() .encryptedCardNumber("adyenjs_0_1_18$MT6ppy0FAMVMLH...") .holderName("S. Hopper") .encryptedSecurityCode("adyenjs_0_1_18$MT6ppy0FAMVMLH...") .encryptedExpiryYear("adyenjs_0_1_18$MT6ppy0FAMVMLH...") .encryptedExpiryMonth("adyenjs_0_1_18$MT6ppy0FAMVMLH...") .type(CardDetails.TypeEnum.SCHEME); BrowserInfo browserInfo = new BrowserInfo() .acceptHeader("text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8") .screenWidth(1536) .javaEnabled(true) .screenHeight(723) .timeZoneOffset(0) .userAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36") .language("nl-NL") .colorDepth(24); PaymentRequest paymentRequest = new PaymentRequest() .reference("YOUR_ORDER_NUMBER") .amount(amount) .threeDS2RequestData(threeDS2RequestFields) .merchantAccount("YOUR_MERCHANT_ACCOUNT") .origin("https://your-company.example.com/") .channel(PaymentRequest.ChannelEnum.WEB) .paymentMethod(new CheckoutPaymentMethod(cardDetails)) .shopperIP("192.0.2.1") .returnUrl("https://your-company.example.com/checkout/") .browserInfo(browserInfo); // Send the request PaymentsApi service = new PaymentsApi(client); PaymentResponse response = service.payments(paymentRequest, new RequestOptions().idempotencyKey("UUID")); ``` #### PHP ```php // Adyen PHP API Library v19.0.0 use Adyen\Client; use Adyen\Environment; use Adyen\Model\Checkout\Amount; use Adyen\Model\Checkout\ThreeDS2RequestFields; use Adyen\Model\Checkout\CheckoutPaymentMethod; use Adyen\Model\Checkout\BrowserInfo; use Adyen\Model\Checkout\PaymentRequest; use Adyen\Service\Checkout\PaymentsApi; $client = new Client(); $client->setXApiKey("ADYEN_API_KEY"); // For the live environment, additionally include your liveEndpointUrlPrefix. $client->setEnvironment(Environment::TEST); // Create the request object(s) $amount = new Amount(); $amount ->setCurrency("EUR") ->setValue(1000); $threeDS2RequestFields = new ThreeDS2RequestFields(); $threeDS2RequestFields ->setChallengeIndicator("requestNoChallenge"); $checkoutPaymentMethod = new CheckoutPaymentMethod(); $checkoutPaymentMethod ->setEncryptedCardNumber("adyenjs_0_1_18\$MT6ppy0FAMVMLH...") ->setHolderName("S. Hopper") ->setEncryptedSecurityCode("adyenjs_0_1_18\$MT6ppy0FAMVMLH...") ->setEncryptedExpiryYear("adyenjs_0_1_18\$MT6ppy0FAMVMLH...") ->setEncryptedExpiryMonth("adyenjs_0_1_18\$MT6ppy0FAMVMLH...") ->setType("scheme"); $browserInfo = new BrowserInfo(); $browserInfo ->setAcceptHeader("text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8") ->setScreenWidth(1536) ->setJavaEnabled(true) ->setScreenHeight(723) ->setTimeZoneOffset(0) ->setUserAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36") ->setLanguage("nl-NL") ->setColorDepth(24); $paymentRequest = new PaymentRequest(); $paymentRequest ->setReference("YOUR_ORDER_NUMBER") ->setAmount($amount) ->setThreeDS2RequestData($threeDS2RequestFields) ->setMerchantAccount("YOUR_MERCHANT_ACCOUNT") ->setOrigin("https://your-company.example.com/") ->setChannel("web") ->setPaymentMethod($checkoutPaymentMethod) ->setShopperIP("192.0.2.1") ->setReturnUrl("https://your-company.example.com/checkout/") ->setBrowserInfo($browserInfo); $requestOptions['idempotencyKey'] = 'UUID'; // Send the request $service = new PaymentsApi($client); $response = $service->payments($paymentRequest, $requestOptions); ``` #### C\# ```cs // Adyen .net API Library v17.0.0 using Adyen; using Environment = Adyen.Model.Environment; using Adyen.Model; using Adyen.Model.Checkout; using Adyen.Service.Checkout; // For the live environment, additionally include your liveEndpointUrlPrefix. var config = new Config() { XApiKey = "ADYEN_API_KEY", Environment = Environment.Test }; var client = new Client(config); // Create the request object(s) Amount amount = new Amount { Currency = "EUR", Value = 1000 }; ThreeDS2RequestFields threeDS2RequestFields = new ThreeDS2RequestFields { ChallengeIndicator = ThreeDS2RequestFields.ChallengeIndicatorEnum.RequestNoChallenge }; CardDetails cardDetails = new CardDetails { EncryptedCardNumber = "adyenjs_0_1_18$MT6ppy0FAMVMLH...", HolderName = "S. Hopper", EncryptedSecurityCode = "adyenjs_0_1_18$MT6ppy0FAMVMLH...", EncryptedExpiryYear = "adyenjs_0_1_18$MT6ppy0FAMVMLH...", EncryptedExpiryMonth = "adyenjs_0_1_18$MT6ppy0FAMVMLH...", Type = CardDetails.TypeEnum.Scheme }; BrowserInfo browserInfo = new BrowserInfo { AcceptHeader = "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", ScreenWidth = 1536, JavaEnabled = true, ScreenHeight = 723, TimeZoneOffset = 0, UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", Language = "nl-NL", ColorDepth = 24 }; PaymentRequest paymentRequest = new PaymentRequest { Reference = "YOUR_ORDER_NUMBER", Amount = amount, ThreeDS2RequestData = threeDS2RequestFields, MerchantAccount = "YOUR_MERCHANT_ACCOUNT", Origin = "https://your-company.example.com/", Channel = PaymentRequest.ChannelEnum.Web, PaymentMethod = new CheckoutPaymentMethod(cardDetails), ShopperIP = "192.0.2.1", ReturnUrl = "https://your-company.example.com/checkout/", BrowserInfo = browserInfo }; // Send the request var service = new PaymentsService(client); var response = service.Payments(paymentRequest, requestOptions: new RequestOptions { IdempotencyKey = "UUID"}); ``` #### NodeJS (JavaScript) ```js // Adyen Node API Library v18.0.0 // Require the parts of the module you want to use const { Client, CheckoutAPI } = require('@adyen/api-library'); // Initialize the client object // For the live environment, additionally include your liveEndpointUrlPrefix. const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"}); // Create the request object(s) const paymentRequest = { amount: { currency: "EUR", value: 1000 }, reference: "YOUR_ORDER_NUMBER", paymentMethod: { type: "scheme", encryptedCardNumber: "adyenjs_0_1_18$MT6ppy0FAMVMLH...", encryptedExpiryMonth: "adyenjs_0_1_18$MT6ppy0FAMVMLH...", encryptedExpiryYear: "adyenjs_0_1_18$MT6ppy0FAMVMLH...", encryptedSecurityCode: "adyenjs_0_1_18$MT6ppy0FAMVMLH...", holderName: "S. Hopper" }, threeDS2RequestData: { challengeIndicator: "requestNoChallenge" }, browserInfo: { userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", acceptHeader: "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", language: "nl-NL", colorDepth: 24, screenHeight: 723, screenWidth: 1536, timeZoneOffset: 0, javaEnabled: true }, shopperIP: "192.0.2.1", channel: "web", origin: "https://your-company.example.com/", returnUrl: "https://your-company.example.com/checkout/", merchantAccount: "YOUR_MERCHANT_ACCOUNT" } // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` #### Go ```go // Adyen Go API Library v10.4.0 import ( "context" "github.com/adyen/adyen-go-api-library/v9/src/common" "github.com/adyen/adyen-go-api-library/v9/src/adyen" "github.com/adyen/adyen-go-api-library/v9/src/checkout" ) // For the live environment, additionally include your liveEndpointUrlPrefix. client := adyen.NewClient(&common.Config{ ApiKey: "ADYEN_API_KEY", Environment: common.TestEnv, }) // Create the request object(s) amount := checkout.Amount{ Currency: "EUR", Value: 1000, } threeDS2RequestFields := checkout.ThreeDS2RequestFields{ ChallengeIndicator: common.PtrString("requestNoChallenge"), } cardDetails := checkout.CardDetails{ EncryptedCardNumber: common.PtrString("adyenjs_0_1_18$MT6ppy0FAMVMLH..."), HolderName: common.PtrString("S. Hopper"), EncryptedSecurityCode: common.PtrString("adyenjs_0_1_18$MT6ppy0FAMVMLH..."), EncryptedExpiryYear: common.PtrString("adyenjs_0_1_18$MT6ppy0FAMVMLH..."), EncryptedExpiryMonth: common.PtrString("adyenjs_0_1_18$MT6ppy0FAMVMLH..."), Type: common.PtrString("scheme"), } browserInfo := checkout.BrowserInfo{ AcceptHeader: "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", ScreenWidth: 1536, JavaEnabled: true, ScreenHeight: 723, TimeZoneOffset: 0, UserAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", Language: "nl-NL", ColorDepth: 24, } paymentRequest := checkout.PaymentRequest{ Reference: "YOUR_ORDER_NUMBER", Amount: amount, ThreeDS2RequestData: &threeDS2RequestFields, MerchantAccount: "YOUR_MERCHANT_ACCOUNT", Origin: common.PtrString("https://your-company.example.com/"), Channel: common.PtrString("web"), PaymentMethod: checkout.CardDetailsAsCheckoutPaymentMethod(&cardDetails), ShopperIP: common.PtrString("192.0.2.1"), ReturnUrl: "https://your-company.example.com/checkout/", BrowserInfo: &browserInfo, } // Send the request service := client.Checkout() req := service.PaymentsApi.PaymentsInput().IdempotencyKey("UUID").PaymentRequest(paymentRequest) res, httpRes, err := service.PaymentsApi.Payments(context.Background(), req) ``` #### Python ```py # Adyen Python API Library v12.5.1 import Adyen adyen = Adyen.Adyen() adyen.client.xapikey = "ADYEN_API_KEY" # For the live environment, additionally include your liveEndpointUrlPrefix. adyen.client.platform = "test" # The environment to use library in. # Create the request object(s) json_request = { "amount": { "currency": "EUR", "value": 1000 }, "reference": "YOUR_ORDER_NUMBER", "paymentMethod": { "type": "scheme", "encryptedCardNumber": "adyenjs_0_1_18$MT6ppy0FAMVMLH...", "encryptedExpiryMonth": "adyenjs_0_1_18$MT6ppy0FAMVMLH...", "encryptedExpiryYear": "adyenjs_0_1_18$MT6ppy0FAMVMLH...", "encryptedSecurityCode": "adyenjs_0_1_18$MT6ppy0FAMVMLH...", "holderName": "S. Hopper" }, "threeDS2RequestData": { "challengeIndicator": "requestNoChallenge" }, "browserInfo": { "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "acceptHeader": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "language": "nl-NL", "colorDepth": 24, "screenHeight": 723, "screenWidth": 1536, "timeZoneOffset": 0, "javaEnabled": True }, "shopperIP": "192.0.2.1", "channel": "web", "origin": "https://your-company.example.com/", "returnUrl": "https://your-company.example.com/checkout/", "merchantAccount": "YOUR_MERCHANT_ACCOUNT" } # Send the request result = adyen.checkout.payments_api.payments(request=json_request, idempotency_key="UUID") ``` #### Ruby ```rb # Adyen Ruby API Library v9.5.1 require "adyen-ruby-api-library" adyen = Adyen::Client.new adyen.api_key = 'ADYEN_API_KEY' # For the live environment, additionally include your liveEndpointUrlPrefix. adyen.env = :test # Set to "live" for live environment # Create the request object(s) request_body = { :amount => { :currency => 'EUR', :value => 1000 }, :reference => 'YOUR_ORDER_NUMBER', :paymentMethod => { :type => 'scheme', :encryptedCardNumber => 'adyenjs_0_1_18$MT6ppy0FAMVMLH...', :encryptedExpiryMonth => 'adyenjs_0_1_18$MT6ppy0FAMVMLH...', :encryptedExpiryYear => 'adyenjs_0_1_18$MT6ppy0FAMVMLH...', :encryptedSecurityCode => 'adyenjs_0_1_18$MT6ppy0FAMVMLH...', :holderName => 'S. Hopper' }, :threeDS2RequestData => { :challengeIndicator => 'requestNoChallenge' }, :browserInfo => { :userAgent => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36', :acceptHeader => 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8', :language => 'nl-NL', :colorDepth => 24, :screenHeight => 723, :screenWidth => 1536, :timeZoneOffset => 0, :javaEnabled => true }, :shopperIP => '192.0.2.1', :channel => 'web', :origin => 'https://your-company.example.com/', :returnUrl => 'https://your-company.example.com/checkout/', :merchantAccount => 'YOUR_MERCHANT_ACCOUNT' } # Send the request result = adyen.checkout.payments_api.payments(request_body, headers: { 'Idempotency-Key' => 'UUID' }) ``` #### NodeJS (TypeScript) ```ts // Adyen Node API Library v18.0.0 // Require the parts of the module you want to use import { Client, CheckoutAPI, Types } from "@adyen/api-library"; // Initialize the client object // For the live environment, additionally include your liveEndpointUrlPrefix. const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"}); // Create the request object(s) const amount: Types.checkout.Amount = { currency: "EUR", value: 1000 }; const threeDS2RequestFields: Types.checkout.ThreeDS2RequestFields = { challengeIndicator: Types.checkout.ThreeDS2RequestFields.ChallengeIndicatorEnum.RequestNoChallenge }; const cardDetails: Types.checkout.CardDetails = { encryptedCardNumber: "adyenjs_0_1_18$MT6ppy0FAMVMLH...", holderName: "S. Hopper", encryptedSecurityCode: "adyenjs_0_1_18$MT6ppy0FAMVMLH...", encryptedExpiryYear: "adyenjs_0_1_18$MT6ppy0FAMVMLH...", encryptedExpiryMonth: "adyenjs_0_1_18$MT6ppy0FAMVMLH...", type: Types.checkout.CardDetails.TypeEnum.Scheme }; const browserInfo: Types.checkout.BrowserInfo = { acceptHeader: "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", screenWidth: 1536, javaEnabled: true, screenHeight: 723, timeZoneOffset: 0, userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", language: "nl-NL", colorDepth: 24 }; const paymentRequest: Types.checkout.PaymentRequest = { reference: "YOUR_ORDER_NUMBER", amount: amount, threeDS2RequestData: threeDS2RequestFields, merchantAccount: "YOUR_MERCHANT_ACCOUNT", origin: "https://your-company.example.com/", channel: Types.checkout.PaymentRequest.ChannelEnum.Web, paymentMethod: cardDetails, shopperIP: "192.0.2.1", returnUrl: "https://your-company.example.com/checkout/", browserInfo: browserInfo }; // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` #### Possible responses The [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) response contains a `transStatus` parameter that tells you if the requested exemption was granted. If you use the [authentication-only flow](/online-payments/3d-secure/standalone-authentication), your integration must be able to handle all the following responses. When the issuer declines the exemption without failing the transaction, you get a response indicating that an authentication is required for the transaction and the shopper must challenged. The response differs depending on scheme (Visa or Mastercard) and 3D Secure 2 version (2.2 or 2.1): ** #### 3D Secure 2.2 | Scheme | Granted | Not granted | | ---------- | -------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | | Visa | - `transStatus`: **I** - `ECI`: **07** | Either: - [Challenge](/online-payments/3d-secure#challenge-flow) with `transStatus`: **C**. - Failure with `transStatus`: **N**, **R**, **U**, or **A**. | | Mastercard | - `transStatus`: **I** - `ECI`: **07** | Either: - [Challenge](/online-payments/3d-secure#challenge-flow) with `transStatus`: **C**. - Failure with `transStatus`: **N**, **R**, **U**, or **A**. | ** #### 3D Secure 2.1 | Scheme | Granted | Not granted | | ---------- | ------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------- | | Visa | Exemptions not supported. | Exemptions not supported. | | Mastercard | - `directoryResponse`: **N** - `ECI`: **07** or **06** - `transStatusReason`: **81** | Either: - [Challenge](/online-payments/3d-secure#challenge-flow) with `transStatus`: **C**. - Failure with `transStatus`: **N**, **R**, **U**, or **A**. | #### Step 2: Apply the exemption in the authorization To apply an exemption in the [authorization-only flow](/online-payments/3d-secure/other-3ds-flows/authorize-mpidata), use the [response values from the authentication flow](#possible-responses): * [scaExemption](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-additionalData-listOfValues-scaExemption): Indicates the exemption type that you want to request for the transaction. If you include a value, it overrides Adyen's exemption logic. Possible values: * **lowValue** * **secureCorporate** * **trustedBeneficiary** * **transactionRiskAnalysis**: By default, Adyen will determine whether it is possible to apply a TRA exemption on a transaction as per the [default compliance option](?tab=default_compliance_0_1#compliance-options). You have the option to change this default setting in the Customer Area. Doing this will override Adyen's choice to apply TRA for a transaction or not.\ Navigate to **Revenue & risk** > **Risk Settings** > **General** > **Perform TRA**. Choose **Enable 3rd party/proprietary risk solution TRA** to apply the TRA exemption yourself per transaction, or choose **Disable** to never apply a TRA exemption. * [directoryResponse](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-mpiData-directoryResponse): The `transStatus` from the Authentication-only flow response. * [eci](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-mpiData-eci): The `ECI` from the Authentication-only flow response. **\/payments\ request to apply the exemption** ```bash curl https://checkout-test.adyen.com/v72/payments \ -H 'x-api-key: ADYEN_API_KEY' \ -H 'content-type: application/json' \ -d '{ "amount": { "currency": "EUR", "value": 1000 }, "merchantAccount": "YOUR_MERCHANT_ACCOUNT", "reference": "YOUR_ORDER_NUMBER", "channel": "Web", "mpiData": { "directoryResponse": "I", "eci": "07", "dsTransID": "c4e59ceb-a382-4d6a-bc87-385d591fa09d", "threeDSVersion": "2.2.0" }, "additionalData": { "scaExemption": "lowValue" }, "paymentMethod": { "type": "visa", "number": "4917610000000000", "expiryMonth": "03", "expiryYear": "2030", "holderName": "John Smith", "cvc": "737" } }' ``` ## See also * [SCA exemptions](/online-payments/psd2-sca-compliance-and-implementation-guide/sca-exemptions) * [3D Secure implementation options](/online-payments/3d-secure/#implement-3d-secure-2) * [3D Secure 2 native integration](/online-payments/3d-secure/native-3ds2) * [Dynamic 3D Secure](/risk-management/dynamic-3d-secure) * [Support guide for PSD2 SCA compliance](https://help.adyen.com/knowledge/compliance/psd2-compliance/what-do-i-need-to-know-about-psd2-compliance)