--- title: "API only with raw card data" description: "Accept card payments submitting raw card data." url: "https://docs.adyen.com/payment-methods/cards/raw-card-data" source_url: "https://docs.adyen.com/payment-methods/cards/raw-card-data.md" canonical: "https://docs.adyen.com/payment-methods/cards/raw-card-data" last_modified: "2022-08-09T11:45:00+02:00" language: "en" --- # API only with raw card data Accept card payments submitting raw card data. [View source](/payment-methods/cards/raw-card-data.md) Use our APIs to accept card payments with raw card data, and build your own UI to have full control over the look and feel of your checkout page. To collect raw card data, you need to be [fully PCI compliant](/development-resources/pci-dss-compliance-guide). If you are not fully PCI compliant, use one of our [pre-built UI solutions](/payment-methods/cards#how-do-you-want-to-integrate) or build a custom [card integration with encryption](/payment-methods/cards/custom-card-integration) instead. ## Requirements | Requirement | Description | | -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | | **Integration type** | Make sure that you have built an [API-only integration](/online-payments/build-your-integration/advanced-flow?platform=Web\&integration=API%20only). | | **Setup steps** | Before you begin, [add the cards that you want to support in your test Customer Area](/payment-methods/add-payment-methods). | ## Build your payment form for cards When making a card payment, collect the following shopper details: | Card details | Example input | Required | | ------------------------------ | ------------------ | ------------------------------------------------------------------------------------------- | | Card number | "4111111111111111" | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | | Card expiry month | "03" | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | | Card expiry year | "30" | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | | Card security code (CVV / CVC) | "737" | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | | Cardholder name | "S. Hopper" | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | ### Showing co-badged cards For cards issued in some countries/regions, you must [comply with regulations for co-badged cards](/online-payments/co-badged-cards-compliance/). Use the [/cardDetails](https://docs.adyen.com/api-explorer/Checkout/latest/post/cardDetails) endpoint to identify the brands on the shopper's card. To identify the brands, start making [/cardDetails](https://docs.adyen.com/api-explorer/Checkout/latest/post/cardDetails) requests while the shopper is entering the card number. You need a minimum of the first 8 digits, but the full card number gives the best result. If the [/cardDetails](https://docs.adyen.com/api-explorer/Checkout/latest/post/cardDetails) endpoint identifies two brands and you support both, you must let the shopper choose which brand to pay with. If you only support one brand, let the shopper pay with it. 1. Make a **POST** [/cardDetails](https://docs.adyen.com/api-explorer/Checkout/latest/post/cardDetails) request including the following: | Parameter | Description | Required | | ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | | `merchantAccount` | Your merchant account. | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | | `cardNumber` | A minimum of the first 8 digits of the card number and a maximum of the full card number. | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | | `countryCode` | The shopper's country. The country code of the terminal's location. Format: the two-letter [ISO-3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code. Exception: **QZ** (Kosovo). | | | `supportedBrands` | The array of the card brands that you support. This is the [brands](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentMethods#responses-200-paymentMethods-brands) array from your [/paymentMethods](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/paymentMethods) response. If not provided, we assume that you support all card brands. | | **/cardDetails request** #### curl ```bash curl https://checkout-test.adyen.com/v72/cardDetails \ -H 'x-api-key: ADYEN_API_KEY' \ -H 'content-type: application/json' \ -d '{ "merchantAccount": "ADYEN_MERCHANT_ACCOUNT", "cardNumber": "40355014", "supportedBrands": ["visa", "mc", "amex"] }' ``` #### 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) CardDetailsRequest cardDetailsRequest = new CardDetailsRequest() .merchantAccount("ADYEN_MERCHANT_ACCOUNT") .supportedBrands(Arrays.asList("visa", "mc", "amex")) .cardNumber("40355014"); // Send the request PaymentsApi service = new PaymentsApi(client); CardDetailsResponse response = service.cardDetails(cardDetailsRequest, new RequestOptions().idempotencyKey("UUID")); ``` #### PHP ```php // Adyen PHP API Library v19.0.0 use Adyen\Client; use Adyen\Environment; use Adyen\Model\Checkout\CardDetailsRequest; 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) $cardDetailsRequest = new CardDetailsRequest(); $cardDetailsRequest ->setMerchantAccount("ADYEN_MERCHANT_ACCOUNT") ->setSupportedBrands(array("visa", "mc", "amex")) ->setCardNumber("40355014"); $requestOptions['idempotencyKey'] = 'UUID'; // Send the request $service = new PaymentsApi($client); $response = $service->cardDetails($cardDetailsRequest, $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) CardDetailsRequest cardDetailsRequest = new CardDetailsRequest { MerchantAccount = "ADYEN_MERCHANT_ACCOUNT", SupportedBrands = { "visa", "mc", "amex" }, CardNumber = "40355014" }; // Send the request var service = new PaymentsService(client); var response = service.CardDetails(cardDetailsRequest, 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 cardDetailsRequest = { merchantAccount: "ADYEN_MERCHANT_ACCOUNT", cardNumber: "40355014", supportedBrands: [ "visa", "mc", "amex" ] } // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.cardDetails(cardDetailsRequest, { 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) cardDetailsRequest := checkout.CardDetailsRequest{ MerchantAccount: "ADYEN_MERCHANT_ACCOUNT", SupportedBrands: []string{ "visa", "mc", "amex", }, CardNumber: "40355014", } // Send the request service := client.Checkout() req := service.PaymentsApi.CardDetailsInput().IdempotencyKey("UUID").CardDetailsRequest(cardDetailsRequest) res, httpRes, err := service.PaymentsApi.CardDetails(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": "ADYEN_MERCHANT_ACCOUNT", "cardNumber": "40355014", "supportedBrands": [ "visa", "mc", "amex" ] } # Send the request result = adyen.checkout.payments_api.card_details(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 => 'ADYEN_MERCHANT_ACCOUNT', :cardNumber => '40355014', :supportedBrands => [ 'visa', 'mc', 'amex' ] } # Send the request result = adyen.checkout.payments_api.card_details(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 cardDetailsRequest: Types.checkout.CardDetailsRequest = { merchantAccount: "ADYEN_MERCHANT_ACCOUNT", supportedBrands: ["visa", "mc", "amex"], cardNumber: "40355014" }; // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.cardDetails(cardDetailsRequest, { idempotencyKey: "UUID" }); ``` 2. The response has a `brands` array containing the brands on the card. If you included `supportedBrands` in the request, the response shows the ones you support. The following example shows a response where: * The brands on the card are **visa** and **cartebancaire**. * The merchant account only supports **visa**. **response to a request with supportedBrands** ```json { "brands": [ { "type": "visa", "supported" : "true" }, { "type": "cartebancaire", "supported" : "false" } ], "fundingSource": "CREDIT", "isCardCommercial": false, "issuingCountryCode": "FR" } ``` 3. If you support both brands, you must let the shopper choose their preferred brand. Render [brand logos](/online-payments/build-your-integration/advanced-flow/?platform=Web\&integration=API%20only#downloading-logos) and names in the payment form for the shopper to choose one and include the brand when [making a payment](#make-a-payment). ## Make a payment From your server, make a [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request, specifying: | Field | Description | Required | | ---------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | | `paymentMethod.type` | **scheme** | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | | `paymentMethod.number` | The card number (without separators). | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | | `paymentMethod.expiryMonth` | The card expiry month. | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | | `paymentMethod.expiryYear` | The card expiry year. | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | | `paymentMethod.cvc` | The card verification code. | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | | `paymentMethod.holderName` | The name of the cardholder. | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | | `paymentMethod.brand` | If the card is [co-badged](#co-badged), this is the brand that the shopper choose to pay with. This is the `brands.type` from the [/cardDetails](https://docs.adyen.com/api-explorer/Checkout/latest/post/cardDetails) response that matches the shopper's preferred brand. | | | `paymentMethod.threeDS2SdkVersion` | The version of the 3D Secure 2 mobile SDK. Required for mobile integrations to trigger in-app Native 3D Secure 2 ([iOS](/online-payments/3d-secure/native-3ds2/ios) or [Android](/online-payments/3d-secure/native-3ds2/android). | | #### 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": "USD", "value": 1000 }, "reference": "YOUR_ORDER_NUMBER", "paymentMethod": { "type": "scheme", "number": "4111111111111111", "expiryMonth": "03", "expiryYear": "2030", "cvc": "737", "holderName": "S. Hopper" }, "returnUrl": "https://your-company.example.com/...", "merchantAccount": "ADYEN_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("USD") .value(1000L); CardDetails cardDetails = new CardDetails() .number("4111111111111111") .cvc("737") .holderName("S. Hopper") .expiryMonth("10") .expiryYear("2020") .type(CardDetails.TypeEnum.SCHEME); PaymentRequest paymentRequest = new PaymentRequest() .reference("YOUR_ORDER_NUMBER") .amount(amount) .merchantAccount("ADYEN_MERCHANT_ACCOUNT") .paymentMethod(new CheckoutPaymentMethod(cardDetails)) .returnUrl("https://your-company.example.com/..."); // 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\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("USD") ->setValue(1000); $checkoutPaymentMethod = new CheckoutPaymentMethod(); $checkoutPaymentMethod ->setNumber("4111111111111111") ->setCvc("737") ->setHolderName("S. Hopper") ->setExpiryMonth("10") ->setExpiryYear("2020") ->setType("scheme"); $paymentRequest = new PaymentRequest(); $paymentRequest ->setReference("YOUR_ORDER_NUMBER") ->setAmount($amount) ->setMerchantAccount("ADYEN_MERCHANT_ACCOUNT") ->setPaymentMethod($checkoutPaymentMethod) ->setReturnUrl("https://your-company.example.com/..."); $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 = "USD", Value = 1000 }; CardDetails cardDetails = new CardDetails { Number = "4111111111111111", Cvc = "737", HolderName = "S. Hopper", ExpiryMonth = "10", ExpiryYear = "2020", Type = CardDetails.TypeEnum.Scheme }; PaymentRequest paymentRequest = new PaymentRequest { Reference = "YOUR_ORDER_NUMBER", Amount = amount, MerchantAccount = "ADYEN_MERCHANT_ACCOUNT", PaymentMethod = new CheckoutPaymentMethod(cardDetails), ReturnUrl = "https://your-company.example.com/..." }; // 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: "USD", value: 1000 }, reference: "YOUR_ORDER_NUMBER", paymentMethod: { type: "scheme", number: "4111111111111111", expiryMonth: "10", expiryYear: "2020", cvc: "737", holderName: "S. Hopper" }, returnUrl: "https://your-company.example.com/...", merchantAccount: "ADYEN_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: "USD", Value: 1000, } cardDetails := checkout.CardDetails{ Number: common.PtrString("4111111111111111"), Cvc: common.PtrString("737"), HolderName: common.PtrString("S. Hopper"), ExpiryMonth: common.PtrString("10"), ExpiryYear: common.PtrString("2020"), Type: common.PtrString("scheme"), } paymentRequest := checkout.PaymentRequest{ Reference: "YOUR_ORDER_NUMBER", Amount: amount, MerchantAccount: "ADYEN_MERCHANT_ACCOUNT", PaymentMethod: checkout.CardDetailsAsCheckoutPaymentMethod(&cardDetails), ReturnUrl: "https://your-company.example.com/...", } // 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": "USD", "value": 1000 }, "reference": "YOUR_ORDER_NUMBER", "paymentMethod": { "type": "scheme", "number": "4111111111111111", "expiryMonth": "03", "expiryYear": "2030", "cvc": "737", "holderName": "S. Hopper" }, "returnUrl": "https://your-company.example.com/...", "merchantAccount": "ADYEN_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 => 'USD', :value => 1000 }, :reference => 'YOUR_ORDER_NUMBER', :paymentMethod => { :type => 'scheme', :number => '4111111111111111', :expiryMonth => '10', :expiryYear => '2020', :cvc => '737', :holderName => 'S. Hopper' }, :returnUrl => 'https://your-company.example.com/...', :merchantAccount => 'ADYEN_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: "USD", value: 1000 }; const cardDetails: Types.checkout.CardDetails = { number: "4111111111111111", cvc: "737", holderName: "S. Hopper", expiryMonth: "10", expiryYear: "2020", type: Types.checkout.CardDetails.TypeEnum.Scheme }; const paymentRequest: Types.checkout.PaymentRequest = { reference: "YOUR_ORDER_NUMBER", amount: amount, merchantAccount: "ADYEN_MERCHANT_ACCOUNT", paymentMethod: cardDetails, returnUrl: "https://your-company.example.com/..." }; // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` The [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) response contains: * [pspReference](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/payments__resParam_pspReference): Our unique identifier for the transaction. * `resultCode`: Use this to [present the payment result to your shopper](#present-the-payment-result). * `merchantReference`: The `reference` from the [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request. * `additionalData`: Additional information about the transaction.\ To specify the fields that you want to receive in `additionalData`, log in to your [Customer Area](https://ca-test.adyen.com/), and go to **Developers** > **Additional data**. **/payments response** ```json { "additionalData": { "cardSummary": "1111" }, "pspReference": "851572424333194G", "resultCode": "Authorised", "merchantReference": "YOUR_ORDER_NUMBER" } ``` ## Present the payment result Use the  [resultCode](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#responses-200-resultCode) from the [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) response to present the payment result to your shopper. You will also receive the outcome of the payment asynchronously in a [webhook](/development-resources/webhooks). For card payments, you can receive the following `resultCode` values: | resultCode | Description | Action to take | | -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | **Authorised** | The payment was successful. | Inform the shopper that the payment has been successful. If you are using [manual capture](/online-payments/capture#manual-capture), you also need to [capture](/online-payments/capture) the payment. | | **Cancelled** | The shopper cancelled the payment. | Ask the shopper whether they want to continue with the order, or ask them to select a different payment method. | | **Error** | There was an error when the payment was being processed. For more information, check the [`refusalReason` ](/development-resources/refusal-reasons)field. | Inform the shopper that there was an error processing their payment. | | **Refused** | The payment was refused. For more information, check the [`refusalReason` ](/development-resources/refusal-reasons)field. | Ask the shopper to try the payment again using a different payment method. | Additional `resultCode` values are possible in case of the 3D Secure authentication flow. For more information, refer to [Result codes](/online-payments/build-your-integration/payment-result-codes/#3d-secure-authentication). ## Present debit and credit cards separately This requires Checkout API v53 and later. In some scenarios, you may want to present your shoppers with separate payment forms for debit cards and credit cards. Some examples include: * If you accept payments in Sweden, you need to present debit cards before credit cards in order to comply with [local legislation](https://www.regeringen.se/rattsliga-dokument/lagradsremiss/2019/12/presentation-av-betalningssatt-vid-marknadsforing-av-betaltjanster-online). * In Brazil, many shoppers use *Combo cards*, allowing for both debit and credit transactions. Having a separate form for **Debit Card** and **Credit Card** gives your shoppers a clear indication of whether they are making a debit or credit transaction. For more details, see the corresponding sections about [Brazil](#brazil) and [Sweden](#sweden). To show debit and credit cards separately: 1. If you are using the [/paymentMethods](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentMethods) endpoint to get a list of payment methods to present on the client side, include: * [splitCardFundingSources](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentMethods#request-splitCardFundingSources): Set this to **true** to receive separate objects for credit and debit cards in the response. The following example shows how to get the available payment methods for a shopper in the **Netherlands**, making a **EUR 47.00** payment. **/paymentMethods request** ```bash curl https://checkout-test.adyen.com/v72/paymentMethods \ -H 'x-api-key: ADYEN_API_KEY' \ -H 'content-type: application/json' \ -d '{ "merchantAccount": "YOUR_MERCHANT_ACCOUNT", "countryCode": "NL", "amount": { "currency": "EUR", "value": 4700 }, "splitCardFundingSources": true }' ``` The response includes the list of available payment methods, with debit and credit cards split into separate objects. **Response** ```json { ... "paymentMethods": [ { "brands": [ "mc", "visa", "amex" ], ... "fundingSource": "credit", "name": "Credit Card", "type": "scheme" }, { "brands": [ "mc", "visa", "amex" ], "fundingSource": "debit", "name": "Debit Card", "type": "scheme" } ] } ``` 2. When the shopper selects to pay with either a debit or credit card, proceed to make a POST [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request and include: * `paymentMethod.fundingSource`: Set this to either **credit** or **debit**. The following example shows how you can make a payment request for a debit card. **/payments request** ```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":4700 }, "reference":"YOUR_ORDER_NUMBER", "paymentMethod": { "type": "scheme", "number": "4111111111111111", "expiryMonth": "10", "expiryYear": "2020", "cvc": "737", "holderName": "S.Hopper", "fundingSource": "debit" }, "returnUrl": "https://your-company.example.com/...", "merchantAccount":"YOUR_MERCHANT_ACCOUNT" }' ``` ### Brazil For debit transactions, we highly recommend using [3D Secure](/online-payments/3d-secure) and [automatic capture](/online-payments/capture) due to some issuers' restrictions. ### Sweden When accepting payments in Sweden, present debit before credit cards, and label the forms clearly in order to comply with [Swedish legislations](https://www.regeringen.se/rattsliga-dokument/lagradsremiss/2019/12/presentation-av-betalningssatt-vid-marknadsforing-av-betaltjanster-online). ## Recurring payments Cards support [tokenization](/online-payments/tokenization) for [one-click](/get-started-with-adyen/adyen-glossary/#one-click-payments), [subscription](/get-started-with-adyen/adyen-glossary/#subscriptions), and [unscheduled card-on-file](/get-started-with-adyen/adyen-glossary#unscheduled-card-on-file-ucof) payments. Refer to [Create tokens](/online-payments/tokenization/create-tokens/) to integrate with our tokenization feature. We strongly recommend that you ask explicit permission from the shopper if you intend to make future recurring payments. Being transparent about the payment schedule and the charged amount reduces the risk of chargebacks. ### Store card details When creating a token for cards: * Use the standard tokenization parameters in your payment request. You do not need to include any additional parameters for cards. **Create a token for one click payments with raw card data** #### curl ```bash curl https://checkout-test.adyen.com/v72/payments \ -H 'x-api-key: ADYEN_API_KEY' \ -H 'content-type: application/json' \ -d '{ "amount":{ "value":0, "currency":"USD" }, "paymentMethod":{ "type":"scheme", "number":"4111111111111111", "expiryMonth":"03", "expiryYear":"2030", "cvc":"737", "holderName":"John Smith" }, "reference":"YOUR_ORDER_REFERENCE", "shopperInteraction": "Ecommerce", "recurringProcessingModel": "UnscheduledCardOnFile", "storePaymentMethod": "true", "merchantAccount":"YOUR_MERCHANT_ACCOUNT", "shopperReference":"YOUR_SHOPPER_REFERENCE", "returnUrl":"https://your-company.example.com/..." }' ``` #### Java ```java // Adyen Java API Library v39.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, also include your liveEndpointUrlPrefix. Client client = new Client("ADYEN_API_KEY", Environment.TEST); // Create the request object(s) Amount amount = new Amount() .currency("USD") .value(0L); CardDetails cardDetails = new CardDetails() .number("4111111111111111") .cvc("737") .holderName("John Smith") .expiryMonth("03") .expiryYear("2030") .type(CardDetails.TypeEnum.SCHEME); PaymentRequest paymentRequest = new PaymentRequest() .reference("YOUR_ORDER_REFERENCE") .amount(amount) .storePaymentMethod(true) .merchantAccount("YOUR_MERCHANT_ACCOUNT") .recurringProcessingModel(PaymentRequest.RecurringProcessingModelEnum.UNSCHEDULEDCARDONFILE) .paymentMethod(new CheckoutPaymentMethod(cardDetails)) .shopperInteraction(PaymentRequest.ShopperInteractionEnum.ECOMMERCE) .returnUrl("https://your-company.example.com/...") .shopperReference("YOUR_SHOPPER_REFERENCE"); // 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("USD") ->setValue(0); $checkoutPaymentMethod = new CheckoutPaymentMethod(); $checkoutPaymentMethod ->setNumber("4111111111111111") ->setCvc("737") ->setHolderName("John Smith") ->setExpiryMonth("03") ->setExpiryYear("2030") ->setType("scheme"); $paymentRequest = new PaymentRequest(); $paymentRequest ->setReference("YOUR_ORDER_REFERENCE") ->setAmount($amount) ->setStorePaymentMethod(true) ->setMerchantAccount("YOUR_MERCHANT_ACCOUNT") ->setRecurringProcessingModel("UnscheduledCardOnFile") ->setPaymentMethod($checkoutPaymentMethod) ->setShopperInteraction("Ecommerce") ->setReturnUrl("https://your-company.example.com/...") ->setShopperReference("YOUR_SHOPPER_REFERENCE"); $requestOptions['idempotencyKey'] = 'UUID'; // Send the request $service = new PaymentsApi($client); $response = $service->payments($paymentRequest, $requestOptions); ``` #### C\# ```cs // Adyen .net API Library v32.1.1 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 = "USD", Value = 0 }; CardDetails cardDetails = new CardDetails { Number = "4111111111111111", Cvc = "737", HolderName = "John Smith", ExpiryMonth = "03", ExpiryYear = "2030", Type = CardDetails.TypeEnum.Scheme }; PaymentRequest paymentRequest = new PaymentRequest { Reference = "YOUR_ORDER_REFERENCE", Amount = amount, StorePaymentMethod = true, MerchantAccount = "YOUR_MERCHANT_ACCOUNT", RecurringProcessingModel = PaymentRequest.RecurringProcessingModelEnum.UnscheduledCardOnFile, PaymentMethod = new CheckoutPaymentMethod(cardDetails), ShopperInteraction = PaymentRequest.ShopperInteractionEnum.Ecommerce, ReturnUrl = "https://your-company.example.com/...", ShopperReference = "YOUR_SHOPPER_REFERENCE" }; // 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 v29.0.0 const { Client, CheckoutAPI } = require('@adyen/api-library'); // For the LIVE environment, also include your liveEndpointUrlPrefix. const config = new Config({ apiKey: "ADYEN_API_KEY", environment: EnvironmentEnum.TEST }); const client = new Client(config); // Create the request object(s) const paymentRequest = { amount: { value: 0, currency: "USD" }, paymentMethod: { type: "scheme", number: "4111111111111111", expiryMonth: "03", expiryYear: "2030", cvc: "737", holderName: "John Smith" }, reference: "YOUR_ORDER_REFERENCE", shopperInteraction: "Ecommerce", recurringProcessingModel: "UnscheduledCardOnFile", storePaymentMethod: "true", merchantAccount: "YOUR_MERCHANT_ACCOUNT", shopperReference: "YOUR_SHOPPER_REFERENCE", returnUrl: "https://your-company.example.com/..." } // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` #### Go ```go // Adyen Go API Library v21.0.0 import ( "context" "github.com/adyen/adyen-go-api-library/v21/src/common" "github.com/adyen/adyen-go-api-library/v21/src/adyen" "github.com/adyen/adyen-go-api-library/v21/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: "USD", Value: 0, } cardDetails := checkout.CardDetails{ Number: common.PtrString("4111111111111111"), Cvc: common.PtrString("737"), HolderName: common.PtrString("John Smith"), ExpiryMonth: common.PtrString("03"), ExpiryYear: common.PtrString("2030"), Type: common.PtrString("scheme"), } paymentRequest := checkout.PaymentRequest{ Reference: "YOUR_ORDER_REFERENCE", Amount: amount, StorePaymentMethod: common.PtrBool(true), MerchantAccount: "YOUR_MERCHANT_ACCOUNT", RecurringProcessingModel: common.PtrString("UnscheduledCardOnFile"), PaymentMethod: checkout.CardDetailsAsCheckoutPaymentMethod(&cardDetails), ShopperInteraction: common.PtrString("Ecommerce"), ReturnUrl: "https://your-company.example.com/...", ShopperReference: common.PtrString("YOUR_SHOPPER_REFERENCE"), } // 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.6.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": { "value": 0, "currency": "USD" }, "paymentMethod": { "type": "scheme", "number": "4111111111111111", "expiryMonth": "03", "expiryYear": "2030", "cvc": "737", "holderName": "John Smith" }, "reference": "YOUR_ORDER_REFERENCE", "shopperInteraction": "Ecommerce", "recurringProcessingModel": "UnscheduledCardOnFile", "storePaymentMethod": "True", "merchantAccount": "YOUR_MERCHANT_ACCOUNT", "shopperReference": "YOUR_SHOPPER_REFERENCE", "returnUrl": "https://your-company.example.com/..." } # Send the request result = adyen.checkout.payments_api.payments(request=json_request, idempotency_key="UUID") ``` #### Ruby ```rb # Adyen Ruby API Library v10.4.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 => { :value => 0, :currency => 'USD' }, :paymentMethod => { :type => 'scheme', :number => '4111111111111111', :expiryMonth => '03', :expiryYear => '2030', :cvc => '737', :holderName => 'John Smith' }, :reference => 'YOUR_ORDER_REFERENCE', :shopperInteraction => 'Ecommerce', :recurringProcessingModel => 'UnscheduledCardOnFile', :storePaymentMethod => 'true', :merchantAccount => 'YOUR_MERCHANT_ACCOUNT', :shopperReference => 'YOUR_SHOPPER_REFERENCE', :returnUrl => 'https://your-company.example.com/...' } # Send the request result = adyen.checkout.payments_api.payments(request_body, headers: { 'Idempotency-Key' => 'UUID' }) ``` #### NodeJS (TypeScript) ```ts // Adyen Node API Library v29.0.0 import { Client, CheckoutAPI, Types } from "@adyen/api-library"; // For the LIVE environment, also include your liveEndpointUrlPrefix. const config = new Config({ apiKey: "ADYEN_API_KEY", environment: EnvironmentEnum.TEST }); const client = new Client(config); // Create the request object(s) const amount: Types.checkout.Amount = { currency: "USD", value: 0 }; const cardDetails: Types.checkout.CardDetails = { number: "4111111111111111", cvc: "737", holderName: "John Smith", expiryMonth: "03", expiryYear: "2030", type: Types.checkout.CardDetails.TypeEnum.Scheme }; const paymentRequest: Types.checkout.PaymentRequest = { reference: "YOUR_ORDER_REFERENCE", amount: amount, storePaymentMethod: true, merchantAccount: "YOUR_MERCHANT_ACCOUNT", recurringProcessingModel: Types.checkout.PaymentRequest.RecurringProcessingModelEnum.UnscheduledCardOnFile, paymentMethod: cardDetails, shopperInteraction: Types.checkout.PaymentRequest.ShopperInteractionEnum.Ecommerce, returnUrl: "https://your-company.example.com/...", shopperReference: "YOUR_SHOPPER_REFERENCE" }; // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` ### Show stored cards 1. In your [/paymentMethods](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentMethods) request, include the [shopperReference](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentMethods#request-shopperReference) that you specified when creating the token to receive the stored payment details for the shopper. The [/paymentMethods](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentMethods) response includes a `storedPaymentMethods` array containing the stored payment methods for this shopper. The `storedPaymentMethods` array contains the `id` that you need when making a payment. ```json { ... "storedPaymentMethods":[ { "brand":"visa", "expiryMonth":"10", "expiryYear":"2020", "holderName":"John Smith", "id":"8415718415172204", "lastFour":"1111", "name":"VISA", "supportedShopperInteractions":[ "Ecommerce", "ContAuth" ], "type":"scheme" } ] ... } ``` 2. Collect the following card details from the shopper in your payment form: | Card details | Example input | | ----------------------------- | ------------- | | The security code (CVV / CVC) | "737" | ### Make a one-click payment [Make a one-click payment](/online-payments/tokenization/make-token-payments#make-a-one-click-payment) using standard tokenization parameters. You do not need to include any additional parameters for cards. **Make a one-click payment with raw card data** #### curl ```bash curl https://checkout-test.adyen.com/v72/payments \ -H 'x-API-key: ADYEN_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "amount":{ "value":2000, "currency":"USD" }, "paymentMethod":{ "type":"scheme", "storedPaymentMethodId":"8415718415172204", "cvc":"737" }, "reference":"YOUR_ORDER_NUMBER", "merchantAccount":"YOUR_MERCHANT_ACCOUNT", "returnUrl":"https://your-company.example.com/checkout?shopperOrder=12xy..", "shopperReference":"YOUR_UNIQUE_SHOPPER_ID", "shopperInteraction":"ContAuth", "recurringProcessingModel":"CardOnFile" }' ``` #### Java ```java // Adyen Java API Library v39.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, also include your liveEndpointUrlPrefix. Client client = new Client("ADYEN_API_KEY", Environment.TEST); // Create the request object(s) Amount amount = new Amount() .currency("USD") .value(2000L); CardDetails cardDetails = new CardDetails() .cvc("737") .storedPaymentMethodId("8415718415172204") .type(CardDetails.TypeEnum.SCHEME); PaymentRequest paymentRequest = new PaymentRequest() .reference("YOUR_ORDER_NUMBER") .amount(amount) .merchantAccount("YOUR_MERCHANT_ACCOUNT") .recurringProcessingModel(PaymentRequest.RecurringProcessingModelEnum.CARDONFILE) .paymentMethod(new CheckoutPaymentMethod(cardDetails)) .shopperInteraction(PaymentRequest.ShopperInteractionEnum.CONTAUTH) .returnUrl("https://your-company.example.com/checkout?shopperOrder=12xy..") .shopperReference("YOUR_UNIQUE_SHOPPER_ID"); // 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("USD") ->setValue(2000); $checkoutPaymentMethod = new CheckoutPaymentMethod(); $checkoutPaymentMethod ->setCvc("737") ->setStoredPaymentMethodId("8415718415172204") ->setType("scheme"); $paymentRequest = new PaymentRequest(); $paymentRequest ->setReference("YOUR_ORDER_NUMBER") ->setAmount($amount) ->setMerchantAccount("YOUR_MERCHANT_ACCOUNT") ->setRecurringProcessingModel("CardOnFile") ->setPaymentMethod($checkoutPaymentMethod) ->setShopperInteraction("ContAuth") ->setReturnUrl("https://your-company.example.com/checkout?shopperOrder=12xy..") ->setShopperReference("YOUR_UNIQUE_SHOPPER_ID"); $requestOptions['idempotencyKey'] = 'UUID'; // Send the request $service = new PaymentsApi($client); $response = $service->payments($paymentRequest, $requestOptions); ``` #### C\# ```cs // Adyen .net API Library v32.1.1 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 = "USD", Value = 2000 }; CardDetails cardDetails = new CardDetails { Cvc = "737", StoredPaymentMethodId = "8415718415172204", Type = CardDetails.TypeEnum.Scheme }; PaymentRequest paymentRequest = new PaymentRequest { Reference = "YOUR_ORDER_NUMBER", Amount = amount, MerchantAccount = "YOUR_MERCHANT_ACCOUNT", RecurringProcessingModel = PaymentRequest.RecurringProcessingModelEnum.CardOnFile, PaymentMethod = new CheckoutPaymentMethod(cardDetails), ShopperInteraction = PaymentRequest.ShopperInteractionEnum.ContAuth, ReturnUrl = "https://your-company.example.com/checkout?shopperOrder=12xy..", ShopperReference = "YOUR_UNIQUE_SHOPPER_ID" }; // 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 v29.0.0 const { Client, CheckoutAPI } = require('@adyen/api-library'); // For the LIVE environment, also include your liveEndpointUrlPrefix. const config = new Config({ apiKey: "ADYEN_API_KEY", environment: EnvironmentEnum.TEST }); const client = new Client(config); // Create the request object(s) const paymentRequest = { amount: { value: 2000, currency: "USD" }, paymentMethod: { type: "scheme", storedPaymentMethodId: "8415718415172204", cvc: "737" }, reference: "YOUR_ORDER_NUMBER", merchantAccount: "YOUR_MERCHANT_ACCOUNT", returnUrl: "https://your-company.example.com/checkout?shopperOrder=12xy..", shopperReference: "YOUR_UNIQUE_SHOPPER_ID", shopperInteraction: "ContAuth", recurringProcessingModel: "CardOnFile" } // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` #### Go ```go // Adyen Go API Library v21.0.0 import ( "context" "github.com/adyen/adyen-go-api-library/v21/src/common" "github.com/adyen/adyen-go-api-library/v21/src/adyen" "github.com/adyen/adyen-go-api-library/v21/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: "USD", Value: 2000, } cardDetails := checkout.CardDetails{ Cvc: common.PtrString("737"), StoredPaymentMethodId: common.PtrString("8415718415172204"), Type: common.PtrString("scheme"), } paymentRequest := checkout.PaymentRequest{ Reference: "YOUR_ORDER_NUMBER", Amount: amount, MerchantAccount: "YOUR_MERCHANT_ACCOUNT", RecurringProcessingModel: common.PtrString("CardOnFile"), PaymentMethod: checkout.CardDetailsAsCheckoutPaymentMethod(&cardDetails), ShopperInteraction: common.PtrString("ContAuth"), ReturnUrl: "https://your-company.example.com/checkout?shopperOrder=12xy..", ShopperReference: common.PtrString("YOUR_UNIQUE_SHOPPER_ID"), } // 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.6.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": { "value": 2000, "currency": "USD" }, "paymentMethod": { "type": "scheme", "storedPaymentMethodId": "8415718415172204", "cvc": "737" }, "reference": "YOUR_ORDER_NUMBER", "merchantAccount": "YOUR_MERCHANT_ACCOUNT", "returnUrl": "https://your-company.example.com/checkout?shopperOrder=12xy..", "shopperReference": "YOUR_UNIQUE_SHOPPER_ID", "shopperInteraction": "ContAuth", "recurringProcessingModel": "CardOnFile" } # Send the request result = adyen.checkout.payments_api.payments(request=json_request, idempotency_key="UUID") ``` #### Ruby ```rb # Adyen Ruby API Library v10.4.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 => { :value => 2000, :currency => 'USD' }, :paymentMethod => { :type => 'scheme', :storedPaymentMethodId => '8415718415172204', :cvc => '737' }, :reference => 'YOUR_ORDER_NUMBER', :merchantAccount => 'YOUR_MERCHANT_ACCOUNT', :returnUrl => 'https://your-company.example.com/checkout?shopperOrder=12xy..', :shopperReference => 'YOUR_UNIQUE_SHOPPER_ID', :shopperInteraction => 'ContAuth', :recurringProcessingModel => 'CardOnFile' } # Send the request result = adyen.checkout.payments_api.payments(request_body, headers: { 'Idempotency-Key' => 'UUID' }) ``` #### NodeJS (TypeScript) ```ts // Adyen Node API Library v29.0.0 import { Client, CheckoutAPI, Types } from "@adyen/api-library"; // For the LIVE environment, also include your liveEndpointUrlPrefix. const config = new Config({ apiKey: "ADYEN_API_KEY", environment: EnvironmentEnum.TEST }); const client = new Client(config); // Create the request object(s) const amount: Types.checkout.Amount = { currency: "USD", value: 2000 }; const cardDetails: Types.checkout.CardDetails = { cvc: "737", storedPaymentMethodId: "8415718415172204", type: Types.checkout.CardDetails.TypeEnum.Scheme }; const paymentRequest: Types.checkout.PaymentRequest = { reference: "YOUR_ORDER_NUMBER", amount: amount, merchantAccount: "YOUR_MERCHANT_ACCOUNT", recurringProcessingModel: Types.checkout.PaymentRequest.RecurringProcessingModelEnum.CardOnFile, paymentMethod: cardDetails, shopperInteraction: Types.checkout.PaymentRequest.ShopperInteractionEnum.ContAuth, returnUrl: "https://your-company.example.com/checkout?shopperOrder=12xy..", shopperReference: "YOUR_UNIQUE_SHOPPER_ID" }; // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` ### Make a subscription payment [Make a subscription payment](/online-payments/tokenization/make-token-payments#make-a-subscription-payment) using standard tokenization parameters. You do not need to include any additional parameters for cards. **Make a subscription payment with raw card data** #### curl ```bash curl https://checkout-test.adyen.com/v72/payments \ -H 'x-API-key: ADYEN_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "amount":{ "value":2000, "currency":"USD" }, "paymentMethod":{ "type":"scheme", "storedPaymentMethodId":"8415718415172204", "cvc":"737" }, "reference":"YOUR_ORDER_NUMBER", "merchantAccount":"YOUR_MERCHANT_ACCOUNT", "returnUrl":"https://your-company.example.com/checkout?shopperOrder=12xy..", "shopperReference":"YOUR_UNIQUE_SHOPPER_ID", "shopperInteraction":"ContAuth", "recurringProcessingModel":"Subscription" }' ``` #### Java ```java // Adyen Java API Library v39.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, also include your liveEndpointUrlPrefix. Client client = new Client("ADYEN_API_KEY", Environment.TEST); // Create the request object(s) Amount amount = new Amount() .currency("USD") .value(2000L); CardDetails cardDetails = new CardDetails() .cvc("737") .storedPaymentMethodId("8415718415172204") .type(CardDetails.TypeEnum.SCHEME); PaymentRequest paymentRequest = new PaymentRequest() .reference("YOUR_ORDER_NUMBER") .amount(amount) .merchantAccount("YOUR_MERCHANT_ACCOUNT") .recurringProcessingModel(PaymentRequest.RecurringProcessingModelEnum.SUBSCRIPTION) .paymentMethod(new CheckoutPaymentMethod(cardDetails)) .shopperInteraction(PaymentRequest.ShopperInteractionEnum.CONTAUTH) .returnUrl("https://your-company.example.com/checkout?shopperOrder=12xy..") .shopperReference("YOUR_UNIQUE_SHOPPER_ID"); // 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("USD") ->setValue(2000); $checkoutPaymentMethod = new CheckoutPaymentMethod(); $checkoutPaymentMethod ->setCvc("737") ->setStoredPaymentMethodId("8415718415172204") ->setType("scheme"); $paymentRequest = new PaymentRequest(); $paymentRequest ->setReference("YOUR_ORDER_NUMBER") ->setAmount($amount) ->setMerchantAccount("YOUR_MERCHANT_ACCOUNT") ->setRecurringProcessingModel("Subscription") ->setPaymentMethod($checkoutPaymentMethod) ->setShopperInteraction("ContAuth") ->setReturnUrl("https://your-company.example.com/checkout?shopperOrder=12xy..") ->setShopperReference("YOUR_UNIQUE_SHOPPER_ID"); $requestOptions['idempotencyKey'] = 'UUID'; // Send the request $service = new PaymentsApi($client); $response = $service->payments($paymentRequest, $requestOptions); ``` #### C\# ```cs // Adyen .net API Library v32.1.1 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 = "USD", Value = 2000 }; CardDetails cardDetails = new CardDetails { Cvc = "737", StoredPaymentMethodId = "8415718415172204", Type = CardDetails.TypeEnum.Scheme }; PaymentRequest paymentRequest = new PaymentRequest { Reference = "YOUR_ORDER_NUMBER", Amount = amount, MerchantAccount = "YOUR_MERCHANT_ACCOUNT", RecurringProcessingModel = PaymentRequest.RecurringProcessingModelEnum.Subscription, PaymentMethod = new CheckoutPaymentMethod(cardDetails), ShopperInteraction = PaymentRequest.ShopperInteractionEnum.ContAuth, ReturnUrl = "https://your-company.example.com/checkout?shopperOrder=12xy..", ShopperReference = "YOUR_UNIQUE_SHOPPER_ID" }; // 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 v29.0.0 const { Client, CheckoutAPI } = require('@adyen/api-library'); // For the LIVE environment, also include your liveEndpointUrlPrefix. const config = new Config({ apiKey: "ADYEN_API_KEY", environment: EnvironmentEnum.TEST }); const client = new Client(config); // Create the request object(s) const paymentRequest = { amount: { value: 2000, currency: "USD" }, paymentMethod: { type: "scheme", storedPaymentMethodId: "8415718415172204", cvc: "737" }, reference: "YOUR_ORDER_NUMBER", merchantAccount: "YOUR_MERCHANT_ACCOUNT", returnUrl: "https://your-company.example.com/checkout?shopperOrder=12xy..", shopperReference: "YOUR_UNIQUE_SHOPPER_ID", shopperInteraction: "ContAuth", recurringProcessingModel: "Subscription" } // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` #### Go ```go // Adyen Go API Library v21.0.0 import ( "context" "github.com/adyen/adyen-go-api-library/v21/src/common" "github.com/adyen/adyen-go-api-library/v21/src/adyen" "github.com/adyen/adyen-go-api-library/v21/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: "USD", Value: 2000, } cardDetails := checkout.CardDetails{ Cvc: common.PtrString("737"), StoredPaymentMethodId: common.PtrString("8415718415172204"), Type: common.PtrString("scheme"), } paymentRequest := checkout.PaymentRequest{ Reference: "YOUR_ORDER_NUMBER", Amount: amount, MerchantAccount: "YOUR_MERCHANT_ACCOUNT", RecurringProcessingModel: common.PtrString("Subscription"), PaymentMethod: checkout.CardDetailsAsCheckoutPaymentMethod(&cardDetails), ShopperInteraction: common.PtrString("ContAuth"), ReturnUrl: "https://your-company.example.com/checkout?shopperOrder=12xy..", ShopperReference: common.PtrString("YOUR_UNIQUE_SHOPPER_ID"), } // 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.6.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": { "value": 2000, "currency": "USD" }, "paymentMethod": { "type": "scheme", "storedPaymentMethodId": "8415718415172204", "cvc": "737" }, "reference": "YOUR_ORDER_NUMBER", "merchantAccount": "YOUR_MERCHANT_ACCOUNT", "returnUrl": "https://your-company.example.com/checkout?shopperOrder=12xy..", "shopperReference": "YOUR_UNIQUE_SHOPPER_ID", "shopperInteraction": "ContAuth", "recurringProcessingModel": "Subscription" } # Send the request result = adyen.checkout.payments_api.payments(request=json_request, idempotency_key="UUID") ``` #### Ruby ```rb # Adyen Ruby API Library v10.4.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 => { :value => 2000, :currency => 'USD' }, :paymentMethod => { :type => 'scheme', :storedPaymentMethodId => '8415718415172204', :cvc => '737' }, :reference => 'YOUR_ORDER_NUMBER', :merchantAccount => 'YOUR_MERCHANT_ACCOUNT', :returnUrl => 'https://your-company.example.com/checkout?shopperOrder=12xy..', :shopperReference => 'YOUR_UNIQUE_SHOPPER_ID', :shopperInteraction => 'ContAuth', :recurringProcessingModel => 'Subscription' } # Send the request result = adyen.checkout.payments_api.payments(request_body, headers: { 'Idempotency-Key' => 'UUID' }) ``` #### NodeJS (TypeScript) ```ts // Adyen Node API Library v29.0.0 import { Client, CheckoutAPI, Types } from "@adyen/api-library"; // For the LIVE environment, also include your liveEndpointUrlPrefix. const config = new Config({ apiKey: "ADYEN_API_KEY", environment: EnvironmentEnum.TEST }); const client = new Client(config); // Create the request object(s) const amount: Types.checkout.Amount = { currency: "USD", value: 2000 }; const cardDetails: Types.checkout.CardDetails = { cvc: "737", storedPaymentMethodId: "8415718415172204", type: Types.checkout.CardDetails.TypeEnum.Scheme }; const paymentRequest: Types.checkout.PaymentRequest = { reference: "YOUR_ORDER_NUMBER", amount: amount, merchantAccount: "YOUR_MERCHANT_ACCOUNT", recurringProcessingModel: Types.checkout.PaymentRequest.RecurringProcessingModelEnum.Subscription, paymentMethod: cardDetails, shopperInteraction: Types.checkout.PaymentRequest.ShopperInteractionEnum.ContAuth, returnUrl: "https://your-company.example.com/checkout?shopperOrder=12xy..", shopperReference: "YOUR_UNIQUE_SHOPPER_ID" }; // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` ### Make an unscheduled card-on-file payment [Make an unscheduled card-on-file payment](/online-payments/tokenization/make-token-payments#make-a-subscription-payment) using standard tokenization parameters. You do not need to include any additional parameters for cards. **Make an unscheduled card-on-file payment with raw card data** #### curl ```bash curl https://checkout-test.adyen.com/v72/payments \ -H 'x-API-key: ADYEN_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "amount":{ "value":2000, "currency":"USD" }, "paymentMethod":{ "type":"scheme", "storedPaymentMethodId":"8415718415172204", "cvc":"737" }, "reference":"YOUR_ORDER_NUMBER", "merchantAccount":"YOUR_MERCHANT_ACCOUNT", "returnUrl":"https://your-company.example.com/checkout?shopperOrder=12xy..", "shopperReference":"YOUR_UNIQUE_SHOPPER_ID", "shopperInteraction":"ContAuth", "recurringProcessingModel":"UnscheduledCardOnFile" }' ``` #### Java ```java // Adyen Java API Library v39.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, also include your liveEndpointUrlPrefix. Client client = new Client("ADYEN_API_KEY", Environment.TEST); // Create the request object(s) Amount amount = new Amount() .currency("USD") .value(2000L); CardDetails cardDetails = new CardDetails() .cvc("737") .storedPaymentMethodId("8415718415172204") .type(CardDetails.TypeEnum.SCHEME); PaymentRequest paymentRequest = new PaymentRequest() .reference("YOUR_ORDER_NUMBER") .amount(amount) .merchantAccount("YOUR_MERCHANT_ACCOUNT") .recurringProcessingModel(PaymentRequest.RecurringProcessingModelEnum.UNSCHEDULEDCARDONFILE) .paymentMethod(new CheckoutPaymentMethod(cardDetails)) .shopperInteraction(PaymentRequest.ShopperInteractionEnum.CONTAUTH) .returnUrl("https://your-company.example.com/checkout?shopperOrder=12xy..") .shopperReference("YOUR_UNIQUE_SHOPPER_ID"); // 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("USD") ->setValue(2000); $checkoutPaymentMethod = new CheckoutPaymentMethod(); $checkoutPaymentMethod ->setCvc("737") ->setStoredPaymentMethodId("8415718415172204") ->setType("scheme"); $paymentRequest = new PaymentRequest(); $paymentRequest ->setReference("YOUR_ORDER_NUMBER") ->setAmount($amount) ->setMerchantAccount("YOUR_MERCHANT_ACCOUNT") ->setRecurringProcessingModel("UnscheduledCardOnFile") ->setPaymentMethod($checkoutPaymentMethod) ->setShopperInteraction("ContAuth") ->setReturnUrl("https://your-company.example.com/checkout?shopperOrder=12xy..") ->setShopperReference("YOUR_UNIQUE_SHOPPER_ID"); $requestOptions['idempotencyKey'] = 'UUID'; // Send the request $service = new PaymentsApi($client); $response = $service->payments($paymentRequest, $requestOptions); ``` #### C\# ```cs // Adyen .net API Library v32.1.1 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 = "USD", Value = 2000 }; CardDetails cardDetails = new CardDetails { Cvc = "737", StoredPaymentMethodId = "8415718415172204", Type = CardDetails.TypeEnum.Scheme }; PaymentRequest paymentRequest = new PaymentRequest { Reference = "YOUR_ORDER_NUMBER", Amount = amount, MerchantAccount = "YOUR_MERCHANT_ACCOUNT", RecurringProcessingModel = PaymentRequest.RecurringProcessingModelEnum.UnscheduledCardOnFile, PaymentMethod = new CheckoutPaymentMethod(cardDetails), ShopperInteraction = PaymentRequest.ShopperInteractionEnum.ContAuth, ReturnUrl = "https://your-company.example.com/checkout?shopperOrder=12xy..", ShopperReference = "YOUR_UNIQUE_SHOPPER_ID" }; // 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 v29.0.0 const { Client, CheckoutAPI } = require('@adyen/api-library'); // For the LIVE environment, also include your liveEndpointUrlPrefix. const config = new Config({ apiKey: "ADYEN_API_KEY", environment: EnvironmentEnum.TEST }); const client = new Client(config); // Create the request object(s) const paymentRequest = { amount: { value: 2000, currency: "USD" }, paymentMethod: { type: "scheme", storedPaymentMethodId: "8415718415172204", cvc: "737" }, reference: "YOUR_ORDER_NUMBER", merchantAccount: "YOUR_MERCHANT_ACCOUNT", returnUrl: "https://your-company.example.com/checkout?shopperOrder=12xy..", shopperReference: "YOUR_UNIQUE_SHOPPER_ID", shopperInteraction: "ContAuth", recurringProcessingModel: "UnscheduledCardOnFile" } // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` #### Go ```go // Adyen Go API Library v21.0.0 import ( "context" "github.com/adyen/adyen-go-api-library/v21/src/common" "github.com/adyen/adyen-go-api-library/v21/src/adyen" "github.com/adyen/adyen-go-api-library/v21/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: "USD", Value: 2000, } cardDetails := checkout.CardDetails{ Cvc: common.PtrString("737"), StoredPaymentMethodId: common.PtrString("8415718415172204"), Type: common.PtrString("scheme"), } paymentRequest := checkout.PaymentRequest{ Reference: "YOUR_ORDER_NUMBER", Amount: amount, MerchantAccount: "YOUR_MERCHANT_ACCOUNT", RecurringProcessingModel: common.PtrString("UnscheduledCardOnFile"), PaymentMethod: checkout.CardDetailsAsCheckoutPaymentMethod(&cardDetails), ShopperInteraction: common.PtrString("ContAuth"), ReturnUrl: "https://your-company.example.com/checkout?shopperOrder=12xy..", ShopperReference: common.PtrString("YOUR_UNIQUE_SHOPPER_ID"), } // 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.6.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": { "value": 2000, "currency": "USD" }, "paymentMethod": { "type": "scheme", "storedPaymentMethodId": "8415718415172204", "cvc": "737" }, "reference": "YOUR_ORDER_NUMBER", "merchantAccount": "YOUR_MERCHANT_ACCOUNT", "returnUrl": "https://your-company.example.com/checkout?shopperOrder=12xy..", "shopperReference": "YOUR_UNIQUE_SHOPPER_ID", "shopperInteraction": "ContAuth", "recurringProcessingModel": "UnscheduledCardOnFile" } # Send the request result = adyen.checkout.payments_api.payments(request=json_request, idempotency_key="UUID") ``` #### Ruby ```rb # Adyen Ruby API Library v10.4.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 => { :value => 2000, :currency => 'USD' }, :paymentMethod => { :type => 'scheme', :storedPaymentMethodId => '8415718415172204', :cvc => '737' }, :reference => 'YOUR_ORDER_NUMBER', :merchantAccount => 'YOUR_MERCHANT_ACCOUNT', :returnUrl => 'https://your-company.example.com/checkout?shopperOrder=12xy..', :shopperReference => 'YOUR_UNIQUE_SHOPPER_ID', :shopperInteraction => 'ContAuth', :recurringProcessingModel => 'UnscheduledCardOnFile' } # Send the request result = adyen.checkout.payments_api.payments(request_body, headers: { 'Idempotency-Key' => 'UUID' }) ``` #### NodeJS (TypeScript) ```ts // Adyen Node API Library v29.0.0 import { Client, CheckoutAPI, Types } from "@adyen/api-library"; // For the LIVE environment, also include your liveEndpointUrlPrefix. const config = new Config({ apiKey: "ADYEN_API_KEY", environment: EnvironmentEnum.TEST }); const client = new Client(config); // Create the request object(s) const amount: Types.checkout.Amount = { currency: "USD", value: 2000 }; const cardDetails: Types.checkout.CardDetails = { cvc: "737", storedPaymentMethodId: "8415718415172204", type: Types.checkout.CardDetails.TypeEnum.Scheme }; const paymentRequest: Types.checkout.PaymentRequest = { reference: "YOUR_ORDER_NUMBER", amount: amount, merchantAccount: "YOUR_MERCHANT_ACCOUNT", recurringProcessingModel: Types.checkout.PaymentRequest.RecurringProcessingModelEnum.UnscheduledCardOnFile, paymentMethod: cardDetails, shopperInteraction: Types.checkout.PaymentRequest.ShopperInteractionEnum.ContAuth, returnUrl: "https://your-company.example.com/checkout?shopperOrder=12xy..", shopperReference: "YOUR_UNIQUE_SHOPPER_ID" }; // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` ## Test and go live Before making live card payments: 1. Test your integration using our [test card numbers](/development-resources/test-cards-and-credentials/test-card-numbers). You can check the status of test payments in your [Customer Area](https://ca-test.adyen.com/) > **Transactions** > **Payments**. 2. [Add the cards that you want to accept](/payment-methods/add-payment-methods) in your [live Customer Area](https://ca-live.adyen.com/). 3. Before you can start accepting card payments in the live environment, you need to assess your PCI DSS compliance and submit the required *Self-Assessment Questionnaire D* document. For more information, refer to [PCI DSS compliance guide](/development-resources/pci-dss-compliance-guide#online-payments). ## See also * [API-only integration guide](/online-payments/api-only) * [Tokenization](/online-payments/tokenization) * [Webhooks](/development-resources/webhooks) * [API Explorer](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/overview)