--- title: "Manage card details" description: "Learn how to securely process the details of third-party cards." url: "https://docs.adyen.com/payouts/payout-service/pay-out-to-cards/manage-card-details" source_url: "https://docs.adyen.com/payouts/payout-service/pay-out-to-cards/manage-card-details.md" canonical: "https://docs.adyen.com/payouts/payout-service/pay-out-to-cards/manage-card-details" last_modified: "2023-11-30T12:07:00+01:00" language: "en" --- # Manage card details Learn how to securely process the details of third-party cards. [View source](/payouts/payout-service/pay-out-to-cards/manage-card-details.md) To pay out funds to a third-party card, you must collect the card details, such as the card number and expiry date. With these details, you can also use the [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) endpoint to make requests for additional card data. For example, you can check if the card is eligible for payouts, or the details that you need to set up recurring payouts. If you are [fully PCI compliant](/get-started-with-adyen/adyen-glossary/#pci-compliance), you are allowed to use raw card details to make API requests. Otherwise, you must collect and encrypt the card details using our [Card Component](/payment-methods/cards/custom-card-integration). Then, you can use the encrypted card details to make API requests. Additionally, if you are not fully PCI compliant, or want to make recurring payouts to a card, you must use the [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) endpoint to tokenize the card details before [making a card payout request](/payouts/payout-service/pay-out-to-cards/card-payout-request). This page explains how to: * [Enable your account to receive additional card data](#additional-data-payout). * [Check if the card is eligible for payouts](#payout-zero-auth). * [Store card details](#store-card-details). ## Requirements Before you begin, take into account the following requirements and preparations. | Requirement | Description | | -------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Integration type** | An Adyen [payout service integration](/payouts/payout-service/integration-checklist/) and the [Checkout API](https://docs.adyen.com/api-explorer/Checkout/latest/overview) for tokenization. | | **[API credentials](/development-resources/api-credentials/)** | Your company (**ws\@Company.\[YourCompanyAccount]**) has the following [roles](/development-resources/api-credentials/roles) for the [Checkout API](https://docs.adyen.com/api-explorer/Checkout/latest/overview): - **Checkout webservice**. Allows the user to make payments using the [Checkout API](https://docs.adyen.com/api-explorer/Checkout/latest/overview). - **Merchant Recurring**. Allows the user to store payment details using [tokenization](/online-payments/tokenization) and reuse them for future payments. - **Checkout encrypted cardholder data**. Allows the user to submit encrypted card data via [Drop-in](/payment-methods/cards/web-drop-in), [Components](/payment-methods/cards/web-component), or [Custom Card fields](/payment-methods/cards/custom-card-integration). - **API PCI Payments**. Allows the user to submit raw card data in payment requests. | | **[Webhooks](/development-resources/webhooks)** | Make sure that your server can [receive and accept webhooks](/development-resources/webhooks). | | **Setup steps** | Contact your Adyen representative to enable the feature on your account. | ## 1. Enable your account to receive additional data To [check the eligibility](#payout-zero-auth) of a card or [store card details](#store-card-details), you need additional card data that you receive in a [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) response. However, you must first enable your account to receive additional data, such as: * Card eligibility details * The card's Bank Identification Number (BIN) * Details regarding recurring payouts To enable your account to receive additional data: 1. In your [Customer Area](https://ca-test.adyen.com/), go to **Developers** > **Additional data**. 2. Select the fields that you want to include. * To get the card eligibility details, under **Card**, select **Card bin payout details**. * To get the card BIN details, under **Card**, select **Card bin details**. Among other parameters, this enables the `cardBin` in the [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) response. * To get the details required to make recurring payouts to a card, under **Payment**, select **Recurring details**. 3. Select **Save configuration**. ## 2. Check if the card is eligible for payouts If you have [enabled your account to receive eligibility details](#additional-data-payout), you can check whether a card is eligible for payouts by making a zero-auth payment. Do the following: 1. Make a zero-auth payment by creating a POST [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request, specifying the following parameters: | Request parameter | Required | Description | | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | [amount.currency](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-amount-currency) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Set to the currency that is applicable to the card. | | [amount.value](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-amount-value) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Set to **0** (zero). | | [paymentMethod](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-paymentMethod) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | An object that contains the details of the card that you want to pay out to. You can only include raw card data in the request if you are [fully PCI compliant](/get-started-with-adyen/adyen-glossary/#pci-compliance). Otherwise, use our [Card Component](/payment-methods/cards/custom-card-integration) to securely collect and encrypt card details. | | [merchantAccount](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-merchantAccount) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The identifier of your merchant account. | | [reference](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-reference) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Your unique reference to identify the payment request. | | [returnUrl](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-returnUrl) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The URL to return in case that you must redirect the cardholder. | The following tabs show how to make a zero-auth payment request using raw or encrypted card data. ### Tab: Request with raw card data **Request a zero-auth payment with raw data** #### curl ```bash curl https://checkout-test.adyen.com/v68/payments \ -H 'x-api-key: ADYEN_API_KEY' \ -H 'content-type: application/json' \ -X POST \ -d '{ "amount": { "value": 0, "currency": "USD" }, "paymentMethod": { "type": "scheme", "number": "4111111111111111", "expiryMonth": "03", "expiryYear": "2030", "cvc": "737", "holderName": "Albert Klaassen" }, "reference": "Your unique reference for the payment", "returnUrl": "https://your-company.example.com/...", "merchantAccount": "YOUR_MERCHANT_ACCOUNT", "shopperReference": "Your unique reference for the cardholder" }' ``` #### Java ```java // Adyen Java API Library v26.2.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(0L); CardDetails cardDetails = new CardDetails() .number("4111111111111111") .cvc("737") .holderName("Albert Klaassen") .expiryMonth("03") .expiryYear("2030") .type(CardDetails.TypeEnum.SCHEME); PaymentRequest paymentRequest = new PaymentRequest() .reference("Your unique reference for the payment") .amount(amount) .merchantAccount("YOUR_MERCHANT_ACCOUNT") .paymentMethod(new CheckoutPaymentMethod(cardDetails)) .returnUrl("https://your-company.example.com/...") .shopperReference("Your unique reference for the cardholder"); // 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.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(0); $checkoutPaymentMethod = new CheckoutPaymentMethod(); $checkoutPaymentMethod ->setNumber("4111111111111111") ->setCvc("737") ->setHolderName("Albert Klaassen") ->setExpiryMonth("03") ->setExpiryYear("2030") ->setType("scheme"); $paymentRequest = new PaymentRequest(); $paymentRequest ->setReference("Your unique reference for the payment") ->setAmount($amount) ->setMerchantAccount("YOUR_MERCHANT_ACCOUNT") ->setPaymentMethod($checkoutPaymentMethod) ->setReturnUrl("https://your-company.example.com/...") ->setShopperReference("Your unique reference for the cardholder"); $requestOptions['idempotencyKey'] = 'UUID'; // Send the request $service = new PaymentsApi($client); $response = $service->payments($paymentRequest, $requestOptions); ``` #### C\# ```cs // Adyen .net API Library v16.1.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 = 0 }; CardDetails cardDetails = new CardDetails { Number = "4111111111111111", Cvc = "737", HolderName = "Albert Klaassen", ExpiryMonth = "03", ExpiryYear = "2030", Type = CardDetails.TypeEnum.Scheme }; PaymentRequest paymentRequest = new PaymentRequest { Reference = "Your unique reference for the payment", Amount = amount, MerchantAccount = "YOUR_MERCHANT_ACCOUNT", PaymentMethod = new CheckoutPaymentMethod(cardDetails), ReturnUrl = "https://your-company.example.com/...", ShopperReference = "Your unique reference for the cardholder" }; // 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.2.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: { value: 0, currency: "USD" }, paymentMethod: { type: "scheme", number: "4111111111111111", expiryMonth: "03", expiryYear: "2030", cvc: "737", holderName: "Albert Klaassen" }, reference: "Your unique reference for the payment", returnUrl: "https://your-company.example.com/...", merchantAccount: "YOUR_MERCHANT_ACCOUNT", shopperReference: "Your unique reference for the cardholder" } // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` #### Go ```go // Adyen Go API Library v10.2.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: 0, } cardDetails := checkout.CardDetails{ Number: common.PtrString("4111111111111111"), Cvc: common.PtrString("737"), HolderName: common.PtrString("Albert Klaassen"), ExpiryMonth: common.PtrString("03"), ExpiryYear: common.PtrString("2030"), Type: common.PtrString("scheme"), } paymentRequest := checkout.PaymentRequest{ Reference: "Your unique reference for the payment", Amount: amount, MerchantAccount: "YOUR_MERCHANT_ACCOUNT", PaymentMethod: checkout.CardDetailsAsCheckoutPaymentMethod(&cardDetails), ReturnUrl: "https://your-company.example.com/...", ShopperReference: common.PtrString("Your unique reference for the cardholder"), } // 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.0 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": { "value": 0, "currency": "USD" }, "paymentMethod": { "type": "scheme", "number": "4111111111111111", "expiryMonth": "03", "expiryYear": "2030", "cvc": "737", "holderName": "Albert Klaassen" }, "reference": "Your unique reference for the payment", "returnUrl": "https://your-company.example.com/...", "merchantAccount": "YOUR_MERCHANT_ACCOUNT", "shopperReference": "Your unique reference for the cardholder" } # Send the request result = adyen.checkout.payments_api.payments(request=json_request, idempotency_key="UUID") ``` #### Ruby ```rb # Adyen Ruby API Library v9.5.0 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 => { :value => 0, :currency => 'USD' }, :paymentMethod => { :type => 'scheme', :number => '4111111111111111', :expiryMonth => '03', :expiryYear => '2030', :cvc => '737', :holderName => 'Albert Klaassen' }, :reference => 'Your unique reference for the payment', :returnUrl => 'https://your-company.example.com/...', :merchantAccount => 'YOUR_MERCHANT_ACCOUNT', :shopperReference => 'Your unique reference for the cardholder' } # Send the request result = adyen.checkout.payments_api.payments(request_body, headers: { 'Idempotency-Key' => 'UUID' }) ``` #### NodeJS (TypeScript) ```ts // Adyen Node API Library v17.2.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: 0 }; const cardDetails: Types.checkout.CardDetails = { number: "4111111111111111", cvc: "737", holderName: "Albert Klaassen", expiryMonth: "03", expiryYear: "2030", type: Types.checkout.CardDetails.TypeEnum.Scheme }; const paymentRequest: Types.checkout.PaymentRequest = { reference: "Your unique reference for the payment", amount: amount, merchantAccount: "YOUR_MERCHANT_ACCOUNT", paymentMethod: cardDetails, returnUrl: "https://your-company.example.com/...", shopperReference: "Your unique reference for the cardholder" }; // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` ### Tab: Request with encrypted card data **Request a zero-auth payment with encrypted data** #### curl ```bash curl https://checkout-test.adyen.com/v68/payments \ -H 'x-api-key: ADYEN_API_KEY' \ -H 'content-type: application/json' \ -X POST \ -d '{ "amount": { "currency": "USD", "value": 0 }, "reference": "Your unique reference for the payment", "paymentMethod": { "type": "scheme", "encryptedCardNumber": "test_4111111111111111", "encryptedExpiryMonth": "test_03", "encryptedExpiryYear": "test_2030", "encryptedSecurityCode": "test_737" }, "returnUrl": "https://your-company.example.com/...", "merchantAccount": "YOUR_MERCHANT_ACCOUNT", "shopperReference": "Your unique reference for the cardholder" }' ``` #### Java ```java // Adyen Java API Library v26.2.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(0L); 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 unique reference for the payment") .amount(amount) .merchantAccount("YOUR_MERCHANT_ACCOUNT") .paymentMethod(new CheckoutPaymentMethod(cardDetails)) .returnUrl("https://your-company.example.com/...") .shopperReference("Your unique reference for the cardholder"); // 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.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(0); $checkoutPaymentMethod = new CheckoutPaymentMethod(); $checkoutPaymentMethod ->setEncryptedCardNumber("test_4111111111111111") ->setEncryptedSecurityCode("test_737") ->setEncryptedExpiryYear("test_2030") ->setEncryptedExpiryMonth("test_03") ->setType("scheme"); $paymentRequest = new PaymentRequest(); $paymentRequest ->setReference("Your unique reference for the payment") ->setAmount($amount) ->setMerchantAccount("YOUR_MERCHANT_ACCOUNT") ->setPaymentMethod($checkoutPaymentMethod) ->setReturnUrl("https://your-company.example.com/...") ->setShopperReference("Your unique reference for the cardholder"); $requestOptions['idempotencyKey'] = 'UUID'; // Send the request $service = new PaymentsApi($client); $response = $service->payments($paymentRequest, $requestOptions); ``` #### C\# ```cs // Adyen .net API Library v16.1.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 = 0 }; 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 unique reference for the payment", Amount = amount, MerchantAccount = "YOUR_MERCHANT_ACCOUNT", PaymentMethod = new CheckoutPaymentMethod(cardDetails), ReturnUrl = "https://your-company.example.com/...", ShopperReference = "Your unique reference for the cardholder" }; // 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.2.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: 0 }, reference: "Your unique reference for the payment", paymentMethod: { type: "scheme", encryptedCardNumber: "test_4111111111111111", encryptedExpiryMonth: "test_03", encryptedExpiryYear: "test_2030", encryptedSecurityCode: "test_737" }, returnUrl: "https://your-company.example.com/...", merchantAccount: "YOUR_MERCHANT_ACCOUNT", shopperReference: "Your unique reference for the cardholder" } // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` #### Go ```go // Adyen Go API Library v10.2.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: 0, } 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 unique reference for the payment", Amount: amount, MerchantAccount: "YOUR_MERCHANT_ACCOUNT", PaymentMethod: checkout.CardDetailsAsCheckoutPaymentMethod(&cardDetails), ReturnUrl: "https://your-company.example.com/...", ShopperReference: common.PtrString("Your unique reference for the cardholder"), } // 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.0 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": 0 }, "reference": "Your unique reference for the payment", "paymentMethod": { "type": "scheme", "encryptedCardNumber": "test_4111111111111111", "encryptedExpiryMonth": "test_03", "encryptedExpiryYear": "test_2030", "encryptedSecurityCode": "test_737" }, "returnUrl": "https://your-company.example.com/...", "merchantAccount": "YOUR_MERCHANT_ACCOUNT", "shopperReference": "Your unique reference for the cardholder" } # Send the request result = adyen.checkout.payments_api.payments(request=json_request, idempotency_key="UUID") ``` #### Ruby ```rb # Adyen Ruby API Library v9.5.0 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 => 0 }, :reference => 'Your unique reference for the payment', :paymentMethod => { :type => 'scheme', :encryptedCardNumber => 'test_4111111111111111', :encryptedExpiryMonth => 'test_03', :encryptedExpiryYear => 'test_2030', :encryptedSecurityCode => 'test_737' }, :returnUrl => 'https://your-company.example.com/...', :merchantAccount => 'YOUR_MERCHANT_ACCOUNT', :shopperReference => 'Your unique reference for the cardholder' } # Send the request result = adyen.checkout.payments_api.payments(request_body, headers: { 'Idempotency-Key' => 'UUID' }) ``` #### NodeJS (TypeScript) ```ts // Adyen Node API Library v17.2.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: 0 }; 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 unique reference for the payment", amount: amount, merchantAccount: "YOUR_MERCHANT_ACCOUNT", paymentMethod: cardDetails, returnUrl: "https://your-company.example.com/...", shopperReference: "Your unique reference for the cardholder" }; // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` 2. In the response, check the following parameters in the `additionalData` object, which include eligibility information: | Response parameter | Possible values | Description for Visa | Description for Mastercard | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------- | ----------------------------- | ---------------------------------------------------- | | [payoutEligible](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#responses-200-additionalData-ResponseAdditionalDataCommon-payoutEligible) | **Y** | Eligible for payouts. | Eligible for both domestic and cross-border payouts. | | | **D** | Not applicable | Only eligible for domestic payouts. | | | **N** or **U** | Not eligible for payouts. | Not eligible for payouts. | | [fundsAvailability](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#responses-200-additionalData-ResponseAdditionalDataCommon-fundsAvailability)This is only returned if `payoutEligible` is **Y** or **D** | **I** | The card supports fast funds. | The product type is **Prepaid** or **Debit**. | | | **N** | Otherwise | Otherwise | ### Tab: Response with raw card data **Zero-auth payment response with raw card data** ```json { "additionalData": { "payoutEligible": "Y", "fundsAvailability": "I", "cardSchemeCommercial": "true", "cardPaymentMethod": "visa", "cardIssuingBank": "Bank of America", "cardIssuingCountry": "US", "cardIssuingCurrency": "USD", "cardBin": "411111", "fundingSource": "DEBIT" }, "pspReference":"MLSPNCQ8HXSKGK82", "resultCode":"Authorised" } ``` ### Tab: Response with encrypted card data **Zero-auth payment response with encrypted card data** ```json { "additionalData": { "payoutEligible":"Y", "fundsAvailability":"I", "cvcResult": "1 Matches", "authCode": "065696", "avsResult": "4 AVS not supported for this card type", "avsResultRaw": "4", "cvcResultRaw": "M", "refusalReasonRaw": "AUTHORISED", "acquirerCode": "TestPmmAcquirer", "acquirerReference": "8PQMP9VIE9N" }, "pspReference": "MLSPNCQ8HXSKGK82", "resultCode": "Authorised", "merchantReference": "string" } ``` ## 3. Store card details You must store card details using [tokenization](/online-payments/tokenization) if: * You want to make recurring payouts to the card. * You are **not** [fully PCI compliant](/get-started-with-adyen/adyen-glossary/#pci-compliance), which means that you cannot process raw card details. To tokenize and store card details: 1. Make a POST [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request, specifying the following parameters: | Request parameter | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | [amount.currency](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-amount-currency) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Set to the currency that is applicable to the card. | | [amount.value](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-amount-value) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Set to **0** (zero) to combine with a zero-auth payment. | | [paymentMethod](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-paymentMethod) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | An object that contains the details of the card that you want to pay out to. You can only include raw card data in the request if you are [fully PCI compliant](/get-started-with-adyen/adyen-glossary/#pci-compliance). Otherwise, use our [Card Component](/payment-methods/cards/custom-card-integration) to securely collect and encrypt card details. | | [billingAddress](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-billingAddress) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | An object that contains the address details of the cardholder. | | [enablePayOut](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-enablePayOut) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Set to **true**. | | [merchantAccount](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-merchantAccount) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The identifier of your merchant account. | | [recurringProcessingModel](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-recurringProcessingModel) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Specifies the type of recurring payment. — For one-off payouts: set to **CardOnFile**. — For recurring payouts: set to **Subscription**. | | [reference](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-reference) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Your unique reference to identify the payment request. | | [returnUrl](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-returnUrl) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The URL to return in case that you must redirect the cardholder. | | [shopperReference](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-shopperReference) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Your unique reference to identify the cardholder. | | [storePaymentMethod](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-storePaymentMethod) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Set to **true**. | The following tabs show examples that combine a zero-auth payment request with creating a token that represents the card details. ### Tab: Request with raw card data **Tokenization request with raw data** #### curl ```bash curl https://checkout-test.adyen.com/v68/payments \ -H 'x-api-key: ADYEN_API_KEY' \ -H 'content-type: application/json' \ -X POST \ -d '{ "amount": { "value": 0, "currency": "USD" }, "paymentMethod": { "type": "scheme", "number": "4111111111111111", "expiryMonth": "03", "expiryYear": "2030", "cvc": "737", "holderName": "Albert Klaassen" }, "billingAddress": { "houseNumberOrName": "274", "street": "Brannan St.", "city": "San Francisco", "stateOrProvince": "CA", "country": "US", "postalCode": "94107" }, "enablePayOut": true, "merchantAccount": "YOUR_MERCHANT_ACCOUNT", "reference": "Your unique reference for the payment request", "returnUrl": "https://your-company.example.com/...", "recurringProcessingModel": "CardOnFile", "shopperReference": "Your unique reference for the cardholder", "storePaymentMethod": true, "dateOfBirth": "1990-01-01", "entityType": "individual" }' ``` #### 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("USD") .value(0L); CardDetails cardDetails = new CardDetails() .number("4111111111111111") .cvc("737") .holderName("Albert Klaassen") .expiryMonth("03") .expiryYear("2030") .type(CardDetails.TypeEnum.SCHEME); BillingAddress billingAddress = new BillingAddress() .country("US") .stateOrProvince("CA") .city("San Francisco") .houseNumberOrName("274") .street("Brannan St.") .postalCode("94107"); PaymentRequest paymentRequest = new PaymentRequest() .reference("Your unique reference for the payment request") .enablePayOut(true) .amount(amount) .storePaymentMethod(true) .merchantAccount("YOUR_MERCHANT_ACCOUNT") .entityType(PaymentRequest.EntityTypeEnum.INDIVIDUAL) .recurringProcessingModel(PaymentRequest.RecurringProcessingModelEnum.CARDONFILE) .paymentMethod(new CheckoutPaymentMethod(cardDetails)) .dateOfBirth(OffsetDateTime.parse("1990-01-01")) .billingAddress(billingAddress) .returnUrl("https://your-company.example.com/...") .shopperReference("Your unique reference for the cardholder"); // 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\BillingAddress; 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(0); $checkoutPaymentMethod = new CheckoutPaymentMethod(); $checkoutPaymentMethod ->setNumber("4111111111111111") ->setCvc("737") ->setHolderName("Albert Klaassen") ->setExpiryMonth("03") ->setExpiryYear("2030") ->setType("scheme"); $billingAddress = new BillingAddress(); $billingAddress ->setCountry("US") ->setStateOrProvince("CA") ->setCity("San Francisco") ->setHouseNumberOrName("274") ->setStreet("Brannan St.") ->setPostalCode("94107"); $paymentRequest = new PaymentRequest(); $paymentRequest ->setReference("Your unique reference for the payment request") ->setEnablePayOut(true) ->setAmount($amount) ->setStorePaymentMethod(true) ->setMerchantAccount("YOUR_MERCHANT_ACCOUNT") ->setEntityType("individual") ->setRecurringProcessingModel("CardOnFile") ->setPaymentMethod($checkoutPaymentMethod) ->setDateOfBirth("1990-01-01") ->setBillingAddress($billingAddress) ->setReturnUrl("https://your-company.example.com/...") ->setShopperReference("Your unique reference for the cardholder"); $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 = 0 }; CardDetails cardDetails = new CardDetails { Number = "4111111111111111", Cvc = "737", HolderName = "Albert Klaassen", ExpiryMonth = "03", ExpiryYear = "2030", Type = CardDetails.TypeEnum.Scheme }; BillingAddress billingAddress = new BillingAddress { Country = "US", StateOrProvince = "CA", City = "San Francisco", HouseNumberOrName = "274", Street = "Brannan St.", PostalCode = "94107" }; PaymentRequest paymentRequest = new PaymentRequest { Reference = "Your unique reference for the payment request", EnablePayOut = true, Amount = amount, StorePaymentMethod = true, MerchantAccount = "YOUR_MERCHANT_ACCOUNT", EntityType = PaymentRequest.EntityTypeEnum.Individual, RecurringProcessingModel = PaymentRequest.RecurringProcessingModelEnum.CardOnFile, PaymentMethod = new CheckoutPaymentMethod(cardDetails), DateOfBirth = DateTime.Parse("1990-01-01"), BillingAddress = billingAddress, ReturnUrl = "https://your-company.example.com/...", ShopperReference = "Your unique reference for the cardholder" }; // 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 = { amount: { value: 0, currency: "USD" }, paymentMethod: { type: "scheme", number: "4111111111111111", expiryMonth: "03", expiryYear: "2030", cvc: "737", holderName: "Albert Klaassen" }, billingAddress: { houseNumberOrName: "274", street: "Brannan St.", city: "San Francisco", stateOrProvince: "CA", country: "US", postalCode: "94107" }, enablePayOut: true, merchantAccount: "YOUR_MERCHANT_ACCOUNT", reference: "Your unique reference for the payment request", returnUrl: "https://your-company.example.com/...", recurringProcessingModel: "CardOnFile", shopperReference: "Your unique reference for the cardholder", storePaymentMethod: true, dateOfBirth: new Date("1990-01-01"), entityType: "individual" } // 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" "time" "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: 0, } cardDetails := checkout.CardDetails{ Number: common.PtrString("4111111111111111"), Cvc: common.PtrString("737"), HolderName: common.PtrString("Albert Klaassen"), ExpiryMonth: common.PtrString("03"), ExpiryYear: common.PtrString("2030"), Type: common.PtrString("scheme"), } billingAddress := checkout.BillingAddress{ Country: "US", StateOrProvince: common.PtrString("CA"), City: "San Francisco", HouseNumberOrName: "274", Street: "Brannan St.", PostalCode: "94107", } paymentRequest := checkout.PaymentRequest{ Reference: "Your unique reference for the payment request", EnablePayOut: common.PtrBool(true), Amount: amount, StorePaymentMethod: common.PtrBool(true), MerchantAccount: "YOUR_MERCHANT_ACCOUNT", EntityType: common.PtrString("individual"), RecurringProcessingModel: common.PtrString("CardOnFile"), PaymentMethod: checkout.CardDetailsAsCheckoutPaymentMethod(&cardDetails), DateOfBirth: func() *time.Time { t, _ := time.Parse(time.RFC3339, "1990-01-01"); return &t }(), BillingAddress: &billingAddress, ReturnUrl: "https://your-company.example.com/...", ShopperReference: common.PtrString("Your unique reference for the cardholder"), } // 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": { "value": 0, "currency": "USD" }, "paymentMethod": { "type": "scheme", "number": "4111111111111111", "expiryMonth": "03", "expiryYear": "2030", "cvc": "737", "holderName": "Albert Klaassen" }, "billingAddress": { "houseNumberOrName": "274", "street": "Brannan St.", "city": "San Francisco", "stateOrProvince": "CA", "country": "US", "postalCode": "94107" }, "enablePayOut": True, "merchantAccount": "YOUR_MERCHANT_ACCOUNT", "reference": "Your unique reference for the payment request", "returnUrl": "https://your-company.example.com/...", "recurringProcessingModel": "CardOnFile", "shopperReference": "Your unique reference for the cardholder", "storePaymentMethod": True, "dateOfBirth": "1990-01-01", "entityType": "individual" } # 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 => { :value => 0, :currency => 'USD' }, :paymentMethod => { :type => 'scheme', :number => '4111111111111111', :expiryMonth => '03', :expiryYear => '2030', :cvc => '737', :holderName => 'Albert Klaassen' }, :billingAddress => { :houseNumberOrName => '274', :street => 'Brannan St.', :city => 'San Francisco', :stateOrProvince => 'CA', :country => 'US', :postalCode => '94107' }, :enablePayOut => true, :merchantAccount => 'YOUR_MERCHANT_ACCOUNT', :reference => 'Your unique reference for the payment request', :returnUrl => 'https://your-company.example.com/...', :recurringProcessingModel => 'CardOnFile', :shopperReference => 'Your unique reference for the cardholder', :storePaymentMethod => true, :dateOfBirth => '1990-01-01', :entityType => 'individual' } # 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: "USD", value: 0 }; const cardDetails: Types.checkout.CardDetails = { number: "4111111111111111", cvc: "737", holderName: "Albert Klaassen", expiryMonth: "03", expiryYear: "2030", type: Types.checkout.CardDetails.TypeEnum.Scheme }; const billingAddress: Types.checkout.BillingAddress = { country: "US", stateOrProvince: "CA", city: "San Francisco", houseNumberOrName: "274", street: "Brannan St.", postalCode: "94107" }; const paymentRequest: Types.checkout.PaymentRequest = { reference: "Your unique reference for the payment request", enablePayOut: true, amount: amount, storePaymentMethod: true, merchantAccount: "YOUR_MERCHANT_ACCOUNT", entityType: Types.checkout.PaymentRequest.EntityTypeEnum.Individual, recurringProcessingModel: Types.checkout.PaymentRequest.RecurringProcessingModelEnum.CardOnFile, paymentMethod: cardDetails, dateOfBirth: new Date("1990-01-01"), billingAddress: billingAddress, returnUrl: "https://your-company.example.com/...", shopperReference: "Your unique reference for the cardholder" }; // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` ### Tab: Request with encrypted card data **Tokenization request with encrypted data** #### curl ```bash curl https://checkout-test.adyen.com/v68/payments \ -H 'x-api-key: ADYEN_API_KEY' \ -H 'content-type: application/json' \ -X POST \ -d '{ "amount": { "currency": "USD", "value": 0 }, "paymentMethod": { "type": "scheme", "encryptedCardNumber": "test_4111111111111111", "encryptedExpiryMonth": "test_03", "encryptedExpiryYear": "test_2030", "encryptedSecurityCode": "test_737" }, "billingAddress": { "houseNumberOrName": "274", "street": "Brannan St.", "city": "San Francisco", "stateOrProvince": "CA", "country": "US", "postalCode": "94107" }, "enablePayOut": true, "merchantAccount": "YOUR_MERCHANT_ACCOUNT", "reference": "Your unique reference for the payment request", "returnUrl": "https://your-company.example.com/...", "recurringProcessingModel": "CardOnFile", "shopperReference": "Your unique reference for the cardholder", "storePaymentMethod": true, "dateOfBirth": "1990-01-01", "entityType": "individual" }' ``` #### 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("USD") .value(0L); CardDetails cardDetails = new CardDetails() .encryptedCardNumber("test_4111111111111111") .encryptedSecurityCode("test_737") .encryptedExpiryYear("test_2030") .encryptedExpiryMonth("test_03") .type(CardDetails.TypeEnum.SCHEME); BillingAddress billingAddress = new BillingAddress() .country("US") .stateOrProvince("CA") .city("San Francisco") .houseNumberOrName("274") .street("Brannan St.") .postalCode("94107"); PaymentRequest paymentRequest = new PaymentRequest() .reference("Your unique reference for the payment request") .enablePayOut(true) .amount(amount) .storePaymentMethod(true) .merchantAccount("YOUR_MERCHANT_ACCOUNT") .entityType(PaymentRequest.EntityTypeEnum.INDIVIDUAL) .recurringProcessingModel(PaymentRequest.RecurringProcessingModelEnum.CARDONFILE) .paymentMethod(new CheckoutPaymentMethod(cardDetails)) .dateOfBirth(OffsetDateTime.parse("1990-01-01")) .billingAddress(billingAddress) .returnUrl("https://your-company.example.com/...") .shopperReference("Your unique reference for the cardholder"); // 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\BillingAddress; 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(0); $checkoutPaymentMethod = new CheckoutPaymentMethod(); $checkoutPaymentMethod ->setEncryptedCardNumber("test_4111111111111111") ->setEncryptedSecurityCode("test_737") ->setEncryptedExpiryYear("test_2030") ->setEncryptedExpiryMonth("test_03") ->setType("scheme"); $billingAddress = new BillingAddress(); $billingAddress ->setCountry("US") ->setStateOrProvince("CA") ->setCity("San Francisco") ->setHouseNumberOrName("274") ->setStreet("Brannan St.") ->setPostalCode("94107"); $paymentRequest = new PaymentRequest(); $paymentRequest ->setReference("Your unique reference for the payment request") ->setEnablePayOut(true) ->setAmount($amount) ->setStorePaymentMethod(true) ->setMerchantAccount("YOUR_MERCHANT_ACCOUNT") ->setEntityType("individual") ->setRecurringProcessingModel("CardOnFile") ->setPaymentMethod($checkoutPaymentMethod) ->setDateOfBirth("1990-01-01") ->setBillingAddress($billingAddress) ->setReturnUrl("https://your-company.example.com/...") ->setShopperReference("Your unique reference for the cardholder"); $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 = 0 }; CardDetails cardDetails = new CardDetails { EncryptedCardNumber = "test_4111111111111111", EncryptedSecurityCode = "test_737", EncryptedExpiryYear = "test_2030", EncryptedExpiryMonth = "test_03", Type = CardDetails.TypeEnum.Scheme }; BillingAddress billingAddress = new BillingAddress { Country = "US", StateOrProvince = "CA", City = "San Francisco", HouseNumberOrName = "274", Street = "Brannan St.", PostalCode = "94107" }; PaymentRequest paymentRequest = new PaymentRequest { Reference = "Your unique reference for the payment request", EnablePayOut = true, Amount = amount, StorePaymentMethod = true, MerchantAccount = "YOUR_MERCHANT_ACCOUNT", EntityType = PaymentRequest.EntityTypeEnum.Individual, RecurringProcessingModel = PaymentRequest.RecurringProcessingModelEnum.CardOnFile, PaymentMethod = new CheckoutPaymentMethod(cardDetails), DateOfBirth = DateTime.Parse("1990-01-01"), BillingAddress = billingAddress, ReturnUrl = "https://your-company.example.com/...", ShopperReference = "Your unique reference for the cardholder" }; // 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 = { amount: { currency: "USD", value: 0 }, paymentMethod: { type: "scheme", encryptedCardNumber: "test_4111111111111111", encryptedExpiryMonth: "test_03", encryptedExpiryYear: "test_2030", encryptedSecurityCode: "test_737" }, billingAddress: { houseNumberOrName: "274", street: "Brannan St.", city: "San Francisco", stateOrProvince: "CA", country: "US", postalCode: "94107" }, enablePayOut: true, merchantAccount: "YOUR_MERCHANT_ACCOUNT", reference: "Your unique reference for the payment request", returnUrl: "https://your-company.example.com/...", recurringProcessingModel: "CardOnFile", shopperReference: "Your unique reference for the cardholder", storePaymentMethod: true, dateOfBirth: new Date("1990-01-01"), entityType: "individual" } // 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" "time" "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: 0, } 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"), } billingAddress := checkout.BillingAddress{ Country: "US", StateOrProvince: common.PtrString("CA"), City: "San Francisco", HouseNumberOrName: "274", Street: "Brannan St.", PostalCode: "94107", } paymentRequest := checkout.PaymentRequest{ Reference: "Your unique reference for the payment request", EnablePayOut: common.PtrBool(true), Amount: amount, StorePaymentMethod: common.PtrBool(true), MerchantAccount: "YOUR_MERCHANT_ACCOUNT", EntityType: common.PtrString("individual"), RecurringProcessingModel: common.PtrString("CardOnFile"), PaymentMethod: checkout.CardDetailsAsCheckoutPaymentMethod(&cardDetails), DateOfBirth: func() *time.Time { t, _ := time.Parse(time.RFC3339, "1990-01-01"); return &t }(), BillingAddress: &billingAddress, ReturnUrl: "https://your-company.example.com/...", ShopperReference: common.PtrString("Your unique reference for the cardholder"), } // 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": 0 }, "paymentMethod": { "type": "scheme", "encryptedCardNumber": "test_4111111111111111", "encryptedExpiryMonth": "test_03", "encryptedExpiryYear": "test_2030", "encryptedSecurityCode": "test_737" }, "billingAddress": { "houseNumberOrName": "274", "street": "Brannan St.", "city": "San Francisco", "stateOrProvince": "CA", "country": "US", "postalCode": "94107" }, "enablePayOut": True, "merchantAccount": "YOUR_MERCHANT_ACCOUNT", "reference": "Your unique reference for the payment request", "returnUrl": "https://your-company.example.com/...", "recurringProcessingModel": "CardOnFile", "shopperReference": "Your unique reference for the cardholder", "storePaymentMethod": True, "dateOfBirth": "1990-01-01", "entityType": "individual" } # 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 => 0 }, :paymentMethod => { :type => 'scheme', :encryptedCardNumber => 'test_4111111111111111', :encryptedExpiryMonth => 'test_03', :encryptedExpiryYear => 'test_2030', :encryptedSecurityCode => 'test_737' }, :billingAddress => { :houseNumberOrName => '274', :street => 'Brannan St.', :city => 'San Francisco', :stateOrProvince => 'CA', :country => 'US', :postalCode => '94107' }, :enablePayOut => true, :merchantAccount => 'YOUR_MERCHANT_ACCOUNT', :reference => 'Your unique reference for the payment request', :returnUrl => 'https://your-company.example.com/...', :recurringProcessingModel => 'CardOnFile', :shopperReference => 'Your unique reference for the cardholder', :storePaymentMethod => true, :dateOfBirth => '1990-01-01', :entityType => 'individual' } # 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: "USD", value: 0 }; const cardDetails: Types.checkout.CardDetails = { encryptedCardNumber: "test_4111111111111111", encryptedSecurityCode: "test_737", encryptedExpiryYear: "test_2030", encryptedExpiryMonth: "test_03", type: Types.checkout.CardDetails.TypeEnum.Scheme }; const billingAddress: Types.checkout.BillingAddress = { country: "US", stateOrProvince: "CA", city: "San Francisco", houseNumberOrName: "274", street: "Brannan St.", postalCode: "94107" }; const paymentRequest: Types.checkout.PaymentRequest = { reference: "Your unique reference for the payment request", enablePayOut: true, amount: amount, storePaymentMethod: true, merchantAccount: "YOUR_MERCHANT_ACCOUNT", entityType: Types.checkout.PaymentRequest.EntityTypeEnum.Individual, recurringProcessingModel: Types.checkout.PaymentRequest.RecurringProcessingModelEnum.CardOnFile, paymentMethod: cardDetails, dateOfBirth: new Date("1990-01-01"), billingAddress: billingAddress, returnUrl: "https://your-company.example.com/...", shopperReference: "Your unique reference for the cardholder" }; // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` The token is created after a successful payment authorization. This ensures that the payment details are linked to an active, chargeable account. 2. Find the token in the `storedPaymentMethodId` parameter. This parameter is included in: * The successful authorization response, in `additionalData.tokenization.storedPaymentMethodId`, if you [enabled your account to receive additional data](#additional-data-payout). * The [recurring.token.created](https://docs.adyen.com/api-explorer/Tokenization-webhooks/latest/post/recurring.token.created) webhook. The following tabs show examples for authorized payment responses that include the token. ### Tab: Response with raw card data **Tokenization response with raw card data** ```json { "additionalData": { "recurringProcessingModel": "CardOnFile", "tokenization.shopperReference": "Your unique reference for the cardholder", "tokenization.storedPaymentMethodId": "8315659584588245", "payoutEligible":"Y", "fundsAvailability":"I" }, "pspReference": "ZC4R4RBFJGXXGN82", "resultCode": "Authorised", "amount": { "currency": "USD", "value": 0 }, "merchantReference": "Your unique reference for the payment request" } ``` ### Tab: Response with encrypted card data **Tokenization response with encrypted card data** ```json { "additionalData": { "payoutEligible":"Y", "fundsAvailability":"I", "cvcResult": "1 Matches", "authCode": "082338", "avsResult": "4 AVS not supported for this card type", "tokenization.storedPaymentMethodId": "8315659584588245", "tokenization.shopperReference": "Your unique reference for the cardholder", "recurringProcessingModel": "CardOnFile", "avsResultRaw": "4", "cvcResultRaw": "M", "refusalReasonRaw": "AUTHORISED", "acquirerCode": "TestPmmAcquirer", "acquirerReference": "8PQMP9VC172" }, "pspReference": "ZC4R4RBFJGXXGN82", "resultCode": "Authorised", "merchantReference": "Your unique reference for the payment request" } ``` 3. In your system, store the following parameters together, so that the token is associated with the cardholder: * `additionalData.tokenization.storedPaymentMethodId` * `additionalData.tokenization.shopperReference` You must provide these values when making a card payout request. ## Next steps [Make a card payout request](/payouts/payout-service/pay-out-to-cards/card-payout-request) [Pay out your funds to a third-party card using the Transfers API.](/payouts/payout-service/pay-out-to-cards/card-payout-request)