--- title: "Upgrade to Checkout API v70" description: "Find out more about the major changes in this release." url: "https://docs.adyen.com/online-payments/upgrade-your-integration/upgrade-to-checkout-api-v70" source_url: "https://docs.adyen.com/online-payments/upgrade-your-integration/upgrade-to-checkout-api-v70.md" canonical: "https://docs.adyen.com/online-payments/upgrade-your-integration/upgrade-to-checkout-api-v70" last_modified: "2023-02-06T12:22:00+01:00" language: "en" --- # Upgrade to Checkout API v70 Find out more about the major changes in this release. [View source](/online-payments/upgrade-your-integration/upgrade-to-checkout-api-v70.md) Checkout API v70 changes how you use [tokenization](/online-payments/tokenization) and [items for in a payment request for risk management](#include-line-items-for-risk-rules). This page describes how you upgrade your integration to use Checkout API v70. Previously, you could set whether to store your shopper's payment details for recurring payments in the Customer Area, under **Settings** > **Checkout settings** > **enableRecurring**. As of Checkout API v70, you can no longer do this. This means that from Checkout v70 onward, you manage all tokenization settings exclusively through the Checkout API. ## Create a token ### Tab: Drop-in or Components Your upgrade steps depend on whether you use a [Sessions flow](#sessions-flow-create-token) or [Advanced flow](#advanced-flow-create-token). To learn about the difference, see [Additional use cases](/online-payments/build-your-integration). ### Sessions flow Before v70, in [/sessions](https://docs.adyen.com/api-explorer/Checkout/latest/post/sessions) requests: * You must set [storePaymentMethod](https://docs.adyen.com/api-explorer/Checkout/69/post/sessions#request-storePaymentMethod). * You optionally set [recurringProcessingModel](https://docs.adyen.com/api-explorer/Checkout/69/post/sessions#request-recurringProcessingModel). From v70 onwards, in [/sessions](https://docs.adyen.com/api-explorer/Checkout/latest/post/sessions) requests: * You must set `storePaymentMethodMode` with one of the [possible values](#upgrading-to-v70). * You must set [recurringProcessingModel](https://docs.adyen.com/api-explorer/Checkout/latest/post/sessions#request-recurringProcessingModel). This parameter is now required. #### Upgrading to v70 To upgrade, you need to update your front-end library to: * Web [Drop-in](/online-payments/build-your-integration/sessions-flow/?platform=Web\&integration=Drop-in) and [Components](/online-payments/build-your-integration/sessions-flow?platform=Web\&integration=Components) (v5.27.0 or newer) * iOS [Drop-in](/online-payments/build-your-integration/sessions-flow?platform=iOS\&integration=Drop-in) and [Components](/online-payments/build-your-integration/sessions-flow?platform=iOS\&integration=Components) (v5.0.0 or newer) You need to update your frontend library to display the checkbox in your checkout for your customer to give consent to store their payment details. In the [/sessions](https://docs.adyen.com/api-explorer/Checkout/latest/post/sessions) request, `storePaymentMethodMode` has the following options: | Value | Description | | ----------------- | ------------------------------------------------------------------------------------- | | **disabled** | Your shopper's payment details are *not* stored. | | **askForConsent** | The UI lets your shopper select whether they want their payment details to be stored. | | **enabled** | Your shopper's payment details are stored. | To store the payment details for a payment using the [/sessions](https://docs.adyen.com/api-explorer/Checkout/latest/post/sessions) endpoint: 1. Set `storePaymentMethodMode` to **askForConsent** or **enabled**. 2. Set a [shopperReference](https://docs.adyen.com/api-explorer/Checkout/latest/post/sessions#request-fundRecipient-shopperReference). 3. Set a [recurringProcessingModel](https://docs.adyen.com/api-explorer/Checkout/latest/post/sessions#request-recurringProcessingModel). Previously, this was optional. ### Advanced flow [`recurringProcessingModel` ](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-recurringProcessingModel)is now *required* when storing a shopper's payment details. To store the payment details for a [`/payments` ](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments)request: 1. Set [`storePaymentMethod` ](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-storePaymentMethod)to **true**. 2. Set a [`recurringProcessingModel` ](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-recurringProcessingModel). 3. Set a [`shopperReference` ](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-shopperReference). Optionally, to add a checkbox to the UI that lets your shopper select whether they want their payment details to be stored, in your [Drop-in configuration](/payment-methods/cards/web-drop-in#optional-configuration) or [Component configuration](/payment-methods/cards/web-component#optional-configuration), set `enableStoreDetails` to **true**. ### Tab: API-only [recurringProcessingModel](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-recurringProcessingModel) is now *required* when storing a shopper's payment details. To store the payment details for a [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request: 1. Set [storePaymentMethod](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-storePaymentMethod) to **true**. 2. Set a [recurringProcessingModel](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-recurringProcessingModel). 3. Set a [shopperReference](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-shopperReference). ### Tab: Pay by Link ### Pay by Link through API [recurringProcessingModel](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentLinks#request-recurringProcessingModel) is now *required* when storing a shopper's payment details. To store the payment details for a [/paymentLinks](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentLinks) request: 1. Set [storePaymentMethodMode](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentLinks#request-storePaymentMethodMode) to **askForConsent** or **enabled**. 2. Set a [recurringProcessingModel](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentLinks#request-recurringProcessingModel). 3. Set a [shopperReference](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentLinks#request-shopperReference). ### Pay by Link through Customer Area To store the payment details for payment links created through the Customer Area: 1. Log in to your [Customer Area](https://ca-test.adyen.com/). 2. Go to **Pay by Link** > **Settings**. 3. Under **Tokenization**, turn on **Recurring through Customer Area**. ## Use the token ### Tab: Drop-in or Components To learn about the difference between Sessions flow and Advanced flow, see [Additional use cases](/online-payments/build-your-integration). ### Sessions flow You do not need to make any changes to your integration. ### Advanced flow [`recurringProcessingModel` ](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-recurringProcessingModel)is now *required* when you use a token to complete a recurring payment. Previously, this was optional. ### Tab: API-only [`recurringProcessingModel` ](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-recurringProcessingModel)is now *required* when you use a token to complete a recurring payment. Previously, this was optional. ### Tab: Pay by Link You do not need to make any changes to your integration. ## Include line items for risk rules In Checkout API v70, you can [configure custom risk rules](/risk-management/configure-manual-risk/configure-custom-risk-rules) for items using the [lineItems](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-lineItems) fields instead of [additionalData.riskdata.basket](https://docs.adyen.com/api-explorer/Checkout/69/post/payments#request-additionalData-AdditionalDataRisk). | v70 or later | v69 or earlier | | -------------------- | -------------------- | | `description` | `item.productTitle` | | `amountIncludingTax` | `item.amountPerItem` | | `itemCategory` | `item.category` | | `quantity` | `item.quantity` | | `id` | `item.id` | | `color` | `item.color` | | `brand` | `item.brand` | | `manufacturer` | `item.manufacturer` | | `receiverEmail` | `item.receiverEmail` | | `size` | `item.size` | | `sku` | `item.sku` | | `upc` | `item.upc` | For example, to include two items with product title, category, and brand in your payment request: ### Tab: v70 **Payment request with line items** #### curl ```bash curl https://checkout-test.adyen.com/v70/payments \ -H 'x-api-key: ADYEN_API_KEY' \ -H 'content-type: application/json' \ -d '{ "merchantAccount": "YOUR_MERCHANT_ACCOUNT", "reference": "YOUR_PAYMENT_REFERENCE", "amount": { "value": 1000, "currency": "EUR" }, "paymentMethod": { "type": "scheme", "encryptedCardNumber": "test_4111111111111111", "encryptedExpiryMonth": "test_03", "encryptedExpiryYear": "test_2030", "encryptedSecurityCode": "test_737" }, "lineItems":[ { "description": "Gold shoes", "category": "Footwear", "brand": "Adyen" }, { "description": "Gold hat", "category": "Accessories", "brand": "Adyen" } ] }' ``` #### Java ```java // Adyen Java API Library v26.3.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) LineItem lineItem1 = new LineItem() .description("Gold shoes") .brand("Adyen"); LineItem lineItem2 = new LineItem() .description("Gold hat") .brand("Adyen"); Amount amount = new Amount() .currency("EUR") .value(1000L); CardDetails cardDetails = new CardDetails() .encryptedCardNumber("test_4111111111111111") .encryptedSecurityCode("test_737") .encryptedExpiryYear("test_2030") .encryptedExpiryMonth("test_03") .type(CardDetails.TypeEnum.SCHEME); PaymentRequest paymentRequest = new PaymentRequest() .reference("YOUR_PAYMENT_REFERENCE") .lineItems(Arrays.asList(lineItem1, lineItem2)) .amount(amount) .merchantAccount("YOUR_MERCHANT_ACCOUNT") .paymentMethod(new CheckoutPaymentMethod(cardDetails)); // Send the request PaymentsApi service = new PaymentsApi(client); PaymentResponse response = service.payments(paymentRequest, new RequestOptions().idempotencyKey("UUID")); ``` #### PHP ```php // Adyen PHP API Library v18.2.1 use Adyen\Client; use Adyen\Environment; use Adyen\Model\Checkout\LineItem; use Adyen\Model\Checkout\Amount; use Adyen\Model\Checkout\CheckoutPaymentMethod; 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) $lineItem1 = new LineItem(); $lineItem1 ->setDescription("Gold shoes") ->setBrand("Adyen"); $lineItem2 = new LineItem(); $lineItem2 ->setDescription("Gold hat") ->setBrand("Adyen"); $amount = new Amount(); $amount ->setCurrency("EUR") ->setValue(1000); $checkoutPaymentMethod = new CheckoutPaymentMethod(); $checkoutPaymentMethod ->setEncryptedCardNumber("test_4111111111111111") ->setEncryptedSecurityCode("test_737") ->setEncryptedExpiryYear("test_2030") ->setEncryptedExpiryMonth("test_03") ->setType("scheme"); $paymentRequest = new PaymentRequest(); $paymentRequest ->setReference("YOUR_PAYMENT_REFERENCE") ->setLineItems(array($lineItem1, $lineItem2)) ->setAmount($amount) ->setMerchantAccount("YOUR_MERCHANT_ACCOUNT") ->setPaymentMethod($checkoutPaymentMethod); $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) LineItem lineItem1 = new LineItem { Description = "Gold shoes", Brand = "Adyen" }; LineItem lineItem2 = new LineItem { Description = "Gold hat", Brand = "Adyen" }; Amount amount = new Amount { Currency = "EUR", Value = 1000 }; CardDetails cardDetails = new CardDetails { EncryptedCardNumber = "test_4111111111111111", EncryptedSecurityCode = "test_737", EncryptedExpiryYear = "test_2030", EncryptedExpiryMonth = "test_03", Type = CardDetails.TypeEnum.Scheme }; PaymentRequest paymentRequest = new PaymentRequest { Reference = "YOUR_PAYMENT_REFERENCE", LineItems = new List{ lineItem1, lineItem2 }, Amount = amount, MerchantAccount = "YOUR_MERCHANT_ACCOUNT", PaymentMethod = new CheckoutPaymentMethod(cardDetails) }; // 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 v17.3.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 = { merchantAccount: "YOUR_MERCHANT_ACCOUNT", reference: "YOUR_PAYMENT_REFERENCE", amount: { value: 1000, currency: "EUR" }, paymentMethod: { type: "scheme", encryptedCardNumber: "test_4111111111111111", encryptedExpiryMonth: "test_03", encryptedExpiryYear: "test_2030", encryptedSecurityCode: "test_737" }, lineItems: [ { description: "Gold shoes", category: "Footwear", brand: "Adyen" }, { description: "Gold hat", category: "Accessories", brand: "Adyen" } ] } // 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) lineItem1 := checkout.LineItem{ Description: common.PtrString("Gold shoes"), Brand: common.PtrString("Adyen"), } lineItem2 := checkout.LineItem{ Description: common.PtrString("Gold hat"), Brand: common.PtrString("Adyen"), } amount := checkout.Amount{ Currency: "EUR", Value: 1000, } cardDetails := checkout.CardDetails{ EncryptedCardNumber: common.PtrString("test_4111111111111111"), EncryptedSecurityCode: common.PtrString("test_737"), EncryptedExpiryYear: common.PtrString("test_2030"), EncryptedExpiryMonth: common.PtrString("test_03"), Type: common.PtrString("scheme"), } paymentRequest := checkout.PaymentRequest{ Reference: "YOUR_PAYMENT_REFERENCE", LineItems: []checkout.LineItem{ lineItem1, lineItem2, }, Amount: amount, MerchantAccount: "YOUR_MERCHANT_ACCOUNT", PaymentMethod: checkout.CardDetailsAsCheckoutPaymentMethod(&cardDetails), } // 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 = { "merchantAccount": "YOUR_MERCHANT_ACCOUNT", "reference": "YOUR_PAYMENT_REFERENCE", "amount": { "value": 1000, "currency": "EUR" }, "paymentMethod": { "type": "scheme", "encryptedCardNumber": "test_4111111111111111", "encryptedExpiryMonth": "test_03", "encryptedExpiryYear": "test_2030", "encryptedSecurityCode": "test_737" }, "lineItems": [ { "description": "Gold shoes", "category": "Footwear", "brand": "Adyen" }, { "description": "Gold hat", "category": "Accessories", "brand": "Adyen" } ] } # 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 = { :merchantAccount => 'YOUR_MERCHANT_ACCOUNT', :reference => 'YOUR_PAYMENT_REFERENCE', :amount => { :value => 1000, :currency => 'EUR' }, :paymentMethod => { :type => 'scheme', :encryptedCardNumber => 'test_4111111111111111', :encryptedExpiryMonth => 'test_03', :encryptedExpiryYear => 'test_2030', :encryptedSecurityCode => 'test_737' }, :lineItems => [ { :description => 'Gold shoes', :category => 'Footwear', :brand => 'Adyen' }, { :description => 'Gold hat', :category => 'Accessories', :brand => 'Adyen' } ] } # Send the request result = adyen.checkout.payments_api.payments(request_body, headers: { 'Idempotency-Key' => 'UUID' }) ``` #### NodeJS (TypeScript) ```ts // Adyen Node API Library v17.3.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 lineItem1: Types.checkout.LineItem = { description: "Gold shoes", brand: "Adyen" }; const lineItem2: Types.checkout.LineItem = { description: "Gold hat", brand: "Adyen" }; const amount: Types.checkout.Amount = { currency: "EUR", value: 1000 }; const cardDetails: Types.checkout.CardDetails = { encryptedCardNumber: "test_4111111111111111", encryptedSecurityCode: "test_737", encryptedExpiryYear: "test_2030", encryptedExpiryMonth: "test_03", type: Types.checkout.CardDetails.TypeEnum.Scheme }; const paymentRequest: Types.checkout.PaymentRequest = { reference: "YOUR_PAYMENT_REFERENCE", lineItems: [lineItem1, lineItem2], amount: amount, merchantAccount: "YOUR_MERCHANT_ACCOUNT", paymentMethod: cardDetails }; // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` ### Tab: v69 **Payment request with additional data for risk** #### curl ```bash curl https://checkout-test.adyen.com/v70/payments \ -H 'x-api-key: ADYEN_API_KEY' \ -H 'content-type: application/json' \ -d '{ "merchantAccount": "YOUR_MERCHANT_ACCOUNT", "reference": "YOUR_PAYMENT_REFERENCE", "amount": { "value": 1000, "currency": "EUR" }, "paymentMethod": { "type": "scheme", "encryptedCardNumber": "test_4111111111111111", "encryptedExpiryMonth": "test_03", "encryptedExpiryYear": "test_2030", "encryptedSecurityCode": "test_737" }, "additionalData":{ "riskdata.basket.item1.productTitle": "Gold shoes", "riskdata.basket.item1.category": "Footwear", "riskdata.basket.item1.brand": "Adyen", "riskdata.basket.item2.productTitle": "Gold hat", "riskdata.basket.item2.category": "Accessories", "riskdata.basket.item2.brand": "Adyen" } }' ``` #### Java ```java // Adyen Java API Library v26.3.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); CardDetails cardDetails = new CardDetails() .encryptedCardNumber("test_4111111111111111") .encryptedSecurityCode("test_737") .encryptedExpiryYear("test_2030") .encryptedExpiryMonth("test_03") .type(CardDetails.TypeEnum.SCHEME); PaymentRequest paymentRequest = new PaymentRequest() .reference("YOUR_PAYMENT_REFERENCE") .amount(amount) .merchantAccount("YOUR_MERCHANT_ACCOUNT") .paymentMethod(new CheckoutPaymentMethod(cardDetails)) .additionalData(new HashMap(Map.of( "riskdata.basket.item1.category", "Footwear", "riskdata.basket.item1.productTitle", "Gold shoes", "riskdata.basket.item2.brand", "Adyen", "riskdata.basket.item1.brand", "Adyen", "riskdata.basket.item2.productTitle", "Gold hat", "riskdata.basket.item2.category", "Accessories" ))); // Send the request PaymentsApi service = new PaymentsApi(client); PaymentResponse response = service.payments(paymentRequest, new RequestOptions().idempotencyKey("UUID")); ``` #### PHP ```php // Adyen PHP API Library v18.2.1 use Adyen\Client; use Adyen\Environment; use Adyen\Model\Checkout\Amount; use Adyen\Model\Checkout\CheckoutPaymentMethod; 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); $checkoutPaymentMethod = new CheckoutPaymentMethod(); $checkoutPaymentMethod ->setEncryptedCardNumber("test_4111111111111111") ->setEncryptedSecurityCode("test_737") ->setEncryptedExpiryYear("test_2030") ->setEncryptedExpiryMonth("test_03") ->setType("scheme"); $paymentRequest = new PaymentRequest(); $paymentRequest ->setReference("YOUR_PAYMENT_REFERENCE") ->setAmount($amount) ->setMerchantAccount("YOUR_MERCHANT_ACCOUNT") ->setPaymentMethod($checkoutPaymentMethod) ->setAdditionalData( array( "riskdata.basket.item1.category" => "Footwear", "riskdata.basket.item1.productTitle" => "Gold shoes", "riskdata.basket.item2.brand" => "Adyen", "riskdata.basket.item1.brand" => "Adyen", "riskdata.basket.item2.productTitle" => "Gold hat", "riskdata.basket.item2.category" => "Accessories" ) ); $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 }; CardDetails cardDetails = new CardDetails { EncryptedCardNumber = "test_4111111111111111", EncryptedSecurityCode = "test_737", EncryptedExpiryYear = "test_2030", EncryptedExpiryMonth = "test_03", Type = CardDetails.TypeEnum.Scheme }; PaymentRequest paymentRequest = new PaymentRequest { Reference = "YOUR_PAYMENT_REFERENCE", Amount = amount, MerchantAccount = "YOUR_MERCHANT_ACCOUNT", PaymentMethod = new CheckoutPaymentMethod(cardDetails), AdditionalData = new Dictionary { { "riskdata.basket.item1.category", "Footwear" }, { "riskdata.basket.item1.productTitle", "Gold shoes" }, { "riskdata.basket.item2.brand", "Adyen" }, { "riskdata.basket.item1.brand", "Adyen" }, { "riskdata.basket.item2.productTitle", "Gold hat" }, { "riskdata.basket.item2.category", "Accessories" } } }; // 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 v17.3.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 = { merchantAccount: "YOUR_MERCHANT_ACCOUNT", reference: "YOUR_PAYMENT_REFERENCE", amount: { value: 1000, currency: "EUR" }, paymentMethod: { type: "scheme", encryptedCardNumber: "test_4111111111111111", encryptedExpiryMonth: "test_03", encryptedExpiryYear: "test_2030", encryptedSecurityCode: "test_737" }, additionalData: { "riskdata.basket.item1.productTitle" : "Gold shoes", "riskdata.basket.item1.category" : "Footwear", "riskdata.basket.item1.brand" : "Adyen", "riskdata.basket.item2.productTitle" : "Gold hat", "riskdata.basket.item2.category" : "Accessories", "riskdata.basket.item2.brand" : "Adyen" } } // 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, } cardDetails := checkout.CardDetails{ EncryptedCardNumber: common.PtrString("test_4111111111111111"), EncryptedSecurityCode: common.PtrString("test_737"), EncryptedExpiryYear: common.PtrString("test_2030"), EncryptedExpiryMonth: common.PtrString("test_03"), Type: common.PtrString("scheme"), } paymentRequest := checkout.PaymentRequest{ Reference: "YOUR_PAYMENT_REFERENCE", Amount: amount, MerchantAccount: "YOUR_MERCHANT_ACCOUNT", PaymentMethod: checkout.CardDetailsAsCheckoutPaymentMethod(&cardDetails), AdditionalData: &map[string]string{ "riskdata.basket.item1.category": "Footwear", "riskdata.basket.item1.productTitle": "Gold shoes", "riskdata.basket.item2.brand": "Adyen", "riskdata.basket.item1.brand": "Adyen", "riskdata.basket.item2.productTitle": "Gold hat", "riskdata.basket.item2.category": "Accessories", }, } // 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 = { "merchantAccount": "YOUR_MERCHANT_ACCOUNT", "reference": "YOUR_PAYMENT_REFERENCE", "amount": { "value": 1000, "currency": "EUR" }, "paymentMethod": { "type": "scheme", "encryptedCardNumber": "test_4111111111111111", "encryptedExpiryMonth": "test_03", "encryptedExpiryYear": "test_2030", "encryptedSecurityCode": "test_737" }, "additionalData": { "riskdata.basket.item1.productTitle" : "Gold shoes", "riskdata.basket.item1.category" : "Footwear", "riskdata.basket.item1.brand" : "Adyen", "riskdata.basket.item2.productTitle" : "Gold hat", "riskdata.basket.item2.category" : "Accessories", "riskdata.basket.item2.brand" : "Adyen" } } # 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 = { :merchantAccount => 'YOUR_MERCHANT_ACCOUNT', :reference => 'YOUR_PAYMENT_REFERENCE', :amount => { :value => 1000, :currency => 'EUR' }, :paymentMethod => { :type => 'scheme', :encryptedCardNumber => 'test_4111111111111111', :encryptedExpiryMonth => 'test_03', :encryptedExpiryYear => 'test_2030', :encryptedSecurityCode => 'test_737' }, :additionalData => { :riskdata.basket.item1.productTitle => 'Gold shoes', :riskdata.basket.item1.category => 'Footwear', :riskdata.basket.item1.brand => 'Adyen', :riskdata.basket.item2.productTitle => 'Gold hat', :riskdata.basket.item2.category => 'Accessories', :riskdata.basket.item2.brand => 'Adyen' } } # Send the request result = adyen.checkout.payments_api.payments(request_body, headers: { 'Idempotency-Key' => 'UUID' }) ``` #### NodeJS (TypeScript) ```ts // Adyen Node API Library v17.3.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 cardDetails: Types.checkout.CardDetails = { encryptedCardNumber: "test_4111111111111111", encryptedSecurityCode: "test_737", encryptedExpiryYear: "test_2030", encryptedExpiryMonth: "test_03", type: Types.checkout.CardDetails.TypeEnum.Scheme }; const paymentRequest: Types.checkout.PaymentRequest = { reference: "YOUR_PAYMENT_REFERENCE", amount: amount, merchantAccount: "YOUR_MERCHANT_ACCOUNT", paymentMethod: cardDetails, additionalData: { "riskdata.basket.item1.category": "Footwear", "riskdata.basket.item1.productTitle": "Gold shoes", "riskdata.basket.item2.brand": "Adyen", "riskdata.basket.item1.brand": "Adyen", "riskdata.basket.item2.productTitle": "Gold hat", "riskdata.basket.item2.category": "Accessories" } }; // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ```