API integration

Build your own custom checkout experience using our API integration.


With our online payments API integration, you'll be able to accept key payment methods across different regions, channels, and verticals, while maintaining full control over the UI and user experience.

For many local payment methods and 3D Secure, you'll need to redirect the shopper to the payment method's website so they can complete the payment.

To accept online payments, you need an integration that can:

  1. Get a list of payment methods available to the shopper.
  2. Collect the shopper's payment details.
  3. Make a payment.
  4. Redirect the shopper to complete the payment.
  5. Present the payment result to the shopper.

We also recommend that you test your integration before you start accepting live payments.

Before you begin

Before you start integrating with our online payments API, make sure that you have performed the following steps:

  1. Sign up for an Adyen test account at https://www.adyen.com/signup
  2. Get your API Key. Save a copy as you need it for API calls you make to the Adyen payments platform.
  3. Install one of our Libraries to connect with the Adyen APIs.

For more information on these steps, refer to Get started with Adyen.

Step 1: Get available payment methods

First, you need to present a list of available payment methods to your shopper:

  • Make a /paymentMethods call, providing:
    • merchantAccount: Your merchant account name. 
    • countryCode: The shopper's country.
    • amount: The currency and value of the payment. 
    • channel: The platform of the shopper's device (specify either Android, iOS, or Web).

    We use the countryCodeamount, and channel to tailor the list of payment methods to your shopper.

curl https://checkout-test.adyen.com/v41/paymentMethods \
-H "x-API-key: YOUR_X-API-KEY" \
-H "content-type: application/json" \
-d '{
  "merchantAccount": "YOUR_MERCHANT_ACCOUNT",
  "countryCode": "NL",
  "amount": {
    "currency": "EUR",
    "value": 1000
  },
  "channel": "Web"
}'
# Set your X-API-KEY with the API key from the Customer Area.
adyen = Adyen::Client.new
adyen.api_key = "YOUR_X-API-KEY"

response = adyen.checkout.payment_methods({
  :merchantAccount => 'YOUR_MERCHANT_ACCOUNT',
  :countryCode => 'NL',
  :amount => {
    :currency => 'EUR',
    :value => 1000
  },
  :channel => 'Web'
})
// Set your X-API-KEY with the API key from the Customer Area.
Config config = new Config();
config.setApiKey("YOUR_X-API-KEY");
Client client = new Client(config);

Checkout checkout = new Checkout(client);
PaymentMethodsRequest paymentMethodsRequest = new PaymentMethodsRequest();
paymentMethodsRequest.setMerchantAccount("YOUR_MERCHANT_ACCOUNT");
paymentMethodsRequest.setCountryCode("NL");
Amount amount = new Amount();
amount.setCurrency("EUR");
amount.setValue(1000L);
paymentMethodsRequest.setAmount(amount);
paymentMethodsRequest.setChannel(CheckoutChannel.Web);
PaymentMethodsResponse response = checkout.paymentMethods(paymentMethodsRequest);
// Set your X-API-KEY with the API key from the Customer Area.
$client = new \Adyen\Client();
$client->setXApiKey("YOUR_X-API-KEY");
$service = new \Adyen\Service\Checkout($client);

$params = array(
  "merchantAccount" => "YOUR_MERCHANT_ACCOUNT",
  "countryCode" => "NL",
  "amount" => array(
    "currency" => "EUR",
    "value" => 1000
  ),
  "channel" => "Web"
);
$result = $service->paymentMethods($params);
// Set your X-API-KEY with the API key from the Customer Area.
var client = new Client ("YOUR-X-API-KEY", Environment.Test);
var checkout = new Checkout(client);
var amount = new Model.Checkout.Amount("EUR", 1000);
var paymentMethodsRequest = new Model.Checkout.PaymentMethodsRequest(MerchantAccount: "YOUR_MERCHANT_ACCOUNT")
{
   CountryCode = "NL",
   Amount = amount,
   Channel = "Web"
};
#Set your X-API-KEY with the API key from the Customer Area.
adyen = Adyen.Adyen()
adyen.client.xapikey = 'YOUR_X-API-KEY'
 
result = adyen.checkout.payment_methods({
  'merchantAccount': 'YOUR_MERCHANT_ACCOUNT',
  'countryCode': 'NL',
  'amount': {
    'value': 1000,
    'currency': 'EUR'
  },
  'channel': 'Web',
})

A list of available paymentMethods is returned in the response. Each payment method has a:

  • name: Name of the payment method, which you can display to your shopper in your payments form. 
  • type: Pass this back to indicate the shopper's chosen payment method when you make the payment
/paymentMethods response
{
  "paymentMethods":[
    {
      "details":[...],
      "name":"Credit Card",
      "type":"scheme"
      ...
    },{
      "details":[...],
      "name":"SEPA Direct Debit",
      "type":"sepadirectdebit"
    },
    ...
  ]
}

Step 2: Collect shopper details

Before you can make a payment, you need to collect any required details from your shopper. To do this, you can either:

  • Use our drop-in Components: The simplest way to collect required shopper details. 
    Add our pre-built JavaScript Components to your payments page. These are available for many popular payment methods.
  • Build your own payment form: Full control over the look and feel of your payment form.  
    Create your own static or dynamically generated payment form to collect required shopper details.

Components are not available for every payment method. You need to build your own form for payment methods that do not have a pre-built Component.

Collect details with Components 

 See sample code

Check out Components on GitHub.

Components are our drop-in JavaScript modules that you can add to your payment page.

They render as input fields that collect required shopper details, and provide the values you need to make a payment.

To integrate Components into your website:

  1. Include the following script in the <body> above any other JavaScript in your payments page

    <script src="https://checkoutshopper-test.adyen.com/checkoutshopper/sdk/2.1.0/adyen.js"></script>
  2. Apply the following CSS file:

    <link rel="stylesheet" href="https://checkoutshopper-test.adyen.com/checkoutshopper/sdk/2.1.0/adyen.css" />

    This styles any Components that appear in your payments form. Add your own styling by overriding the rules of this CSS file.

  3. Add the following code to your payments page, specifying: 

    • locale: The shopper's locale. This is used to set the language rendered in the Components. For a list of supported locales, see Localization.

    • originKey: The Origin Key of your website. To find out how to generate one, see How to get an Origin Key.
    • loadingContext: Change this to https://checkoutshopper-live.adyen.com/checkoutshopper/ when you're ready to accept live payments.  
    const configuration = {
        locale: "en_US",
        originKey: "YOUR_ORIGIN_KEY",
        loadingContext: "https://checkoutshopper-test.adyen.com/checkoutshopper/"
    };
    
    const checkout = new AdyenCheckout(configuration);
  4. Add Components for the payment methods that you'll be accepting. We currently provide Components for: 

    To accept credit card payments, for example, add the Cards Component to your payments form:

    1. Create a DOM element, placing it where you want the card form to be rendered:

      <div id="card"></div>
    2. Create an instance of the Card Component and assign a function to handle the onChange event, an event that is triggered when the shopper enters their payment details. Next, mount the component:

      const card = checkout.create("card", {
          onChange: handleOnChange
      }).mount("#card");
  5. Collect the values passed in state.data from the onChange event. These are the shopper details you need to make the payment.

    The following example is from the card Component, which provides the payment method type as well as the shopper details needed to make a credit card payment:

    function handleOnChange(state, component) {
        state.isValid // true or false.
        state.data
        /* {type: "scheme",
            encryptedCardNumber: "adyenjs_0_1_18$MT6ppy0FAMVMLH...",
            encryptedExpiryMonth: "adyenjs_0_1_18$MT6ppy0FAMVMLH...",
            encryptedExpiryYear: "adyenjs_0_1_18$MT6ppy0FAMVMLH...",
            encryptedSecurityCode: "adyenjs_0_1_18$MT6ppy0FAMVMLH..."}
        */
    }

    Any sensitive shopper details, such as credit card data, is encrypted by the Component. You can safely transmit this to Adyen.

Next, use the shopper details you collected to make the payment.

Step 3: Make a payment

Tokenized payments

If you have a subscription or recurring business model, we recommend using our tokenization service. See Recurring and subscription payments for details.

After you've collected payment details from the shopper, initiate a payment:

  • Make a /payments call, specifying:
    • amount
    • reference: Your unique reference for this payment.
    • paymentMethod: Specify the shopper's chosen payment method with the type, and include the details you collected from the shopper.
    • returnUrl: Use to redirect the shopper back to your payments page. This is used for payment methods that require a redirect.

    The example below shows how you would make a card payment using encrypted values generated by the Card Component.

curl https://checkout-test.adyen.com/v41/payments \
-H "x-API-key: YOUR_X-API-KEY" \
-H "content-type: application/json" \
-d '{
  "amount":{
    "currency":"EUR",
    "value":1000
  },
  "reference":"YOUR_ORDER_NUMBER",
  "paymentMethod":{
    "type":"scheme",
    "encryptedCardNumber":"adyenjs_0_1_18$MT6ppy0FAMVMLH...",
    "encryptedExpiryMonth":"adyenjs_0_1_18$MT6ppy0FAMVMLH...",
    "encryptedExpiryYear":"adyenjs_0_1_18$MT6ppy0FAMVMLH...",
    "encryptedSecurityCode":"adyenjs_0_1_18$MT6ppy0FAMVMLH..."
  },
  "returnUrl":"https://your-company.com/checkout/",
  "merchantAccount":"YOUR_MERCHANT_ACCOUNT"
}'
# Set your X-API-KEY with the API key from the Customer Area.
adyen = Adyen::Client.new
adyen.api_key = "YOUR_X-API-KEY"
 
response = adyen.checkout.payments({
  :amount => {
    :currency => "EUR",
    :value => 1000
  },
  :reference => "YOUR_ORDER_NUMBER",
  :paymentMethod => {
    :type => "scheme",
    :encryptedCardNumber => "adyenjs_0_1_18$MT6ppy0FAMVMLH...",
    :encryptedExpiryMonth => "adyenjs_0_1_18$MT6ppy0FAMVMLH...",
    :encryptedExpiryYear => "adyenjs_0_1_18$MT6ppy0FAMVMLH...",
    :encryptedSecurityCode => "adyenjs_0_1_18$MT6ppy0FAMVMLH..."
  },
  :returnUrl => "https://your-company.com/checkout/",
  :merchantAccount => "YOUR_MERCHANT_ACCOUNT"
})
// Set your X-API-KEY with the API key from the Customer Area.
Config config = new Config();
config.setApiKey("YOUR_X-API-KEY");
Client client = new Client(config);
 
Checkout checkout = new Checkout(client);
PaymentsRequest paymentsRequest = new PaymentsRequest();
Amount amount = new Amount();
amount.setCurrency("EUR");
amount.setValue(1000L);
paymentsRequest.setAmount(amount);
paymentsRequest.setReference("YOUR_ORDER_NUMBER");
paymentsRequest.setPaymentMethod(new HashMap<String, String>());
paymentsRequest.putPaymentMethodItem("type", "scheme");
paymentsRequest.putPaymentMethodItem("encryptedCardNumber", "adyenjs_0_1_18$MT6ppy0FAMVMLH...");
paymentsRequest.putPaymentMethodItem("encryptedExpiryMonth", "adyenjs_0_1_18$MT6ppy0FAMVMLH...");
paymentsRequest.putPaymentMethodItem("encryptedExpiryYear", "adyenjs_0_1_18$MT6ppy0FAMVMLH...");
paymentsRequest.putPaymentMethodItem("encryptedSecurityCode", "adyenjs_0_1_18$MT6ppy0FAMVMLH...");
paymentsRequest.setReturnUrl("https://your-company.com/...");
paymentsRequest.setMerchantAccount("YOUR_MERCHANT_ACCOUNT");
PaymentsResponse response = checkout.payments(paymentsRequest);
// Set your X-API-KEY with the API key from the Customer Area.
$client = new \Adyen\Client();
$client->setXApiKey("YOUR_X-API-KEY");
$service = new \Adyen\Service\Checkout($client);

$params = array(
  "amount" => array(
    "currency" => "EUR",
    "value" => 1000
  ),
  "reference" => "YOUR_ORDER_NUMBER",
  "paymentMethod" => array(
    "type" => "scheme",
    "encryptedCardNumber" => "adyenjs_0_1_18$MT6ppy0FAMVMLH...",
    "encryptedExpiryMonth" => "adyenjs_0_1_18$MT6ppy0FAMVMLH...",
    "encryptedExpiryYear" => "adyenjs_0_1_18$MT6ppy0FAMVMLH...",
    "encryptedSecurityCode" => "adyenjs_0_1_18$MT6ppy0FAMVMLH..."
  ),
  "returnUrl" => "https://your-company.com/checkout/",
  "merchantAccount" => "YOUR_MERCHANT_ACCOUNT"
);
$result = $service->payments($params);
// Set your X-API-KEY with the API key from the Customer Area.
var client = new Client ("YOUR_X-API-KEY", Environment.Test);
var checkout = new Checkout(client);

var amount = new Model.Checkout.Amount("EUR", 1000);
var details = new Model.Checkout.DefaultPaymentMethodDetails{
  Type = "scheme",
  EncryptedCardNumber = "adyenjs_0_1_18$MT6ppy0FAMVMLH...",
  EncryptedExpiryMonth = "adyenjs_0_1_18$MT6ppy0FAMVMLH...",
  EncryptedExpiryYear = "adyenjs_0_1_18$MT6ppy0FAMVMLH...",
  EncryptedSecurityCode = "adyenjs_0_1_18$MT6ppy0FAMVMLH..."
};
var paymentsRequest = new Model.Checkout.PaymentRequest
{
  Reference = "YOUR_ORDER_NUMBER",
  Amount = amount,
  ReturnUrl = @"https://your-company.com/...",
  MerchantAccount = "YOUR_MERCHANT_ACCOUNT",
  PaymentMethod = details
};

var paymentResponse = checkout.Payments(paymentsRequest);
#Set your X-API-KEY with the API key from the Customer Area.
adyen = Adyen.Adyen()
adyen.client.xapikey = 'YOUR_X-API-KEY'

result = adyen.checkout.payments({
   'amount': {
      'value': 1000,
      'currency': 'EUR'
   },
   'reference': 'YOUR_ORDER_NUMBER',
   'paymentMethod': {
      'type': 'scheme',
      'encryptedCardNumber': 'adyenjs_0_1_18$MT6ppy0FAMVMLH...',
      'encryptedExpiryMonth': 'adyenjs_0_1_18$MT6ppy0FAMVMLH...',
      'encryptedExpiryYear': 'adyenjs_0_1_18$MT6ppy0FAMVMLH...',
      'encryptedSecurityCode': 'adyenjs_0_1_18$MT6ppy0FAMVMLH...'
   },
   'returnUrl': 'https://your-company.com/...',
   'merchantAccount': 'YOUR_MERCHANT_ACCOUNT'
})

If the payment is successful you receive:

  • pspReference: Our unique identifier for the transaction.

  • resultCode: Authorised

Authorised /payments response
{
  "pspReference": "88154795347618C",
  "resultCode": "Authorised"
}

You can immediately present the payment result to the shopper.

We rely on webhook notifications to inform your system of payment results, changes in status, and other key communications. Receiving and handling these webhooks are key to a successful integration.

For many payment methods, you receive a redirectShopper resultCode instead. This means you need to redirect the shopper before the payment can be completed.

Step 4: Redirect shopper

For many local payment methods, or card payments with 3D Secure, you need to redirect the shopper to a webpage or app to complete the payment. For these payment methods the /payments response contains:

  • resultCode: redirectShopper
  • redirect.url: URL you use to redirect the shopper.
/payments response
{
  "resultCode":"redirectShopper",
  "details":[
    {
      "key":"payload",
      "type":"text"
    }
  ],
  "redirect":{
    "method":"GET",
    "url":"https://test.adyen.com/hpp/redirectIdeal.shtml?brandCode=ideal&currencyCode=EUR&issuerId=0721&merchantAccount=YourMerchantAccount&merchantReference=Your+order+number&merchantSig=Az62YcY..."
  }
}

To complete a payment that requires a redirect:

  1. Redirect the shopper to the redirect.url.

    For 3D Secure payments, you need to POST additional fields. See Cards with 3D Secure for more information.

    When the shopper has verified the payment, they return back to your website or app using the returnUrl you provided earlier. This is appended with a payload:

    https://your-company.com/checkout/?payload=sdfsdfsdf...&type=complete&resultCode=authorised
  2. Submit this payload to the  /payments/details endpoint to verify the result of the payment:

    curl https://checkout-test.adyen.com/v41/payments/details \
    -H "x-API-key: YOUR_X-API-KEY" \
    -H "content-type: application/json" \
    -d '{
      "details":{
        "payload":"sdfsdfsdf..."
      }
    }'
    # Set your X-API-KEY with the API key from the Customer Area.
    adyen = Adyen::Client.new
    adyen.api_key = "YOUR_X-API-KEY"
    
    response = adyen.checkout.payments.details({
      :details => {
        :payload => "sdfsdfsdf..."
      }
    })
    // Set your X-API-KEY with the API key from the Customer Area.
    Config config = new Config();
    config.setApiKey("YOUR_X-API-KEY");
    Client client = new Client(config);
    
    Checkout checkout = new Checkout(client);
    PaymentDetailsRequest paymentDetailsRequest = new PaymentDetailsRequest();
    HashMap<String, String> details = new HashMap<>();
    details.put("payload", "sdfsdfsdf...");
    paymentsDetailsRequest.setDetails(details);
    PaymentsResponse paymentsResponse = checkout.paymentDetails(PaymentDetailsRequest);
    // Set your X-API-KEY with the API key from the Customer Area.
    $client = new \Adyen\Client();
    $client->setXApiKey("YOUR_X-API-KEY");
    $service = new \Adyen\Service\Checkout($client);
    
    $params = array(
      "details" => array(
        "payload" => "sdfsdfsdf..."
      )
    );
    $result = $service->paymentDetails($params);
    // Set your X-API-KEY with the API key from the Customer Area.
    var client = new Client ("YOUR_X-API-KEY", Environment.Test);
    var checkout = new Checkout(client);
    
    var details = new Dictionary<string, string>
    {
      { "payload", "Ab02b4c0..." }
    };
    var paymentsDetailsRequest = new Model.Checkout.PaymentsDetailsRequest(Details: details);
    var paymentResponse = checkout.PaymentDetails(paymentsDetailsRequest);
    #Set your X-API-KEY with the API key from the Customer Area.
    adyen = Adyen.Adyen()
    adyen.client.xapikey = 'YOUR_X-API-KEY'
    
    result = adyen.checkout.payments_details({
       'details': {
          'payload': 'sdfsdfsdf...'
       }
    })

    If the payment was successful you receive:

    • pspReference: Our unique identifier for the transaction.

    • resultCode: Authorised.

    For some payment methods, you receive a Pending or Received resultCode instead. This means we're still confirming whether the payment was successful. We provide confirmation asynchronously, in a webhook notification.

Next, let the shopper know the status of their payment by presenting the payment result.

Step 5: Present payment result

When a payment is completed you receive a resultCode. Use this to present the shopper with the result of the payment in your website or app. 

To find out more about the resultCodes you can receive and how you can action these, see Result codes.

Testing your integration

Before going live, use our list of test cards and other payment methods to test your integration. We recommend testing each payment method that you intend to offer to your shoppers.

You can check the status of a test payment in your Customer Area, under TransactionsPayments.

When you've completed testing, there are some additional steps you need to complete before you can accept live payments from shoppers. Refer to Getting started with Adyen for more information. 

Change the domain to https://checkoutshopper-live.adyen.com/ when you're ready to accept live payments.

Recurring and subscription payments

If you have a subscription or recurring business model we recommend using our tokenization service.

To tokenize the shopper's payment details:

  1. When you make the payment additionally pass:
    • paymentMethod.storeDetails as true
    • shopperReference: Your unique ID for the shopper. This acts as the container for the shopper's tokenized payment details.

    curl https://checkout-test.adyen.com/v41/payments \
    -H "x-API-key: YOUR_X-API-KEY" \
    -H "content-type: application/json" \
    -d '{
      "amount":{
        "currency":"EUR",
        "value":1000
      },
      "reference":"YOUR_ORDER_NUMBER",
      "paymentMethod":{
        "type":"scheme",
        "encryptedCardNumber":"adyenjs_0_1_18$MT6ppy0FAMVMLH...",
        "encryptedExpiryMonth":"adyenjs_0_1_18$MT6ppy0FAMVMLH...",
        "encryptedExpiryYear":"adyenjs_0_1_18$MT6ppy0FAMVMLH...",
        "encryptedSecurityCode":"adyenjs_0_1_18$MT6ppy0FAMVMLH...",
        "storeDetails":true
      },
      "shopperReference":"YourUniqueIdForTheShopper",
      "returnUrl":"https://your-company.com/checkout/",
      "merchantAccount":"YOUR_MERCHANT_ACCOUNT"
    }'
    # Set your X-API-KEY with the API key from the Customer Area.
    adyen = Adyen::Client.new
    adyen.api_key = "YOUR_X-API-KEY"
    
    response = adyen.checkout.payments({
      :amount => array(
        :currency => "EUR",
        :value => 1000
      ),
      :reference => "YOUR_ORDER_NUMBER",
      :paymentMethod => {
        :type => "scheme",
        :encryptedCardNumber => "adyenjs_0_1_18$MT6ppy0FAMVMLH...",
        :encryptedExpiryMonth => "adyenjs_0_1_18$MT6ppy0FAMVMLH...",
        :encryptedExpiryYear => "adyenjs_0_1_18$MT6ppy0FAMVMLH...",
        :encryptedSecurityCode => "adyenjs_0_1_18$MT6ppy0FAMVMLH...",
        :storeDetails => true
      },
      :shopperReference => "YourUniqueIdForTheShopper"
      :returnUrl => "https =>//your-company.com/checkout/",
      :merchantAccount => "YOUR_MERCHANT_ACCOUNT"
    }) 
    // Set your X-API-KEY with the API key from the Customer Area.
    Config config = new Config();
    config.setApiKey("YOUR_X-API-KEY");
    Client client = new Client(config);
    
    Checkout checkout = new Checkout(client);
    PaymentsRequest paymentsRequest = new PaymentsRequest();
    Amount amount = new Amount();
    amount.setCurrency("USD");
    amount.setValue(1000L);
    paymentsRequest.setReference("YOUR_ORDER_NUMBER");
    paymentsRequest.setAmount(amount);
    paymentsRequest.setPaymentMethod(new HashMap<String, String>());
    paymentsRequest.putPaymentMethodItem("type", "scheme");
    paymentsRequest.putPaymentMethodItem("encryptedCardNumber", "adyenjs_0_1_18$MT6ppy0FAMVMLH...");
    paymentsRequest.putPaymentMethodItem("encryptedExpiryMonth", "adyenjs_0_1_18$MT6ppy0FAMVMLH...");
    paymentsRequest.putPaymentMethodItem("encryptedExpiryYear", "adyenjs_0_1_18$MT6ppy0FAMVMLH...");
    paymentsRequest.putPaymentMethodItem("encryptedSecurityCode", "adyenjs_0_1_18$MT6ppy0FAMVMLH...");
    paymentsRequest.putPaymentMethodItem("storeDetails", "true");
    paymentsRequest.setShopperReference("YourUniqueIdForTheShopper");
    paymentsRequest.setReturnUrl("https://your-company.com/...");
    paymentsRequest.setMerchantAccount("YOUR_MERCHANT_ACCOUNT");
    PaymentsResponse response = checkout.payments(paymentsRequest);
    // Set your X-API-KEY with the API key from the Customer Area.
    $client = new \Adyen\Client();
    $client->setXApiKey("YOUR_X-API-KEY");
    $service = new \Adyen\Service\Checkout($client);
    
    $params = array(
      "amount" => array(
        "currency" => "EUR",
        "value" => 1000
      ),
      "reference" => "YOUR_ORDER_NUMBER",
      "paymentMethod" => array(
        "type" => "scheme",
        "encryptedCardNumber" => "adyenjs_0_1_18$MT6ppy0FAMVMLH...",
        "encryptedExpiryMonth" => "adyenjs_0_1_18$MT6ppy0FAMVMLH...",
        "encryptedExpiryYear" => "adyenjs_0_1_18$MT6ppy0FAMVMLH...",
        "encryptedSecurityCode" => "adyenjs_0_1_18$MT6ppy0FAMVMLH...",
        "storeDetails" => true
      ),
      "shopperReference" => "YourUniqueIdForTheShopper",
      "returnUrl" => "https://your-company.com/checkout/",
      "merchantAccount" => "YOUR_MERCHANT_ACCOUNT"
    );
    $result = $service->payments($params); 
    #Set your X-API-KEY with the API key from the Customer Area.
    adyen = Adyen.Adyen()
    adyen.client.xapikey = 'YOUR X-API-KEY'
    
    result = adyen.checkout.payments({
       'amount': {
          'value': 1000,
          'currency': 'EUR'
       },
       'reference': 'YOUR_ORDER_NUMBER',
       'paymentMethod': {
          'type': 'scheme',
          'encryptedCardNumber': 'adyenjs_0_1_18$MT6ppy0FAMVMLH...',
          'encryptedExpiryMonth': 'adyenjs_0_1_18$MT6ppy0FAMVMLH...',
          'encryptedExpiryYear': 'adyenjs_0_1_18$MT6ppy0FAMVMLH...',
          'encryptedSecurityCode': 'adyenjs_0_1_18$MT6ppy0FAMVMLH...'
       },
       'storeDetails': true,
       'shopperReference': 'YourUniqueIdForTheShopper',
       'returnUrl': 'https://your-company.com/...',
       'merchantAccount': 'YOUR_MERCHANT_ACCOUNT'
    })

    If the payment is successful the response contains:

    • resultCodeAuthorised

    • recurringDetailReference: Token representing the shopper's stored details.

  2. Save the recurringDetailReference. You will use this and your shopperReference to make the recurring payments. For more information, see Making payments with tokens.

Next steps

Set up notifications

Receive confirmation when a payment is authorised or fails.

link

Add payment methods

Learn about payment methods and how to integrate them.

link

Payment modifications

Find out how to cancel, refund, or capture a payment using our API.

link