> ## Documentation Index
> Fetch the complete documentation index at: https://adyen-preview.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Migrate to Checkout API

> Migrate your Classic API integration to Checkout API.

Adyen no longer develops or updates our [Classic API](https://docs.adyen.com/api-explorer/Payment/latest/overview). We recommend that you migrate your integration to use the latest version of [Checkout API](https://docs.adyen.com/api-explorer/Checkout/latest/overview) for the following benefits:

* A single integration to process all payment methods, including cards, bank-based, and alternative payment methods.
* A simpler client-side integration with Drop-in/Components that is only available with the Checkout API.
* Improved 3D Secure 2 authentication for payments. This includes simpler integration and the auto-authorization feature which reduces integration errors and failed payments.
* An integration that adheres to latest security standards, like [JSON Web Encryption (JWE)](https://en.wikipedia.org/wiki/JSON_Web_Encryption) and [JSON Web Signature (JWS)](https://en.wikipedia.org/wiki/JSON_Web_Signature), and offers your shoppers a more secure checkout process.
* A simple, developer-friendly integration experience that handles many of the complexities of processing payments with less code complexity.
* More specific error responses, for more efficient debugging.

When you migrate to Checkout API, changes affect:

* Payment authentication
* Authorization
* Modification requests

The following do not change:

* Reporting
* Reconciliation
* Webhooks
* API authentication keys

## Supported features

The following table shows the features supported in Classic API and Checkout API:

| Feature | Classic API | Checkout API |
| - | - | - |
| Card payments | ![Required](https://docs.adyen.com/user/pages/reuse/image-library/01.icons/required/required.svg) | ![Required](https://docs.adyen.com/user/pages/reuse/image-library/01.icons/required/required.svg) |
| [3D Secure 2](https://adyen-preview.mintlify.site/online-payments/3d-secure) authentication | ![Required](https://docs.adyen.com/user/pages/reuse/image-library/01.icons/required/required.svg) | ![Required](https://docs.adyen.com/user/pages/reuse/image-library/01.icons/required/required.svg) |
| [Drop-in/Components](https://github.com/Adyen#online-payments) for web, mobile, and cross-platform | | ![Required](https://docs.adyen.com/user/pages/reuse/image-library/01.icons/required/required.svg) |
| [Hosted Checkout](https://adyen-preview.mintlify.site/online-payments/build-your-integration/sessions-flow.md) | | ![Required](https://docs.adyen.com/user/pages/reuse/image-library/01.icons/required/required.svg) |
| [Pay by Link](https://adyen-preview.mintlify.site/unified-commerce/pay-by-link) | | ![Required](https://docs.adyen.com/user/pages/reuse/image-library/01.icons/required/required.svg) |
| Donations with [Adyen Giving](https://adyen-preview.mintlify.site/online-payments/donations) | | ![Required](https://docs.adyen.com/user/pages/reuse/image-library/01.icons/required/required.svg) |
| Creating orders that allow for partial payments | | ![Required](https://docs.adyen.com/user/pages/reuse/image-library/01.icons/required/required.svg) |
| Usage [analytics](https://adyen-preview.mintlify.site/online-payments/analytics-and-data-tracking.md) | | ![Required](https://docs.adyen.com/user/pages/reuse/image-library/01.icons/required/required.svg) |

## How to migrate

Follow this guide to migrate to [Checkout API v72](https://adyen-preview.mintlify.site/online-payments/release-notes.md) or later. The migration tasks that you must do depends on your type of Classic API integration.

### Classic API integration type

The following table shows which migration tasks you must do, based on your integration type:

| Integration type | Description | Tasks |
| - | - | - |
| **Server-side only (API only)** | You use Classic API on your payment server, without any client-side SDKs or libraries from Adyen. | Update your [credentials](#update-settings-in-customer-area), [endpoints](#update-your-endpoints), and [request objects](#update-your-request-objects). |
| **Server-side with CSE or JWE** | You use Classic API with [Client-Side Encryption (CSE)](https://adyen-preview.mintlify.site/online-payments/classic-integrations/classic-api-integration/client-side-encryption) or JSON Web Encryption (JWE). | In addition to changes to your payment and webhook servers, [migrate your client-side encryption](#migrate-client-side-encryption). |
| **Server-side with CSE/JWE and features** | You use additional features like [3D Secure authentication](https://adyen-preview.mintlify.site/online-payments/classic-integrations/classic-api-integration/3d-secure-authentication) or [Tokenization](https://adyen-preview.mintlify.site/online-payments/classic-integrations/classic-api-integration/tokenization). | In addition, [make updates for authentication](#make-updates-for-authentication) and [updates for Tokenization](#make-updates-for-tokenization). |
| **Integration with local and alternative payment methods** | You also use local payment methods and wallets. | In addition, [make updates for wallets and local payment methods](#make-updates-for-wallets-and-local-payment-methods). |
| **Integration with a SOAP stack** | You use [SOAP](https://en.wikipedia.org/wiki/SOAP) instead of [REST](https://en.wikipedia.org/wiki/REST). | In addition, migrate from SOAP to REST. |
| **Partner integration** | You use a [technology partner](https://www.adyen.com/partners/network). | Contact your Adyen Account Manager to discuss your migration process. |

During your migration process, you can continue to use your existing Classic API integration to process live payments.

### Approaches to speed up your migration

You can use the following approaches to speed up your migration process:

| Approach | Benefits | Trade-offs |
| - | - | - |
| Use Adyen [API libraries](https://adyen-preview.mintlify.site/development-resources/libraries.md). | Faster server-side development, if you use Java, Node.js, PHP, .NET, Go, or Python. | You must upgrade to the latest version of the library to support new features. |
| Migrate Classic API v68 endpoints to Checkout API v68, then upgrade to the latest version later. | Minimal changes needed. API fields remain mostly the same. Changes only to URLs, authentication, and tokenization behavior. | Migrating to an earlier version of Checkout API can require you to upgrade again, if it we deprecate it. We recommend migrating directly to the [latest version](https://docs.adyen.com/api-explorer/Checkout/latest/overview). |
| Use the [Sessions flow](https://adyen-preview.mintlify.site/online-payments/build-your-integration/sessions-flow.md). | Reduces integration complexity by making one required API request to handle payment, tokenization, and authentication. | You must use Adyen Drop-in/Components. |

## Update settings in Customer Area

In your [Customer Area](https://ca-test.adyen.com/), do the following:

* Make sure that your API credential has the **Checkout webservice** user role.

  1. In your Customer Area, go to **Developers** > **API credentials**.
  2. From the list of users, select the user whose credentials you want to use to make Checkout API requests.
  3. In the **Permissions** section, in the **Roles** panel, under **UNCATEGORIZED**, select **Checkout webservice role**.

* Turn on additional data that you want to get it in your Checkout API responses.

  1. In your Customer Area, go to **Developers** > **Additional data**.
  2. Select the fields that you want to get.

You continue to get the same [reports](https://adyen-preview.mintlify.site/reporting.md) in your Customer Area after you migrate to Checkout API.

## Update your endpoints

The following tables show the base URL and endpoints that you must update from Classic API to Checkout API.

### Base URL

| Environment | Classic | Checkout |
| - | - | - |
| Test | `https://pal-test.adyen.com/pal/servlet/Payment/{VERSION}` | `https://checkout-test.adyen.com/checkout/{VERSION}` |
| Live | `https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/{VERSION}` | `https://{PREFIX}-checkout-live.adyenpayments.com/{VERSION}` |

You can [find your URL prefixes for the live environment](https://adyen-preview.mintlify.site/development-resources/live-endpoints.md) in your live Customer Area:

1. Go to **Developers** > **API URLs**.
2. Select the endpoint that corresponds to the region that the account operates in. For example, if you are located in India, you must use a URL in the India (**IN**) region.

### Endpoints

Change the following endpoints for each corresponding action.

Append each endpoint to the [base URL](#base-url).

| Action | Classic | Checkout |
| - | - | - |
| Get a list of available payment methods. | Not available. | [/paymentMethods](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentMethods) |
| Make a payment. | [/authorise](https://docs.adyen.com/api-explorer/Payment/latest/post/authorise) | [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) |
| Authorize a payment after 3D Secure 2 authentication. | [authorise3d](https://docs.adyen.com/api-explorer/Payment/latest/post/authorise3d) and [/authorise3ds2](https://docs.adyen.com/api-explorer/Payment/latest/post/authorise3ds2) | [/payments/details](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/details) |
| Refund a captured payment with its `pspReference`. | [/refund](https://docs.adyen.com/api-explorer/Payment/latest/post/refund) | [/payments/\{paymentPspReference}/refunds](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/\(paymentPspReference\)/refunds) |
| Cancel an authorization with its `pspReference`. | [/cancel](https://docs.adyen.com/api-explorer/Payment/latest/post/cancel) | [/payments/\{paymentPspReference}/cancels](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/\(paymentPspReference\)/cancels) |
| Cancel an authorization without its `pspReference`. | [/technicalCancel](https://docs.adyen.com/api-explorer/Payment/latest/post/technicalCancel) | [/cancels](https://docs.adyen.com/api-explorer/Checkout/latest/post/cancels) |
| Capture a payment. | [/capture](https://docs.adyen.com/api-explorer/Payment/latest/post/capture) | [/payments/\{paymentPspReference}/captures](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/\(paymentPspReference\)/captures) |
| If you do not know the status of a payment, refund or cancel the payment. | [/cancelOrRefund](https://docs.adyen.com/api-explorer/Payment/latest/post/cancelOrRefund) | [/payments/\{paymentPspReference}/reversals](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/\(paymentPspReference\)/reversals) |
| Update the amount of an authorized payment. Both synchronous and asynchronous flows are supported. | [/adjustAuthorisation](https://docs.adyen.com/api-explorer/Payment/latest/post/adjustAuthorisation) | [/payments/\{paymentPspReference}/amountUpdates](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/\(paymentPspReference\)/amountUpdates) |
| Create a payment session that handles payment, tokenization, and authentication in a single call. | Not available. | [/sessions](https://docs.adyen.com/api-explorer/Checkout/latest/post/sessions) |
| Void a pending refund. | `Recurring/v68/voidPendingRefund` | Not available in Checkout API. |
| Delete stored payment details for a shopper or a specific stored payment method. | `Recurring/v68/disable` | The DELETE [/storedPaymentMethods/\{storedPaymentMethodId}](https://docs.adyen.com/api-explorer/Checkout/latest/delete/storedPaymentMethods/\(storedPaymentMethodId\)) |
| Get a list of stored payment details for a shopper. | `Recurring/v68/listRecurringDetails` | The GET [/storedPaymentMethods](https://docs.adyen.com/api-explorer/Checkout/latest/post/storedPaymentMethods) |
| Save a token for stored payment details. | `/storeToken` | [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) with `storePaymentMethod` set to **true** |
| Create a token for stored payment details. | `/createToken` | POST [/storedPaymentMethods](https://docs.adyen.com/api-explorer/Checkout/latest/post/storedPaymentMethods) |
| Get a token for stored payment details. | `/getToken` | GET [/storedPaymentMethods](https://docs.adyen.com/api-explorer/Checkout/latest/post/storedPaymentMethods) |
| For redirect payment methods, send payment data after the redirect. | Not available. | [/payments/details](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/details) |
| Get the list of brands on a card. | Not available. | [/cardDetails](https://docs.adyen.com/api-explorer/Checkout/latest/post/cardDetails) |
| Make a donation through Adyen Giving. | Not available. | [/donations](https://docs.adyen.com/api-explorer/Checkout/latest/post/donations) |
| Get a list of your active donation campaigns. | Not available. | [/donationCampaigns](https://docs.adyen.com/api-explorer/Checkout/latest/post/donationCampaigns) |
| Create a Pay by Link payment link. | Not available. | [/paymentLinks](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentLinks) |

## Update your request objects

The request objects in Classic API and Checkout API are different. You must update the parameters for each object.

### Data format

The required data format for Checkout API is JSON. If your Classic API integration uses XML data, you must change your request objects to JSON instead.

The following examples show the differences in the request objects between Classic API and Checkout API, in JSON format.

\*\*

### Make a payment with encrypted card details

If you are not [PCI-compliant](https://adyen-preview.mintlify.site/get-started-with-adyen/adyen-glossary.md#pci-compliance), use one of [Adyen's client-side solutions](https://adyen-preview.mintlify.site/payment-methods/cards/custom-card-integration#page-introduction) to encrypt card details.

After encrypting card details, make a payment request with the encrypted card details.

#### Parameters

| Classic API | Checkout API |
| - | - |
| `amount` | `amount` |
| `additionalData.card.encrypted.json` | `paymentMethod` |
| Not applicable. | `paymentMethod.type` |
| Not applicable. | `paymentMethod.encryptedCardNumber` |
| Not applicable. | `paymentMethod.encryptedExpiryMonth` |
| Not applicable. | `paymentMethod.encryptedExpiryYear` |
| Not applicable. | `paymentMethod.encryptedSecurityCode` |
| Not applicable. | `paymentMethod.holderName` |
| `reference` | `reference` |
| `merchantAccount` | `merchantAccount` |
| Not applicable. | `returnUrl` |

#### Classic API

To make a basic card payment with encrypted card details, include the following in the [/authorise](https://docs.adyen.com/api-explorer/Payment/latest/post/authorise) request:

```bash theme={null}
curl https://pal-test.adyen.com/pal/servlet/Payment/v46/authorise \
-H 'x-api-key: ADYEN_API_KEY' \
-H 'content-type: application/json' \
-d '{
   "amount": {
      "currency": "EUR",
      "value": 1500
   },
   "merchantAccount": "ADYEN_MERCHANT_ACCOUNT",
   "additionalData":{
      "card.encrypted.json":"adyenjs_0_1_4p1$..."
   },
   "reference": "YOUR_REFERENCE"
}'
```

#### Checkout API

To make a basic card payment with encrypted card details, include the following in the [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request:

```bash theme={null}
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": 1500
   },
   "merchantAccount": "ADYEN_MERCHANT_ACCOUNT",
   "paymentMethod": {
      "type": "scheme",
      "encryptedCardNumber": "test_4111111111111111",
      "encryptedExpiryMonth": "test_03",
      "encryptedExpiryYear": "test_2030",
      "encryptedSecurityCode": "test_737",
      "holderName": "S. Hopper"
   },
   "reference": "YOUR_REFERENCE",
   "returnUrl": "https://your-company.example.com/checkout?shopperOrder=12xy.."
}'
```

\*\*

### Make a payment with unencrypted card details

You must be PCI compliant to use unencrypted card details.

Make a request for a card payment with unencrypted card details.

#### Parameters

| Classic API | Checkout API |
| - | - |
| `amount` | `amount` |
| Not applicable. | `paymentMethod.type` |
| `card.number` | `paymentMethod.number` |
| `card.expiryMonth` | `paymentMethod.expiryMonth` |
| `card.expiryYear` | `paymentMethod.expiryYear` |
| `cvc` | `paymentMethod.cvc` |
| `holderName` | `paymentMethod.holderName` |
| `reference` | `reference` |
| `merchantAccount` | `merchantAccount` |
| Not applicable. | `returnUrl` |

#### Classic API

To make a basic card payment, include the following in the [/authorise](https://docs.adyen.com/api-explorer/Payment/latest/post/authorise) request:

```bash theme={null}
curl https://pal-test.adyen.com/pal/servlet/Payment/v46/authorise \
-H 'x-api-key: ADYEN_API_KEY' \
-H 'content-type: application/json' \
-d '{
   "amount": {
      "currency": "EUR",
      "value": 1500
   },
   "card": {
      "number": "4111111111111111",
      "expiryMonth": "10",
      "expiryYear": "2030",
      "cvc": "737",
      "holderName": "S. Hopper"
   },
   "merchantAccount": "ADYEN_MERCHANT_ACCOUNT",
   "reference": "YOUR_REFERENCE"
}'
```

#### Checkout API

To make a card payment, include the following in the [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request:

```bash theme={null}
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": 1500
    },
    "paymentMethod": {
      "type": "scheme",
      "number": "4111111111111111",
      "expiryMonth": "10",
      "expiryYear": "2030",
      "cvc": "737",
      "holderName": "S. Hopper"
    },
    "merchantAccount": "ADYEN_MERCHANT_ACCOUNT",
    "reference": "YOUR_REFERENCE",
    "returnUrl": "https://your-company.example.com/..."
}'
```

\*\*

### Store the shopper's card details

Make a request to [store the shopper's card details](https://adyen-preview.mintlify.site/online-payments/tokenization).

#### Parameters

| Classic API | Checkout API |
| - | - |
| `amount` | `amount` |
| `additionalData.card.encrypted.json` | `paymentMethod` |
| Not applicable. | `paymentMethod.type` |
| Not applicable. | `paymentMethod.encryptedCardNumber` |
| Not applicable. | `paymentMethod.encryptedExpiryMonth` |
| Not applicable. | `paymentMethod.encryptedExpiryYear` |
| Not applicable. | `paymentMethod.encryptedSecurityCode` |
| Not applicable. | `paymentMethod.holderName` |
| `reference` | `reference` |
| `merchantAccount` | `merchantAccount` |
| `shopperEmail` | `shopperEmail` |
| `shopperIP` | `shopperIP` |
| `shopperReference` | `shopperReference` |
| `recurring` | Not applicable. |
| `recurringProcessingModel` | `recurringProcessingModel` |
| Not applicable. | `storePaymentMethod` |
| Not applicable. | `returnUrl` |

#### Classic API

To store the shopper's card details (in this example, for one-off payments), include the following in the [/authorise](https://docs.adyen.com/api-explorer/Payment/latest/post/authorise) request:

```bash theme={null}
curl https://pal-test.adyen.com/pal/servlet/Payment/v46/authorise \
-H 'x-api-key: ADYEN_API_KEY' \
-H 'content-type: application/json' \
-d '{
   "amount": {
      "value": 0,
      "currency": "EUR"
   },
	 "additionalData": {
      "card.encrypted.json": "adyenjs_0_1_4p1$..."
   },
   "reference": "YOUR_REFERENCE",
   "merchantAccount": "TestMerchant",
   "shopperEmail": "s.hopper@test.com",
   "shopperIP": "61.294.12.12",
   "shopperReference": "YOUR_SHOPPER_REFERENCE",
   "recurring": {
      "contract": ["RECURRING", "ONECLICK"]
   },
   "recurringProcessingModel": "Subscription"
}'
```

#### Checkout API

To store the shopper's card details (in this example, for one-off payments), include the following in the [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request:

```bash curl theme={null}
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": "EUR"
   },
   "paymentMethod": {
      "type": "scheme",
      "encryptedCardNumber": "test_4111111111111111",
      "encryptedExpiryMonth": "test_03",
      "encryptedExpiryYear": "test_2030",
      "encryptedSecurityCode": "test_737",
      "holderName": "S. Hopper"
   },
   "reference": "YOUR_REFERENCE",
   "shopperInteraction": "Ecommerce",
   "recurringProcessingModel": "CardOnFile",
   "storePaymentMethod": "true",
   "merchantAccount": "ADYEN_MERCHANT_ACCOUNT",
   "shopperReference": "YOUR_SHOPPER_REFERENCE",
   "returnUrl": "https://your-company.example.com/..."
}'
```

```java Java theme={null}
// Adyen Java API Library v32.0.0
import com.adyen.Client;
import com.adyen.enums.Environment;
import com.adyen.model.checkout.*;
import java.time.OffsetDateTime;
import java.util.*;
import com.adyen.model.RequestOptions;
import com.adyen.service.checkout.*;

// For the LIVE environment, also include your liveEndpointUrlPrefix.
Client client = new Client("ADYEN_API_KEY", Environment.TEST);

// Create the request object(s)
Amount amount = new Amount()
  .currency("EUR")
  .value(0L);

CardDetails cardDetails = new CardDetails()
  .encryptedCardNumber("test_4111111111111111")
  .holderName("S. Hopper")
  .encryptedSecurityCode("test_737")
  .encryptedExpiryYear("test_2030")
  .encryptedExpiryMonth("test_03")
  .type(CardDetails.TypeEnum.SCHEME);

PaymentRequest paymentRequest = new PaymentRequest()
  .reference("YOUR_REFERENCE")
  .amount(amount)
  .storePaymentMethod(true)
  .merchantAccount("ADYEN_MERCHANT_ACCOUNT")
  .recurringProcessingModel(PaymentRequest.RecurringProcessingModelEnum.CARDONFILE)
  .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 theme={null}
<?php
// Adyen PHP API Library v23.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, also include your liveEndpointUrlPrefix.
$client->setEnvironment(Environment::TEST);


// Create the request object(s)
$amount = new Amount();
$amount
  ->setCurrency("EUR")
  ->setValue(0);

$checkoutPaymentMethod = new CheckoutPaymentMethod();
$checkoutPaymentMethod
  ->setEncryptedCardNumber("test_4111111111111111")
  ->setHolderName("S. Hopper")
  ->setEncryptedSecurityCode("test_737")
  ->setEncryptedExpiryYear("test_2030")
  ->setEncryptedExpiryMonth("test_03")
  ->setType("scheme");

$paymentRequest = new PaymentRequest();
$paymentRequest
  ->setReference("YOUR_REFERENCE")
  ->setAmount($amount)
  ->setStorePaymentMethod(true)
  ->setMerchantAccount("ADYEN_MERCHANT_ACCOUNT")
  ->setRecurringProcessingModel("CardOnFile")
  ->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);
```

```cs C# theme={null}
// Adyen .net API Library v26.0.0
using Adyen;
using Environment = Adyen.Model.Environment;
using Adyen.Model;
using Adyen.Model.Checkout;
using Adyen.Service.Checkout;

// For the LIVE environment, also include your liveEndpointUrlPrefix.
var config = new Config()
{
    XApiKey = "ADYEN_API_KEY",
    Environment = Environment.Test
};
var client = new Client(config);

// Create the request object(s)
Amount amount = new Amount
{
  Currency = "EUR",
  Value = 0
};

CardDetails cardDetails = new CardDetails
{
  EncryptedCardNumber = "test_4111111111111111",
  HolderName = "S. Hopper",
  EncryptedSecurityCode = "test_737",
  EncryptedExpiryYear = "test_2030",
  EncryptedExpiryMonth = "test_03",
  Type = CardDetails.TypeEnum.Scheme
};

PaymentRequest paymentRequest = new PaymentRequest
{
  Reference = "YOUR_REFERENCE",
  Amount = amount,
  StorePaymentMethod = true,
  MerchantAccount = "ADYEN_MERCHANT_ACCOUNT",
  RecurringProcessingModel = PaymentRequest.RecurringProcessingModelEnum.CardOnFile,
  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"});
```

```js NodeJS (JavaScript) theme={null}
// Adyen Node API Library v22.1.0
// Require the parts of the module you want to use
const { Client, CheckoutAPI } = require('@adyen/api-library');

// For the LIVE environment, also include your liveEndpointUrlPrefix.
const client = new Client({ apiKey: "ADYEN_API_KEY", environment: "TEST" });

// Create the request object(s)
const paymentRequest = {
  amount: {
    value: 0,
    currency: "EUR"
  },
  paymentMethod: {
    type: "scheme",
    encryptedCardNumber: "test_4111111111111111",
    encryptedExpiryMonth: "test_03",
    encryptedExpiryYear: "test_2030",
    encryptedSecurityCode: "test_737",
    holderName: "S. Hopper"
  },
  reference: "YOUR_REFERENCE",
  shopperInteraction: "Ecommerce",
  recurringProcessingModel: "CardOnFile",
  storePaymentMethod: "true",
  merchantAccount: "ADYEN_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 theme={null}
// Adyen Go API Library v16.1.0
import (
  "context"
  "github.com/adyen/adyen-go-api-library/v9/src/common"
  "github.com/adyen/adyen-go-api-library/v9/src/adyen"
  "github.com/adyen/adyen-go-api-library/v9/src/checkout"
)
// For the LIVE environment, also include your liveEndpointUrlPrefix.
client := adyen.NewClient(&common.Config{
  ApiKey:      "ADYEN_API_KEY",
  Environment: common.TestEnv,
})

// Create the request object(s)
amount := checkout.Amount{
  Currency: "EUR",
  Value: 0,
}

cardDetails := checkout.CardDetails{
  EncryptedCardNumber: common.PtrString("test_4111111111111111"),
  HolderName: common.PtrString("S. Hopper"),
  EncryptedSecurityCode: common.PtrString("test_737"),
  EncryptedExpiryYear: common.PtrString("test_2030"),
  EncryptedExpiryMonth: common.PtrString("test_03"),
  Type: common.PtrString("scheme"),
}

paymentRequest := checkout.PaymentRequest{
  Reference: "YOUR_REFERENCE",
  Amount: amount,
  StorePaymentMethod: common.PtrBool(true),
  MerchantAccount: "ADYEN_MERCHANT_ACCOUNT",
  RecurringProcessingModel: common.PtrString("CardOnFile"),
  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)
```

```py Python theme={null}
# Adyen Python API Library v13.2.0
import Adyen

adyen = Adyen.Adyen()
adyen.client.xapikey = "ADYEN_API_KEY"
# For the LIVE environment, also include your liveEndpointUrlPrefix.
adyen.client.platform = "test" # The environment to use library in.

# Create the request object(s)
json_request = {
  "amount": {
    "value": 0,
    "currency": "EUR"
  },
  "paymentMethod": {
    "type": "scheme",
    "encryptedCardNumber": "test_4111111111111111",
    "encryptedExpiryMonth": "test_03",
    "encryptedExpiryYear": "test_2030",
    "encryptedSecurityCode": "test_737",
    "holderName": "S. Hopper"
  },
  "reference": "YOUR_REFERENCE",
  "shopperInteraction": "Ecommerce",
  "recurringProcessingModel": "CardOnFile",
  "storePaymentMethod": "True",
  "merchantAccount": "ADYEN_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")
```

```rb Ruby theme={null}
# Adyen Ruby API Library v10.1.0
require "adyen-ruby-api-library"

adyen = Adyen::Client.new
adyen.api_key = 'ADYEN_API_KEY'
# For the LIVE environment, also include your liveEndpointUrlPrefix.
adyen.env = :test # Set to "live" for live environment

# Create the request object(s)
request_body = {
  :amount => {
    :value => 0,
    :currency => 'EUR'
  },
  :paymentMethod => {
    :type => 'scheme',
    :encryptedCardNumber => 'test_4111111111111111',
    :encryptedExpiryMonth => 'test_03',
    :encryptedExpiryYear => 'test_2030',
    :encryptedSecurityCode => 'test_737',
    :holderName => 'S. Hopper'
  },
  :reference => 'YOUR_REFERENCE',
  :shopperInteraction => 'Ecommerce',
  :recurringProcessingModel => 'CardOnFile',
  :storePaymentMethod => 'true',
  :merchantAccount => 'ADYEN_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' })
```

```ts NodeJS (TypeScript) theme={null}
// Adyen Node API Library v22.1.0
// Require the parts of the module you want to use
import { Client, CheckoutAPI, Types } from "@adyen/api-library";

// For the LIVE environment, also include your liveEndpointUrlPrefix.
const client = new Client({ apiKey: "ADYEN_API_KEY", environment: "TEST" });

// Create the request object(s)
const amount: Types.checkout.Amount = {
  currency: "EUR",
  value: 0
};

const cardDetails: Types.checkout.CardDetails = {
  encryptedCardNumber: "test_4111111111111111",
  holderName: "S. Hopper",
  encryptedSecurityCode: "test_737",
  encryptedExpiryYear: "test_2030",
  encryptedExpiryMonth: "test_03",
  type: Types.checkout.CardDetails.TypeEnum.Scheme
};

const paymentRequest: Types.checkout.PaymentRequest = {
  reference: "YOUR_REFERENCE",
  amount: amount,
  storePaymentMethod: true,
  merchantAccount: "ADYEN_MERCHANT_ACCOUNT",
  recurringProcessingModel: Types.checkout.PaymentRequest.RecurringProcessingModelEnum.CardOnFile,
  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" });
```

\*\*

### One-off payment with stored card details

Make a request for a one-off payment with stored card details.

#### Parameters

| Classic API | Checkout API |
| - | - |
| `amount` | `amount` |
| `additionalData.card.encrypted.json` | `paymentMethod.type` |
| Not applicable. | `paymentMethod.encryptedSecurityCode` |
| `selectedRecurringDetailReference` | `paymentMethod.storedPaymentMethodId` |
| `reference` | `reference` |
| `merchantAccount` | `merchantAccount` |
| `shopperEmail` | `shopperEmail` |
| `shopperIP` | `shopperIP` |
| `shopperInteraction` | `shopperInteraction` |
| `recurringProcessingModel` | `recurringProcessingModel` |
| `shopperReference` | `shopperReference` |
| `recurring.contract` | Not applicable. |
| Not applicable. | `returnUrl` |

#### Classic API

To make a one-off payment with stored card details, include the following in the [/authorise](https://docs.adyen.com/api-explorer/Payment/latest/post/authorise) request:

```bash theme={null}
curl https://pal-test.adyen.com/pal/servlet/Payment/v46/authorise \
-H 'x-api-key: ADYEN_API_KEY' \
-H 'content-type: application/json' \
-d '{
   "amount":{
      "value": 2000,
      "currency": "EUR"
   },
   "additionalData": {
      "card.encrypted.json":"adyenjs_0_1_18$*******"
   },
   "selectedRecurringDetailReference": "LATEST",
   "reference": "YOUR_REFERENCE",
   "merchantAccount": "ADYEN_MERCHANT_ACCOUNT",
   "shopperEmail": "s.hopper@test.com",
   "shopperIP": "61.294.12.12",
   "shopperInteraction": "ContAuth",
   "recurringProcessingModel": "CardOnFile",
   "shopperReference": "YOUR_SHOPPER_REFERENCE",
   "recurring":{
      "contract": "ONECLICK"
   }
}'
```

#### Checkout API

To make a one-off payment with stored card details, include the following in the [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request:

```bash theme={null}
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": "EUR"
   },
   "paymentMethod": {
      "type": "scheme",
      "encryptedSecurityCode": "eyJldZvpOuJSU0EtT0FFUC0yNTYiL...",
      "storedPaymentMethodId": "M5N7TQ4TG5PFWR50"
   },
   "reference": "YOUR_REFERENCE",
   "merchantAccount": "ADYEN_MERCHANT_ACCOUNT",
   "shopperEmail": "s.hopper@test.com",
   "shopperIP": "61.294.12.12",
   "shopperInteraction": "ContAuth",
   "recurringProcessingModel": "CardOnFile",
   "shopperReference": "YOUR_SHOPPER_REFERENCE",
   "returnUrl": "https://your-company.example.com/..."
}'
```

\*\*

### Subscription payment with stored card details

Make a request for a subscription payment with stored card details.

#### Parameters

| Classic API | Checkout API |
| - | - |
| `amount` | `amount` |
| Not applicable. | `paymentMethod.type` |
| Not applicable. | `paymentMethod.encryptedSecurityCode` |
| `selectedRecurringDetailReference` | `paymentMethod.storedPaymentMethodId` |
| `reference` | `reference` |
| `merchantAccount` | `merchantAccount` |
| `shopperEmail` | `shopperEmail` |
| `shopperIP` | `shopperIP` |
| `shopperReference` | `shopperReference` |
| `shopperInteraction` | `shopperInteraction` |
| `recurringProcessingModel` | `recurringProcessingModel` |
| `recurring` | Not applicable. |
| Not applicable. | `storePaymentMethod` |
| Not applicable. | `returnUrl` |

#### Classic API

To make a subscription payment with stored card details, include the following in the [/authorise](https://docs.adyen.com/api-explorer/Payment/latest/post/authorise) request:

```bash theme={null}
curl https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise \
-H 'x-api-key: ADYEN_API_KEY' \
-H 'content-type: application/json' \
-d '{
   "amount": {
      "currency": "EUR",
      "value": 1500
   },
   "selectedRecurringDetailReference": "LATEST",
   "reference": "YOUR_REFERENCE",
   "merchantAccount": "ADYEN_MERCHANT_ACCOUNT",
   "shopperEmail": "s.hopper@test.com",
   "shopperIP": "61.294.12.12",
   "shopperReference": "YOUR_SHOPPER_REFERENCE",
   "shopperInteraction": "ContAuth",
   "recurringProcessingModel": "Subscription",
   "recurring": {
      "contract": "RECURRING"
   }
}'
```

#### Checkout API

To make a subscription payment with stored card details, include the following in the [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request:

```bash theme={null}
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": 1500
   },
   "paymentMethod": {
      "type": "scheme",
      "encryptedSecurityCode": "eyJldZvpOuJSU0EtT0FFUC0yNTYiL...",
      "storedPaymentMethodId": "M5N7TQ4TG5PFWR50"
   },
   "reference": "YOUR_REFERENCE",
   "merchantAccount": "ADYEN_MERCHANT_ACCOUNT",
   "shopperEmail": "s.hopper@test.com",
   "shopperIP": "61.294.12.12",
   "shopperReference": "YOUR_SHOPPER_REFERENCE",
   "shopperInteraction": "ContAuth",
   "recurringProcessingModel": "Subscription",
   "storePaymentMethod": "true",
   "returnUrl": "https://your-company.example.com/..."
}'
```

\*\*

### Card payment with native 3D Secure 2 authentication

Make a request for a payment with native 3D Secure 2 authentication. Use our [native 3D Secure 2 Component](https://docs.adyen.com/online-payments/3d-secure/native-3ds2/web-component/) to handle 3D Secure 2 authentication.

#### Parameters

| Classic API | Checkout API |
| - | - |
| `amount` | `amount` |
| `reference` | `reference` |
| `merchantAccount` | `merchantAccount` |
| `additionalData.card.encrypted.json` | `paymentMethod.type` |
| Not applicable | `paymentMethod.encryptedCardNumber` |
| Not applicable. | `paymentMethod.encryptedExpiryMonth` |
| Not applicable. | `paymentMethod.encryptedExpiryYear` |
| Not applicable. | `paymentMethod.encryptedSecurityCode` |
| Not applicable. | `paymentMethod.holderName` |
| `threeDS2RequestData.mobilePhone` | `threeDS2RequestData.mobilePhone` |
| `threeDS2RequestData.deviceChannel` | `channel` |
| `threeDS2RequestData.notificationURL` | Not applicable. |
| `browserInfo` | `browserInfo` |
| `shopperIP` | `shopperIP` |
| `shopperReference` | `shopperReference` |
| Not applicable. | `billingAddress` |
| `shopperEmail` | `shopperEmail` |
| Not applicable. | `origin` |
| Not applicable. | `returnUrl` |

#### Classic API

To make a payment for native 3D Secure 2 authentication, include the following in the [/authorise](https://docs.adyen.com/api-explorer/Payment/latest/post/authorise) request:

```bash theme={null}
curl https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise \
-H 'x-api-key: ADYEN_API_KEY' \
-H 'content-type: application/json' \
-d '{
   "amount": {
      "currency": "EUR",
      "value": 1500
   },
   "reference": "YOUR_REFERENCE",
   "merchantAccount": "ADYEN_MERCHANT_ACCOUNT",
   "additionalData": {
      "card.encrypted.json": "adyenjs_0_1_4p1$..."
   },
   "threeDS2RequestData": {
      "mobilePhone": {
         "cc": "1",
         "subscriber": "5555555555"
      },
      "deviceChannel": "browser",
      "notificationURL": "https:\/\/www.example.com\/YOUR_3DS_NOTIFICATION_URL",
   },
   "browserInfo": {
      "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
      "acceptHeader": "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8",
      "language": "nl-NL",
      "colorDepth": 24,
      "screenHeight": 723,
      "screenWidth": 1536,
      "timeZoneOffset": 0,
      "javaEnabled": false
   },
   "shopperIP": "192.0.2.1",
   "shopperReference": "YOUR_SHOPPER_REFERENCE"
}'
```

#### Checkout API

To make a payment for native 3D Secure 2 authentication, include the following in the [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request:

```bash curl theme={null}
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": 1500
   },
   "reference": "YOUR_REFERENCE",
   "merchantAccount": "ADYEN_MERCHANT_ACCOUNT",
   "paymentMethod": {
      "type": "scheme",
      "encryptedCardNumber": "eyJ0aHJlZURTTWV0aG9kTm90aWZpY...",
      "encryptedExpiryMonth": "eyJhbGciOiTWV0EtT0FFUC0yNTYiL...",
      "encryptedExpiryYear": "eyJhzKliOiJMN0EtT0FFUC0yNTYiL...",
      "encryptedSecurityCode": "eyJldZvpOuJSU0EtT0FFUC0yNTYiL...",
      "holderName": "S. Hopper"
   },
   "authenticationData": {
      "threeDSRequestData": {
    	   "nativeThreeDS": "preferred"
      }
   },
   "threeDS2RequestData": {
     "mobilePhone": {
         "cc": "1",
         "subscriber": "5555555555"
      }
   },
   "channel": "web",
   "browserInfo": {
      "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
      "acceptHeader": "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8",
      "language": "nl-NL",
      "colorDepth": 24,
      "screenHeight": 723,
      "screenWidth": 1536,
      "timeZoneOffset": 0,
      "javaEnabled": true
   },
   "shopperIP": "192.0.2.1",
   "shopperReference": "YOUR_SHOPPER_REFERENCE",
   "billingAddress": {
       "street": "Infinite Loop",
       "houseNumberOrName": "1",
       "postalCode": "1011DJ",
       "city": "Amsterdam",
       "country": "NL"
  },
   "shopperEmail": "s.hopper@example.com",
   "origin": "https://your-company.example.com",
   "returnUrl": "https://your-company.example.com/checkout?shopperOrder=12xy.."
}'
```

```java Java theme={null}
// 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)
ThreeDSRequestData threeDSRequestData = new ThreeDSRequestData()
  .nativeThreeDS(ThreeDSRequestData.NativeThreeDSEnum.PREFERRED);

Phone phone = new Phone()
  .cc("1")
  .subscriber("5555555555");

AuthenticationData authenticationData = new AuthenticationData()
  .threeDSRequestData(threeDSRequestData);

Amount amount = new Amount()
  .currency("EUR")
  .value(1500L);

ThreeDS2RequestFields threeDS2RequestFields = new ThreeDS2RequestFields()
  .mobilePhone(phone);

CardDetails cardDetails = new CardDetails()
  .encryptedCardNumber("eyJ0aHJlZURTTWV0aG9kTm90aWZpY...")
  .holderName("S. Hopper")
  .encryptedSecurityCode("eyJldZvpOuJSU0EtT0FFUC0yNTYiL...")
  .encryptedExpiryYear("eyJhzKliOiJMN0EtT0FFUC0yNTYiL...")
  .encryptedExpiryMonth("eyJhbGciOiTWV0EtT0FFUC0yNTYiL...")
  .type(CardDetails.TypeEnum.SCHEME);

BillingAddress billingAddress = new BillingAddress()
  .country("NL")
  .city("Amsterdam")
  .street("Infinite Loop")
  .houseNumberOrName("1")
  .postalCode("1011DJ");

BrowserInfo browserInfo = new BrowserInfo()
  .acceptHeader("text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8")
  .screenWidth(1536)
  .javaEnabled(true)
  .screenHeight(723)
  .timeZoneOffset(0)
  .userAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36")
  .language("nl-NL")
  .colorDepth(24);

PaymentRequest paymentRequest = new PaymentRequest()
  .authenticationData(authenticationData)
  .amount(amount)
  .origin("https://your-company.example.com")
  .channel(PaymentRequest.ChannelEnum.WEB)
  .shopperIP("192.0.2.1")
  .shopperEmail("s.hopper@example.com")
  .reference("YOUR_REFERENCE")
  .merchantAccount("ADYEN_MERCHANT_ACCOUNT")
  .threeDS2RequestData(threeDS2RequestFields)
  .paymentMethod(new CheckoutPaymentMethod(cardDetails))
  .billingAddress(billingAddress)
  .returnUrl("https://your-company.example.com/checkout?shopperOrder=12xy..")
  .browserInfo(browserInfo)
  .shopperReference("YOUR_SHOPPER_REFERENCE");

// Send the request
PaymentsApi service = new PaymentsApi(client);
PaymentResponse response = service.payments(paymentRequest, new RequestOptions().idempotencyKey("UUID"));
```

```php PHP theme={null}
<?php
// Adyen PHP API Library v28.2.0
use Adyen\Client;
use Adyen\Environment;
use Adyen\Model\Checkout\ThreeDSRequestData;
use Adyen\Model\Checkout\Phone;
use Adyen\Model\Checkout\AuthenticationData;
use Adyen\Model\Checkout\Amount;
use Adyen\Model\Checkout\ThreeDS2RequestFields;
use Adyen\Model\Checkout\CheckoutPaymentMethod;
use Adyen\Model\Checkout\BillingAddress;
use Adyen\Model\Checkout\BrowserInfo;
use Adyen\Model\Checkout\PaymentRequest;
use Adyen\Service\Checkout\PaymentsApi;

$client = new Client();
$client->setXApiKey("ADYEN_API_KEY");
// For the LIVE environment, also include your liveEndpointUrlPrefix.
$client->setEnvironment(Environment::TEST);


// Create the request object(s)
$threeDSRequestData = new ThreeDSRequestData();
$threeDSRequestData
  ->setNativeThreeDS("preferred");

$phone = new Phone();
$phone
  ->setCc("1")
  ->setSubscriber("5555555555");

$authenticationData = new AuthenticationData();
$authenticationData
  ->setThreeDSRequestData($threeDSRequestData);

$amount = new Amount();
$amount
  ->setCurrency("EUR")
  ->setValue(1500);

$threeDS2RequestFields = new ThreeDS2RequestFields();
$threeDS2RequestFields
  ->setMobilePhone($phone);

$checkoutPaymentMethod = new CheckoutPaymentMethod();
$checkoutPaymentMethod
  ->setEncryptedCardNumber("eyJ0aHJlZURTTWV0aG9kTm90aWZpY...")
  ->setHolderName("S. Hopper")
  ->setEncryptedSecurityCode("eyJldZvpOuJSU0EtT0FFUC0yNTYiL...")
  ->setEncryptedExpiryYear("eyJhzKliOiJMN0EtT0FFUC0yNTYiL...")
  ->setEncryptedExpiryMonth("eyJhbGciOiTWV0EtT0FFUC0yNTYiL...")
  ->setType("scheme");

$billingAddress = new BillingAddress();
$billingAddress
  ->setCountry("NL")
  ->setCity("Amsterdam")
  ->setStreet("Infinite Loop")
  ->setHouseNumberOrName("1")
  ->setPostalCode("1011DJ");

$browserInfo = new BrowserInfo();
$browserInfo
  ->setAcceptHeader("text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8")
  ->setScreenWidth(1536)
  ->setJavaEnabled(true)
  ->setScreenHeight(723)
  ->setTimeZoneOffset(0)
  ->setUserAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36")
  ->setLanguage("nl-NL")
  ->setColorDepth(24);

$paymentRequest = new PaymentRequest();
$paymentRequest
  ->setAuthenticationData($authenticationData)
  ->setAmount($amount)
  ->setOrigin("https://your-company.example.com")
  ->setChannel("web")
  ->setShopperIP("192.0.2.1")
  ->setShopperEmail("s.hopper@example.com")
  ->setReference("YOUR_REFERENCE")
  ->setMerchantAccount("ADYEN_MERCHANT_ACCOUNT")
  ->setThreeDS2RequestData($threeDS2RequestFields)
  ->setPaymentMethod($checkoutPaymentMethod)
  ->setBillingAddress($billingAddress)
  ->setReturnUrl("https://your-company.example.com/checkout?shopperOrder=12xy..")
  ->setBrowserInfo($browserInfo)
  ->setShopperReference("YOUR_SHOPPER_REFERENCE");

$requestOptions['idempotencyKey'] = 'UUID';

// Send the request
$service = new PaymentsApi($client);
$response = $service->payments($paymentRequest, $requestOptions);
```

```cs C# theme={null}
// 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)
ThreeDSRequestData threeDSRequestData = new ThreeDSRequestData
{
  NativeThreeDS = ThreeDSRequestData.NativeThreeDSEnum.Preferred
};

Phone phone = new Phone
{
  Cc = "1",
  Subscriber = "5555555555"
};

AuthenticationData authenticationData = new AuthenticationData
{
  ThreeDSRequestData = threeDSRequestData
};

Amount amount = new Amount
{
  Currency = "EUR",
  Value = 1500
};

ThreeDS2RequestFields threeDS2RequestFields = new ThreeDS2RequestFields
{
  MobilePhone = phone
};

CardDetails cardDetails = new CardDetails
{
  EncryptedCardNumber = "eyJ0aHJlZURTTWV0aG9kTm90aWZpY...",
  HolderName = "S. Hopper",
  EncryptedSecurityCode = "eyJldZvpOuJSU0EtT0FFUC0yNTYiL...",
  EncryptedExpiryYear = "eyJhzKliOiJMN0EtT0FFUC0yNTYiL...",
  EncryptedExpiryMonth = "eyJhbGciOiTWV0EtT0FFUC0yNTYiL...",
  Type = CardDetails.TypeEnum.Scheme
};

BillingAddress billingAddress = new BillingAddress
{
  Country = "NL",
  City = "Amsterdam",
  Street = "Infinite Loop",
  HouseNumberOrName = "1",
  PostalCode = "1011DJ"
};

BrowserInfo browserInfo = new BrowserInfo
{
  AcceptHeader = "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
  ScreenWidth = 1536,
  JavaEnabled = true,
  ScreenHeight = 723,
  TimeZoneOffset = 0,
  UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
  Language = "nl-NL",
  ColorDepth = 24
};

PaymentRequest paymentRequest = new PaymentRequest
{
  AuthenticationData = authenticationData,
  Amount = amount,
  Origin = "https://your-company.example.com",
  Channel = PaymentRequest.ChannelEnum.Web,
  ShopperIP = "192.0.2.1",
  ShopperEmail = "s.hopper@example.com",
  Reference = "YOUR_REFERENCE",
  MerchantAccount = "ADYEN_MERCHANT_ACCOUNT",
  ThreeDS2RequestData = threeDS2RequestFields,
  PaymentMethod = new CheckoutPaymentMethod(cardDetails),
  BillingAddress = billingAddress,
  ReturnUrl = "https://your-company.example.com/checkout?shopperOrder=12xy..",
  BrowserInfo = browserInfo,
  ShopperReference = "YOUR_SHOPPER_REFERENCE"
};

// Send the request
var service = new PaymentsService(client);
var response = service.Payments(paymentRequest, requestOptions: new RequestOptions { IdempotencyKey = "UUID"});
```

```js NodeJS (JavaScript) theme={null}
// 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: {
    currency: "EUR",
    value: 1500
  },
  reference: "YOUR_REFERENCE",
  merchantAccount: "ADYEN_MERCHANT_ACCOUNT",
  paymentMethod: {
    type: "scheme",
    encryptedCardNumber: "eyJ0aHJlZURTTWV0aG9kTm90aWZpY...",
    encryptedExpiryMonth: "eyJhbGciOiTWV0EtT0FFUC0yNTYiL...",
    encryptedExpiryYear: "eyJhzKliOiJMN0EtT0FFUC0yNTYiL...",
    encryptedSecurityCode: "eyJldZvpOuJSU0EtT0FFUC0yNTYiL...",
    holderName: "S. Hopper"
  },
  authenticationData: {
    threeDSRequestData: {
      nativeThreeDS: "preferred"
    }
  },
  threeDS2RequestData: {
    mobilePhone: {
      cc: "1",
      subscriber: "5555555555"
    }
  },
  channel: "web",
  browserInfo: {
    userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
    acceptHeader: "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
    language: "nl-NL",
    colorDepth: 24,
    screenHeight: 723,
    screenWidth: 1536,
    timeZoneOffset: 0,
    javaEnabled: true
  },
  shopperIP: "192.0.2.1",
  shopperReference: "YOUR_SHOPPER_REFERENCE",
  billingAddress: {
    street: "Infinite Loop",
    houseNumberOrName: "1",
    postalCode: "1011DJ",
    city: "Amsterdam",
    country: "NL"
  },
  shopperEmail: "s.hopper@example.com",
  origin: "https://your-company.example.com",
  returnUrl: "https://your-company.example.com/checkout?shopperOrder=12xy.."
}

// Send the request
const checkoutAPI = new CheckoutAPI(client);
const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" });
```

```go Go theme={null}
// 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)
threeDSRequestData := checkout.ThreeDSRequestData{
  NativeThreeDS: common.PtrString("preferred"),
}

phone := checkout.Phone{
  Cc: common.PtrString("1"),
  Subscriber: common.PtrString("5555555555"),
}

authenticationData := checkout.AuthenticationData{
  ThreeDSRequestData: &threeDSRequestData,
}

amount := checkout.Amount{
  Currency: "EUR",
  Value: 1500,
}

threeDS2RequestFields := checkout.ThreeDS2RequestFields{
  MobilePhone: &phone,
}

cardDetails := checkout.CardDetails{
  EncryptedCardNumber: common.PtrString("eyJ0aHJlZURTTWV0aG9kTm90aWZpY..."),
  HolderName: common.PtrString("S. Hopper"),
  EncryptedSecurityCode: common.PtrString("eyJldZvpOuJSU0EtT0FFUC0yNTYiL..."),
  EncryptedExpiryYear: common.PtrString("eyJhzKliOiJMN0EtT0FFUC0yNTYiL..."),
  EncryptedExpiryMonth: common.PtrString("eyJhbGciOiTWV0EtT0FFUC0yNTYiL..."),
  Type: common.PtrString("scheme"),
}

billingAddress := checkout.BillingAddress{
  Country: "NL",
  City: "Amsterdam",
  Street: "Infinite Loop",
  HouseNumberOrName: "1",
  PostalCode: "1011DJ",
}

browserInfo := checkout.BrowserInfo{
  AcceptHeader: "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
  ScreenWidth: 1536,
  JavaEnabled: true,
  ScreenHeight: 723,
  TimeZoneOffset: 0,
  UserAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
  Language: "nl-NL",
  ColorDepth: 24,
}

paymentRequest := checkout.PaymentRequest{
  AuthenticationData: &authenticationData,
  Amount: amount,
  Origin: common.PtrString("https://your-company.example.com"),
  Channel: common.PtrString("web"),
  ShopperIP: common.PtrString("192.0.2.1"),
  ShopperEmail: common.PtrString("s.hopper@example.com"),
  Reference: "YOUR_REFERENCE",
  MerchantAccount: "ADYEN_MERCHANT_ACCOUNT",
  ThreeDS2RequestData: &threeDS2RequestFields,
  PaymentMethod: checkout.CardDetailsAsCheckoutPaymentMethod(&cardDetails),
  BillingAddress: &billingAddress,
  ReturnUrl: "https://your-company.example.com/checkout?shopperOrder=12xy..",
  BrowserInfo: &browserInfo,
  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)
```

```py Python theme={null}
# 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": {
    "currency": "EUR",
    "value": 1500
  },
  "reference": "YOUR_REFERENCE",
  "merchantAccount": "ADYEN_MERCHANT_ACCOUNT",
  "paymentMethod": {
    "type": "scheme",
    "encryptedCardNumber": "eyJ0aHJlZURTTWV0aG9kTm90aWZpY...",
    "encryptedExpiryMonth": "eyJhbGciOiTWV0EtT0FFUC0yNTYiL...",
    "encryptedExpiryYear": "eyJhzKliOiJMN0EtT0FFUC0yNTYiL...",
    "encryptedSecurityCode": "eyJldZvpOuJSU0EtT0FFUC0yNTYiL...",
    "holderName": "S. Hopper"
  },
  "authenticationData": {
    "threeDSRequestData": {
      "nativeThreeDS": "preferred"
    }
  },
  "threeDS2RequestData": {
    "mobilePhone": {
      "cc": "1",
      "subscriber": "5555555555"
    }
  },
  "channel": "web",
  "browserInfo": {
    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
    "acceptHeader": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
    "language": "nl-NL",
    "colorDepth": 24,
    "screenHeight": 723,
    "screenWidth": 1536,
    "timeZoneOffset": 0,
    "javaEnabled": True
  },
  "shopperIP": "192.0.2.1",
  "shopperReference": "YOUR_SHOPPER_REFERENCE",
  "billingAddress": {
    "street": "Infinite Loop",
    "houseNumberOrName": "1",
    "postalCode": "1011DJ",
    "city": "Amsterdam",
    "country": "NL"
  },
  "shopperEmail": "s.hopper@example.com",
  "origin": "https://your-company.example.com",
  "returnUrl": "https://your-company.example.com/checkout?shopperOrder=12xy.."
}

# Send the request
result = adyen.checkout.payments_api.payments(request=json_request, idempotency_key="UUID")
```

```rb Ruby theme={null}
# 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 => {
    :currency => 'EUR',
    :value => 1500
  },
  :reference => 'YOUR_REFERENCE',
  :merchantAccount => 'ADYEN_MERCHANT_ACCOUNT',
  :paymentMethod => {
    :type => 'scheme',
    :encryptedCardNumber => 'eyJ0aHJlZURTTWV0aG9kTm90aWZpY...',
    :encryptedExpiryMonth => 'eyJhbGciOiTWV0EtT0FFUC0yNTYiL...',
    :encryptedExpiryYear => 'eyJhzKliOiJMN0EtT0FFUC0yNTYiL...',
    :encryptedSecurityCode => 'eyJldZvpOuJSU0EtT0FFUC0yNTYiL...',
    :holderName => 'S. Hopper'
  },
  :authenticationData => {
    :threeDSRequestData => {
      :nativeThreeDS => 'preferred'
    }
  },
  :threeDS2RequestData => {
    :mobilePhone => {
      :cc => '1',
      :subscriber => '5555555555'
    }
  },
  :channel => 'web',
  :browserInfo => {
    :userAgent => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36',
    :acceptHeader => 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8',
    :language => 'nl-NL',
    :colorDepth => 24,
    :screenHeight => 723,
    :screenWidth => 1536,
    :timeZoneOffset => 0,
    :javaEnabled => true
  },
  :shopperIP => '192.0.2.1',
  :shopperReference => 'YOUR_SHOPPER_REFERENCE',
  :billingAddress => {
    :street => 'Infinite Loop',
    :houseNumberOrName => '1',
    :postalCode => '1011DJ',
    :city => 'Amsterdam',
    :country => 'NL'
  },
  :shopperEmail => 's.hopper@example.com',
  :origin => 'https://your-company.example.com',
  :returnUrl => 'https://your-company.example.com/checkout?shopperOrder=12xy..'
}

# Send the request
result = adyen.checkout.payments_api.payments(request_body, headers: { 'Idempotency-Key' => 'UUID' })
```

```ts NodeJS (TypeScript) theme={null}
// 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 threeDSRequestData: Types.checkout.ThreeDSRequestData = {
  nativeThreeDS: Types.checkout.ThreeDSRequestData.NativeThreeDSEnum.Preferred
};

const phone: Types.checkout.Phone = {
  cc: "1",
  subscriber: "5555555555"
};

const authenticationData: Types.checkout.AuthenticationData = {
  threeDSRequestData: threeDSRequestData
};

const amount: Types.checkout.Amount = {
  currency: "EUR",
  value: 1500
};

const threeDS2RequestFields: Types.checkout.ThreeDS2RequestFields = {
  mobilePhone: phone
};

const cardDetails: Types.checkout.CardDetails = {
  encryptedCardNumber: "eyJ0aHJlZURTTWV0aG9kTm90aWZpY...",
  holderName: "S. Hopper",
  encryptedSecurityCode: "eyJldZvpOuJSU0EtT0FFUC0yNTYiL...",
  encryptedExpiryYear: "eyJhzKliOiJMN0EtT0FFUC0yNTYiL...",
  encryptedExpiryMonth: "eyJhbGciOiTWV0EtT0FFUC0yNTYiL...",
  type: Types.checkout.CardDetails.TypeEnum.Scheme
};

const billingAddress: Types.checkout.BillingAddress = {
  country: "NL",
  city: "Amsterdam",
  street: "Infinite Loop",
  houseNumberOrName: "1",
  postalCode: "1011DJ"
};

const browserInfo: Types.checkout.BrowserInfo = {
  acceptHeader: "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
  screenWidth: 1536,
  javaEnabled: true,
  screenHeight: 723,
  timeZoneOffset: 0,
  userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
  language: "nl-NL",
  colorDepth: 24
};

const paymentRequest: Types.checkout.PaymentRequest = {
  authenticationData: authenticationData,
  amount: amount,
  origin: "https://your-company.example.com",
  channel: Types.checkout.PaymentRequest.ChannelEnum.Web,
  shopperIP: "192.0.2.1",
  shopperEmail: "s.hopper@example.com",
  reference: "YOUR_REFERENCE",
  merchantAccount: "ADYEN_MERCHANT_ACCOUNT",
  threeDS2RequestData: threeDS2RequestFields,
  paymentMethod: cardDetails,
  billingAddress: billingAddress,
  returnUrl: "https://your-company.example.com/checkout?shopperOrder=12xy..",
  browserInfo: browserInfo,
  shopperReference: "YOUR_SHOPPER_REFERENCE"
};

// Send the request
const checkoutAPI = new CheckoutAPI(client);
const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" });
```

\*\*

### Card payment with redirect 3D Secure 2 authentication

Make a request for a payment with 3D Secure 2 redirect authentication. Use our [redirect 3D Secure 2 Component](https://adyen-preview.mintlify.site/online-payments/3d-secure/redirect-3ds2/web-drop-in.md) to handle redirect 3D Secure 2 authentication.

#### Parameters

| Classic API | Checkout API |
| - | - |
| `amount` | `amount` |
| `reference` | `reference` |
| `merchantAccount` | `merchantAccount` |
| `additionalData.card.encrypted.json` | `paymentMethod.type` |
| Not applicable | `paymentMethod.encryptedCardNumber` |
| Not applicable. | `paymentMethod.encryptedExpiryMonth` |
| Not applicable. | `paymentMethod.encryptedExpiryYear` |
| Not applicable. | `paymentMethod.encryptedSecurityCode` |
| Not applicable. | `paymentMethod.holderName` |
| `browserInfo` | `browserInfo` |
| `shopperReference` | `shopperReference` |
| `shopperEmail` | `shopperEmail` |
| `shopperIP` | `shopperIP` |
| Not applicable. | `billingAddress` |
| Not applicable. | `channel` |
| Not applicable. | `origin` |
| Not applicable. | `returnUrl` |

#### Classic API

To make a payment with 3D Secure 2 redirect authentication, include the following in the [/authorise](https://docs.adyen.com/api-explorer/Payment/latest/post/authorise) request:

```bash theme={null}
curl https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise \
-H 'x-api-key: ADYEN_API_KEY' \
-H 'content-type: application/json' \
-d '{
   "amount":{
      "currency":"EUR",
      "value":1500
   },
   "reference":"YOUR_REFERENCE",
   "merchantAccount":"ADYEN_MERCHANT_ACCOUNT",
   "additionalData":{
      "card.encrypted.json":"adyenjs_0_1_4p1$..."
   },
   "browserInfo":{
      "userAgent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/70.0.3538.110 Safari\/537.36",
      "acceptHeader":"text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8",
      "language":"nl-NL",
      "colorDepth":24,
      "screenHeight":723,
      "screenWidth":1536,
      "timeZoneOffset":0,
      "javaEnabled":true
   }
   "shopperReference": "YOUR_SHOPPER_REFERENCE",
   "shopperEmail": "s.hopper@example.com",
   "shopperIP": "192.0.2.1"
}'
```

#### Checkout API

To make a payment with 3D Secure 2 redirect authentication, include the following in the [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request:

```bash curl theme={null}
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":1500
   },
   "reference":"YOUR_REFERENCE",
   "merchantAccount":"ADYEN_MERCHANT_ACCOUNT",
   "paymentMethod":{
      "type":"scheme",
      "encryptedCardNumber":"eyJ0aHJlZURTTWV0aG9kTm90aWZpY...",
      "encryptedExpiryMonth":"eyJhbGciOiTWV0EtT0FFUC0yNTYiL...",
      "encryptedExpiryYear":"eyJhzKliOiJMN0EtT0FFUC0yNTYiL...",
      "encryptedSecurityCode":"eyJldZvpOuJSU0EtT0FFUC0yNTYiL...",
      "holderName":"S. Hopper"
   },
   "browserInfo":{
      "userAgent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/70.0.3538.110 Safari\/537.36",
      "acceptHeader":"text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8",
      "language":"nl-NL",
      "colorDepth":24,
      "screenHeight":723,
      "screenWidth":1536,
      "timeZoneOffset":0,
      "javaEnabled":true
   },
   "shopperReference": "YOUR_SHOPPER_REFERENCE",
   "shopperEmail": "s.hopper@example.com",
   "shopperIP": "192.0.2.1",
   "billingAddress": {
      "street": "Infinite Loop",
      "houseNumberOrName": "1",
      "postalCode": "1011DJ",
      "city": "Amsterdam",
      "country": "NL"
   },
   "channel":"web",
   "origin":"https://your-company.example.com",
   "returnUrl":"https://your-company.example.com/checkout?shopperOrder=12xy.."
}'
```

```java Java theme={null}
// 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("EUR")
  .value(1500L);

CardDetails cardDetails = new CardDetails()
  .encryptedCardNumber("eyJ0aHJlZURTTWV0aG9kTm90aWZpY...")
  .holderName("S. Hopper")
  .encryptedSecurityCode("eyJldZvpOuJSU0EtT0FFUC0yNTYiL...")
  .encryptedExpiryYear("eyJhzKliOiJMN0EtT0FFUC0yNTYiL...")
  .encryptedExpiryMonth("eyJhbGciOiTWV0EtT0FFUC0yNTYiL...")
  .type(CardDetails.TypeEnum.SCHEME);

BillingAddress billingAddress = new BillingAddress()
  .country("NL")
  .city("Amsterdam")
  .street("Infinite Loop")
  .houseNumberOrName("1")
  .postalCode("1011DJ");

BrowserInfo browserInfo = new BrowserInfo()
  .acceptHeader("text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8")
  .screenWidth(1536)
  .javaEnabled(true)
  .screenHeight(723)
  .timeZoneOffset(0)
  .userAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36")
  .language("nl-NL")
  .colorDepth(24);

PaymentRequest paymentRequest = new PaymentRequest()
  .reference("YOUR_REFERENCE")
  .amount(amount)
  .merchantAccount("ADYEN_MERCHANT_ACCOUNT")
  .origin("https://your-company.example.com")
  .channel(PaymentRequest.ChannelEnum.WEB)
  .paymentMethod(new CheckoutPaymentMethod(cardDetails))
  .shopperEmail("s.hopper@example.com")
  .shopperIP("192.0.2.1")
  .billingAddress(billingAddress)
  .returnUrl("https://your-company.example.com/checkout?shopperOrder=12xy..")
  .browserInfo(browserInfo)
  .shopperReference("YOUR_SHOPPER_REFERENCE");

// Send the request
PaymentsApi service = new PaymentsApi(client);
PaymentResponse response = service.payments(paymentRequest, new RequestOptions().idempotencyKey("UUID"));
```

```php PHP theme={null}
<?php
// Adyen PHP API Library v28.2.0
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\BrowserInfo;
use Adyen\Model\Checkout\PaymentRequest;
use Adyen\Service\Checkout\PaymentsApi;

$client = new Client();
$client->setXApiKey("ADYEN_API_KEY");
// For the LIVE environment, also include your liveEndpointUrlPrefix.
$client->setEnvironment(Environment::TEST);


// Create the request object(s)
$amount = new Amount();
$amount
  ->setCurrency("EUR")
  ->setValue(1500);

$checkoutPaymentMethod = new CheckoutPaymentMethod();
$checkoutPaymentMethod
  ->setEncryptedCardNumber("eyJ0aHJlZURTTWV0aG9kTm90aWZpY...")
  ->setHolderName("S. Hopper")
  ->setEncryptedSecurityCode("eyJldZvpOuJSU0EtT0FFUC0yNTYiL...")
  ->setEncryptedExpiryYear("eyJhzKliOiJMN0EtT0FFUC0yNTYiL...")
  ->setEncryptedExpiryMonth("eyJhbGciOiTWV0EtT0FFUC0yNTYiL...")
  ->setType("scheme");

$billingAddress = new BillingAddress();
$billingAddress
  ->setCountry("NL")
  ->setCity("Amsterdam")
  ->setStreet("Infinite Loop")
  ->setHouseNumberOrName("1")
  ->setPostalCode("1011DJ");

$browserInfo = new BrowserInfo();
$browserInfo
  ->setAcceptHeader("text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8")
  ->setScreenWidth(1536)
  ->setJavaEnabled(true)
  ->setScreenHeight(723)
  ->setTimeZoneOffset(0)
  ->setUserAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36")
  ->setLanguage("nl-NL")
  ->setColorDepth(24);

$paymentRequest = new PaymentRequest();
$paymentRequest
  ->setReference("YOUR_REFERENCE")
  ->setAmount($amount)
  ->setMerchantAccount("ADYEN_MERCHANT_ACCOUNT")
  ->setOrigin("https://your-company.example.com")
  ->setChannel("web")
  ->setPaymentMethod($checkoutPaymentMethod)
  ->setShopperEmail("s.hopper@example.com")
  ->setShopperIP("192.0.2.1")
  ->setBillingAddress($billingAddress)
  ->setReturnUrl("https://your-company.example.com/checkout?shopperOrder=12xy..")
  ->setBrowserInfo($browserInfo)
  ->setShopperReference("YOUR_SHOPPER_REFERENCE");

$requestOptions['idempotencyKey'] = 'UUID';

// Send the request
$service = new PaymentsApi($client);
$response = $service->payments($paymentRequest, $requestOptions);
```

```cs C# theme={null}
// 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 = "EUR",
  Value = 1500
};

CardDetails cardDetails = new CardDetails
{
  EncryptedCardNumber = "eyJ0aHJlZURTTWV0aG9kTm90aWZpY...",
  HolderName = "S. Hopper",
  EncryptedSecurityCode = "eyJldZvpOuJSU0EtT0FFUC0yNTYiL...",
  EncryptedExpiryYear = "eyJhzKliOiJMN0EtT0FFUC0yNTYiL...",
  EncryptedExpiryMonth = "eyJhbGciOiTWV0EtT0FFUC0yNTYiL...",
  Type = CardDetails.TypeEnum.Scheme
};

BillingAddress billingAddress = new BillingAddress
{
  Country = "NL",
  City = "Amsterdam",
  Street = "Infinite Loop",
  HouseNumberOrName = "1",
  PostalCode = "1011DJ"
};

BrowserInfo browserInfo = new BrowserInfo
{
  AcceptHeader = "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
  ScreenWidth = 1536,
  JavaEnabled = true,
  ScreenHeight = 723,
  TimeZoneOffset = 0,
  UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
  Language = "nl-NL",
  ColorDepth = 24
};

PaymentRequest paymentRequest = new PaymentRequest
{
  Reference = "YOUR_REFERENCE",
  Amount = amount,
  MerchantAccount = "ADYEN_MERCHANT_ACCOUNT",
  Origin = "https://your-company.example.com",
  Channel = PaymentRequest.ChannelEnum.Web,
  PaymentMethod = new CheckoutPaymentMethod(cardDetails),
  ShopperEmail = "s.hopper@example.com",
  ShopperIP = "192.0.2.1",
  BillingAddress = billingAddress,
  ReturnUrl = "https://your-company.example.com/checkout?shopperOrder=12xy..",
  BrowserInfo = browserInfo,
  ShopperReference = "YOUR_SHOPPER_REFERENCE"
};

// Send the request
var service = new PaymentsService(client);
var response = service.Payments(paymentRequest, requestOptions: new RequestOptions { IdempotencyKey = "UUID"});
```

```js NodeJS (JavaScript) theme={null}
// 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: {
    currency: "EUR",
    value: 1500
  },
  reference: "YOUR_REFERENCE",
  merchantAccount: "ADYEN_MERCHANT_ACCOUNT",
  paymentMethod: {
    type: "scheme",
    encryptedCardNumber: "eyJ0aHJlZURTTWV0aG9kTm90aWZpY...",
    encryptedExpiryMonth: "eyJhbGciOiTWV0EtT0FFUC0yNTYiL...",
    encryptedExpiryYear: "eyJhzKliOiJMN0EtT0FFUC0yNTYiL...",
    encryptedSecurityCode: "eyJldZvpOuJSU0EtT0FFUC0yNTYiL...",
    holderName: "S. Hopper"
  },
  browserInfo: {
    userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
    acceptHeader: "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
    language: "nl-NL",
    colorDepth: 24,
    screenHeight: 723,
    screenWidth: 1536,
    timeZoneOffset: 0,
    javaEnabled: true
  },
  shopperReference: "YOUR_SHOPPER_REFERENCE",
  shopperEmail: "s.hopper@example.com",
  shopperIP: "192.0.2.1",
  billingAddress: {
    street: "Infinite Loop",
    houseNumberOrName: "1",
    postalCode: "1011DJ",
    city: "Amsterdam",
    country: "NL"
  },
  channel: "web",
  origin: "https://your-company.example.com",
  returnUrl: "https://your-company.example.com/checkout?shopperOrder=12xy.."
}

// Send the request
const checkoutAPI = new CheckoutAPI(client);
const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" });
```

```go Go theme={null}
// 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: "EUR",
  Value: 1500,
}

cardDetails := checkout.CardDetails{
  EncryptedCardNumber: common.PtrString("eyJ0aHJlZURTTWV0aG9kTm90aWZpY..."),
  HolderName: common.PtrString("S. Hopper"),
  EncryptedSecurityCode: common.PtrString("eyJldZvpOuJSU0EtT0FFUC0yNTYiL..."),
  EncryptedExpiryYear: common.PtrString("eyJhzKliOiJMN0EtT0FFUC0yNTYiL..."),
  EncryptedExpiryMonth: common.PtrString("eyJhbGciOiTWV0EtT0FFUC0yNTYiL..."),
  Type: common.PtrString("scheme"),
}

billingAddress := checkout.BillingAddress{
  Country: "NL",
  City: "Amsterdam",
  Street: "Infinite Loop",
  HouseNumberOrName: "1",
  PostalCode: "1011DJ",
}

browserInfo := checkout.BrowserInfo{
  AcceptHeader: "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
  ScreenWidth: 1536,
  JavaEnabled: true,
  ScreenHeight: 723,
  TimeZoneOffset: 0,
  UserAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
  Language: "nl-NL",
  ColorDepth: 24,
}

paymentRequest := checkout.PaymentRequest{
  Reference: "YOUR_REFERENCE",
  Amount: amount,
  MerchantAccount: "ADYEN_MERCHANT_ACCOUNT",
  Origin: common.PtrString("https://your-company.example.com"),
  Channel: common.PtrString("web"),
  PaymentMethod: checkout.CardDetailsAsCheckoutPaymentMethod(&cardDetails),
  ShopperEmail: common.PtrString("s.hopper@example.com"),
  ShopperIP: common.PtrString("192.0.2.1"),
  BillingAddress: &billingAddress,
  ReturnUrl: "https://your-company.example.com/checkout?shopperOrder=12xy..",
  BrowserInfo: &browserInfo,
  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)
```

```py Python theme={null}
# 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": {
    "currency": "EUR",
    "value": 1500
  },
  "reference": "YOUR_REFERENCE",
  "merchantAccount": "ADYEN_MERCHANT_ACCOUNT",
  "paymentMethod": {
    "type": "scheme",
    "encryptedCardNumber": "eyJ0aHJlZURTTWV0aG9kTm90aWZpY...",
    "encryptedExpiryMonth": "eyJhbGciOiTWV0EtT0FFUC0yNTYiL...",
    "encryptedExpiryYear": "eyJhzKliOiJMN0EtT0FFUC0yNTYiL...",
    "encryptedSecurityCode": "eyJldZvpOuJSU0EtT0FFUC0yNTYiL...",
    "holderName": "S. Hopper"
  },
  "browserInfo": {
    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
    "acceptHeader": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
    "language": "nl-NL",
    "colorDepth": 24,
    "screenHeight": 723,
    "screenWidth": 1536,
    "timeZoneOffset": 0,
    "javaEnabled": True
  },
  "shopperReference": "YOUR_SHOPPER_REFERENCE",
  "shopperEmail": "s.hopper@example.com",
  "shopperIP": "192.0.2.1",
  "billingAddress": {
    "street": "Infinite Loop",
    "houseNumberOrName": "1",
    "postalCode": "1011DJ",
    "city": "Amsterdam",
    "country": "NL"
  },
  "channel": "web",
  "origin": "https://your-company.example.com",
  "returnUrl": "https://your-company.example.com/checkout?shopperOrder=12xy.."
}

# Send the request
result = adyen.checkout.payments_api.payments(request=json_request, idempotency_key="UUID")
```

```rb Ruby theme={null}
# 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 => {
    :currency => 'EUR',
    :value => 1500
  },
  :reference => 'YOUR_REFERENCE',
  :merchantAccount => 'ADYEN_MERCHANT_ACCOUNT',
  :paymentMethod => {
    :type => 'scheme',
    :encryptedCardNumber => 'eyJ0aHJlZURTTWV0aG9kTm90aWZpY...',
    :encryptedExpiryMonth => 'eyJhbGciOiTWV0EtT0FFUC0yNTYiL...',
    :encryptedExpiryYear => 'eyJhzKliOiJMN0EtT0FFUC0yNTYiL...',
    :encryptedSecurityCode => 'eyJldZvpOuJSU0EtT0FFUC0yNTYiL...',
    :holderName => 'S. Hopper'
  },
  :browserInfo => {
    :userAgent => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36',
    :acceptHeader => 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8',
    :language => 'nl-NL',
    :colorDepth => 24,
    :screenHeight => 723,
    :screenWidth => 1536,
    :timeZoneOffset => 0,
    :javaEnabled => true
  },
  :shopperReference => 'YOUR_SHOPPER_REFERENCE',
  :shopperEmail => 's.hopper@example.com',
  :shopperIP => '192.0.2.1',
  :billingAddress => {
    :street => 'Infinite Loop',
    :houseNumberOrName => '1',
    :postalCode => '1011DJ',
    :city => 'Amsterdam',
    :country => 'NL'
  },
  :channel => 'web',
  :origin => 'https://your-company.example.com',
  :returnUrl => 'https://your-company.example.com/checkout?shopperOrder=12xy..'
}

# Send the request
result = adyen.checkout.payments_api.payments(request_body, headers: { 'Idempotency-Key' => 'UUID' })
```

```ts NodeJS (TypeScript) theme={null}
// 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: "EUR",
  value: 1500
};

const cardDetails: Types.checkout.CardDetails = {
  encryptedCardNumber: "eyJ0aHJlZURTTWV0aG9kTm90aWZpY...",
  holderName: "S. Hopper",
  encryptedSecurityCode: "eyJldZvpOuJSU0EtT0FFUC0yNTYiL...",
  encryptedExpiryYear: "eyJhzKliOiJMN0EtT0FFUC0yNTYiL...",
  encryptedExpiryMonth: "eyJhbGciOiTWV0EtT0FFUC0yNTYiL...",
  type: Types.checkout.CardDetails.TypeEnum.Scheme
};

const billingAddress: Types.checkout.BillingAddress = {
  country: "NL",
  city: "Amsterdam",
  street: "Infinite Loop",
  houseNumberOrName: "1",
  postalCode: "1011DJ"
};

const browserInfo: Types.checkout.BrowserInfo = {
  acceptHeader: "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
  screenWidth: 1536,
  javaEnabled: true,
  screenHeight: 723,
  timeZoneOffset: 0,
  userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
  language: "nl-NL",
  colorDepth: 24
};

const paymentRequest: Types.checkout.PaymentRequest = {
  reference: "YOUR_REFERENCE",
  amount: amount,
  merchantAccount: "ADYEN_MERCHANT_ACCOUNT",
  origin: "https://your-company.example.com",
  channel: Types.checkout.PaymentRequest.ChannelEnum.Web,
  paymentMethod: cardDetails,
  shopperEmail: "s.hopper@example.com",
  shopperIP: "192.0.2.1",
  billingAddress: billingAddress,
  returnUrl: "https://your-company.example.com/checkout?shopperOrder=12xy..",
  browserInfo: browserInfo,
  shopperReference: "YOUR_SHOPPER_REFERENCE"
};

// Send the request
const checkoutAPI = new CheckoutAPI(client);
const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" });
```

\*\*

### Refund

Make a request for refund.

#### Parameters

| Classic API | Checkout API |
| - | - |
| `amount` | `amount` |
| `merchantAccount` | `merchantAccount` |
| `reference` | `reference` |
| `originalReference` | Path parameter: `paymentPspReference` |

#### Classic API

To make a refund, include the following in the [/refund](https://docs.adyen.com/api-explorer/Payment/latest/post/refund) request:

```bash theme={null}
curl https://pal-test.adyen.com/pal/servlet/Payment/v68/refund \
-H 'x-api-key: ADYEN_API_KEY' \
-H 'content-type: application/json' \
-d '{
   "modificationAmount": {
      "value": 500,
      "currency": "EUR"
   },
   "merchantAccount": "ADYEN_MERCHANT_ACCOUNT",
   "reference": "YOUR_REFERENCE",
   "originalReference": "XB7XNCQ8HXSKGK82"
}'
```

#### Checkout API

To make a refund, include the following in the [/payments/\{paymentPspReference}/refunds](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/\(paymentPspReference\)/refunds) request:

```bash theme={null}
curl https://checkout-test.adyen.com/v72/payments/XB7XNCQ8HXSKGK82/refunds \
-H 'x-api-key: ADYEN_API_KEY' \
-H 'content-type: application/json' \
-d '{
   "amount": {
      "value": 500,
      "currency": "EUR"
   },
   "merchantAccount": "ADYEN_MERCHANT_ACCOUNT",
   "reference": "YOUR_REFERENCE"
}'
```

\*\*

### Cancel

Make a request to cancel a payment.

#### Parameters

| Classic API | Checkout API |
| - | - |
| `merchantAccount` | `merchantAccount` |
| `reference` | `reference` |
| `originalReference` | Path parameter: `paymentPspReference` |

#### Classic API

To cancel a payment, include the following in the [/cancel](https://docs.adyen.com/api-explorer/Payment/latest/post/cancel) request:

```bash theme={null}
curl https://pal-test.adyen.com/pal/servlet/Payment/v68/cancel \
-H 'x-api-key: ADYEN_API_KEY' \
-H 'content-type: application/json' \
-d '{
   "merchantAccount" : "ADYEN_MERCHANT_ACCOUNT",
   "reference" : "YOUR_REFERENCE",
	 "originalReference" : "XB7XNCQ8HXSKGK82"

}'
```

#### Checkout API

To cancel a payment, include the following in the [/payments/\{paymentPspReference}/cancels](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/\(paymentPspReference\)/cancels) request:

```bash theme={null}
curl https://checkout-test.adyen.com/v72/payments/XB7XNCQ8HXSKGK82/cancels \
-H 'x-api-key: ADYEN_API_KEY' \
-H 'content-type: application/json' \
-d '{
	 "merchantAccount": "ADYEN_MERCHANT_ACCOUNT",
	 "reference": "YOUR_REFERENCE"
}'
```

\*\*

### Capture

Make a request to capture a payment.

#### Parameters

| Classic API | Checkout API |
| - | - |
| `modificationAmount` | `amount` |
| `merchantAccount` | `merchantAccount` |
| `reference` | `reference` |
| `originalReference` | Path parameter: `paymentPspReference` |

#### Classic API

To capture a payment, include the following in the [/capture](https://docs.adyen.com/api-explorer/Payment/latest/post/capture) request:

```bash theme={null}
curl https://pal-test.adyen.com/pal/servlet/Payment/v68/capture \
-H 'x-api-key: ADYEN_API_KEY' \
-H 'content-type: application/json' \
-d '{
   "modificationAmount":{
      "value": 500,
      "currency": "EUR"
   },
   "merchantAccount":"ADYEN_MERCHANT_ACCOUNT",
   "reference": "YOUR_REFERENCE",
   "originalReference": "WNS7WQ756L2GWR82"
}'
```

#### Checkout API

To capture a payment, include the following in the [/payments/\{paymentPspReference}/captures](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/\(paymentPspReference\)/captures) request:

```bash theme={null}
curl https://checkout-test.adyen.com/v72/payments/WNS7WQ756L2GWR82/captures \
-H 'x-api-key: ADYEN_API_KEY' \
-H 'content-type: application/json' \
-d '{
   "amount":{
      "value": 500,
      "currency": "EUR"
   },
   "merchantAccount": "ADYEN_MERCHANT_ACCOUNT",
   "reference": "YOUR_REFERENCE"
}'
```

\*\*

### Reversal

Make a request for reversal. Use this when you do not know if a payment was already captured.

#### Parameters

| Classic API | Checkout API |
| - | - |
| `merchantAccount` | `merchantAccount` |
| `reference` | `reference` |
| `originalReference` | Path parameter: `paymentPspReference` |

#### Classic API

To reverse (cancel or refund) a payment, include the following in the [/cancelOrRefund](https://docs.adyen.com/api-explorer/Payment/latest/post/cancelOrRefund) request:

```bash theme={null}
curl https://pal-test.adyen.com/pal/servlet/Payment/v68/captureOrRefund \
-H 'x-api-key: ADYEN_API_KEY' \
-H 'content-type: application/json' \
-d '{
   "merchantAccount" : "ADYEN_MERCHANT_ACCOUNT",
   "reference" : "YOUR_REFERENCE",
   "originalReference" : "VK9DRSLLRCQ2WN82"
}'
```

#### Checkout API

To reverse (cancel or refund) a payment, include the following in the [/payments/\{paymentPspReference}/reversals](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/\(paymentPspReference\)/reversals) request:

```bash theme={null}
curl https://checkout-test.adyen.com/v72/payments/VK9DRSLLRCQ2WN82/reversals \
-H 'x-api-key: ADYEN_API_KEY' \
-H 'content-type: application/json' \
-d '{
   "merchantAccount": "ADYEN_MERCHANT_ACCOUNT",
   "reference": "YOUR_REFERENCE"
}'
```

\*\*

### Adjust the amount of an authorized payment

Make a request to adjust the amount of an authorized payment.

#### Parameters

| Classic API | Checkout API |
| - | - |
| `modificationAmount` | `amount` |
| `merchantAccount` | `merchantAccount` |
| `reference` | `reference` |
| `additionalData.industryUsage` | `industryUsage` |
| `originalReference` | Path parameter: `paymentPspReference` |
| Not applicable. | `lineItems` |

#### Classic API

To adjust an authorized amount, include the following in the [/adjustAuthorisation](https://docs.adyen.com/api-explorer/Payment/latest/post/adjustAuthorisation) request:

```bash theme={null}
curl https://pal-test.adyen.com/pal/servlet/Payment/v68/adjustAuthorisation \
-H 'x-api-key: ADYEN_API_KEY' \
-H 'content-type: application/json' \
-d '{
   "modificationAmount": {
      "currency": "EUR",
      "value": 2300
   },
   "merchantAccount": "ADYEN_MERCHANT_ACCOUNT",
   "reference": "YOUR_REFERENCE",
   "additionalData":{
      "industryUsage": "delayedCharge"
   },
   "originalReference": "FJM726V375BV9D82"
}'
```

#### Checkout API

To adjust an authorized amount, include the following in the [/payments/\{paymentPspReference}/amountUpdates](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/\(paymentPspReference\)/amountUpdates) request:

```bash theme={null}
curl https://checkout-test.adyen.com/v72/payments/{paymentPspReference}/amountUpdates \
-H 'x-api-key: ADYEN_API_KEY' \
-H 'content-type: application/json' \
-d '{
   "amount": {
      "currency": "EUR",
      "value": 2300
   },
   "merchantAccount": "ADYEN_MERCHANT_ACCOUNT",
   "reference": "YOUR_REFERENCE",
   "industryUsage": "delayedCharge",
   "lineItems": [
      {
         "quantity": "1",
         "amountExcludingTax": "1000",
         "taxPercentage": "1000",
         "description": "Jacket",
         "id": "Item #1",
         "taxAmount": "100",
         "amountIncludingTax": "1100"
      },
      {
         "quantity": "1",
         "amountExcludingTax": "2000",
         "taxPercentage": "1000",
         "description": "Pants",
         "id": "Item #2",
         "taxAmount": "200",
         "amountIncludingTax": "1200"
      }
   ]
}'
```

\*\*

### Third-party 3D Secure 2 authentication

Make a request for a payment with [third-party authentication](https://adyen-preview.mintlify.site/online-payments/3d-secure/authorize-mpidata.md). The parameters you include depend on the authentication data from the third party.

#### Parameters

| Classic API | Checkout API |
| - | - |
| `amount` | `amount` |
| `additionalData.card.encrypted.json` | `paymentMethod` |
| Not applicable. | `paymentMethod.type` |
| `selectedBrand` For co-badged cards. | `paymentMethod.brand` For co-badged cards. |
| Not applicable. | `paymentMethod.encryptedCardNumber` |
| Not applicable. | `paymentMethod.encryptedExpiryMonth` |
| Not applicable. | `paymentMethod.encryptedExpiryYear` |
| Not applicable. | `paymentMethod.encryptedSecurityCode` |
| Not applicable. | `paymentMethod.holderName` |
| `additionalData.scaExemption` For Cartes Bancaires. | `additionalData.scaExemption` For Cartes Bancaires. |
| `additionalData.acquirerCode` For Cartes Bancaires. | `additionalData.acquirerCode` For Cartes Bancaires. |
| `merchantAccount` | `merchantAccount` |
| `reference` | `reference` |
| `mpiData.cavv` | `mpiData.cavv` |
| `mpiData.eci` | `mpiData.eci` |
| `mpiData.dsTransID` | `mpiData.dsTransID` |
| `mpiData.directoryResponse` | `mpiData.directoryResponse` |
| `mpiData.authenticationResponse` | `mpiData.authenticationResponse` |
| `mpiData.threeDSVersion` | `mpiData.threeDSVersion` |
| `mpiData.cavvAlgorithm` For Cartes Bancaires. | `mpiData.cavvAlgorithm` For Cartes Bancaires. |
| `mpiData.challengeCancel` For Cartes Bancaires. | `mpiData.challengeCancel` For Cartes Bancaires. |
| `mpiData.riskScore` For Cartes Bancaires. | `mpiData.riskScore` For Cartes Bancaires. |
| `threeDS2RequestData.threeDSRequestorChallengeInd` For Cartes Bancaires. | `threeDS2RequestData.threeDSRequestorChallengeInd` For Cartes Bancaires. |
| Not applicable. | `channel` |
| Not applicable. | `shopperInteraction` |
| Not applicable. | `recurringProcessingModel` |

#### Classic API

To make a payment with third-party authentication, include the following in the [/authorise](https://docs.adyen.com/api-explorer/Payment/latest/post/authorise) request:

The parameters you include depend on the authentication data from the third party.

```bash theme={null}
curl https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise \
-H 'x-api-key: ADYEN_API_KEY' \
-H 'content-type: application/json' \
-d '{
   "amount":{
      "currency":"EUR",
      "value":1000
   },
   "additionalData":{
      "card.encrypted.json":"adyenjs_0_1_4p1$...",
      "scaExemption": "lowValue",
      "acquirerCode": "AdyenCartesBancaires"
   },
   "selectedBrand": "visa",
   "merchantAccount":"YOUR_MERCHANT_ACCOUNT",
   "reference":"YOUR_REFERENCE_NUMBER",
   "mpiData":{
      "cavv": "3q2+78r+ur7erb7vyv66vv\/\/\/\/8=",
      "eci":"05",
      "dsTransID":"c4e59ceb-a382-4d6a-bc87-385d591fa09d",
      "directoryResponse":"C",
      "authenticationResponse":"Y",
      "threeDSVersion":"2.1.0",
      "cavvAlgorithm":"ABC",
      "challengeCancel": "00",
      "riskScore": "95"
   },
   "threeDS2RequestData": {
      "threeDSRequestorChallengeInd": "04"
   }
}'
```

#### Checkout API

To make a payment with third-part authentication, include the following in the [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request:

The parameters you include depend on the authentication data from the third party.

```bash theme={null}
curl https://checkout-test.adyen.com/v72/payments/ \
-H 'x-api-key: ADYEN_API_KEY' \
-H 'content-type: application/json' \
-d '{
   "amount": {
      "currency": "EUR",
      "value": 1000
   },
   "paymentMethod": {
      "type": "card",
      "brand": "cartebancaire",
      "encryptedCardNumber": "test_4111111111111111",
      "encryptedExpiryMonth": "test_03",
      "encryptedExpiryYear": "test_2030",
      "encryptedSecurityCode": "test_737",
      "holderName": "John Smith"
   },
   "additionalData": {
      "scaExemption": "lowValue",
      "acquirerCode": "AdyenCartesBancaires"
   },
   "merchantAccount": "YOUR_MERCHANT_ACCOUNT",
   "reference": "YOUR_ORDER_NUMBER",
   "mpiData": {
      "cavv": "3q2+78r+ur7erb7vyv66vv////8=",
      "eci": "05",
      "dsTransID": "c4e59ceb-a382-4d6a-bc87-385d591fa09d",
      "directoryResponse": "C",
      "authenticationResponse": "Y",
      "threeDSVersion": "2.1.0",
      "cavvAlgorithm": "ABC",
      "challengeCancel": "00",
      "riskScore": "95"
   },
   "threeDS2RequestData": {
      "threeDSRequestorChallengeInd": "04"
   },
   "channel": "Web",
   "shopperInteraction": "Ecommerce",
   "recurringProcessingModel": "CardOnFile"
}'
```

## Implement card brands check

To comply with co-badge card regulations, follow instructions to [show co-badged cards](https://adyen-preview.mintlify.site/payment-methods/cards/raw-card-data#co-badged).

## Handle additional actions

The [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) response includes the payment status. If the response includes the `action` object, you must handle an additional action before the shopper can finish the payment.

What you must do depends on the `action.type`:

| `action.type` | Description | Next steps |
| - | - | - |
| **voucher** | The shopper gets a voucher which they will use to complete the payment later. | 1. [Show the voucher](#show-voucher-qr-code). 2. After the shopper completes the payment, get the [webhook](https://adyen-preview.mintlify.site/development-resources/webhooks.md) that includes the payment result. |
| **qrCode** | The shopper scans a QR code and is redirected to an app to complete the payment. | 1. [Show the QR code](#show-voucher-qr-code). 2. After the shopper completes the payment, get the [webhook](https://adyen-preview.mintlify.site/development-resources/webhooks.md) that includes the payment result. |
| **redirect** | The shopper is redirected to another website or app to complete the payment. | [Handle the redirect](#handle-the-redirect). |
| **await** | The shopper completes the payment asynchronously, for example by using an app. | 1. Inform the shopper that you are waiting for the payment. 2. Wait to get the [webhook](https://adyen-preview.mintlify.site/development-resources/webhooks.md) that includes the payment result. |
| **sdk** | Applies for payment methods that require an SDK, for example [WeChat Pay](https://adyen-preview.mintlify.site/payment-methods/wechat-pay/wechat-pay-in-app-payments/api-only). The type can sometimes include the payment method name, for example: **wechatpaySDK**. | 1. Invoke the SDK to trigger the switch to the payment method's app. 2. After the shopper completes the payment, get the [webhook](https://adyen-preview.mintlify.site/development-resources/webhooks.md) that includes the payment result. |
| **threeDS2** | The payment qualifies for 3D Secure 2 and will go through 3D Secure 2 authentication. | Follow our 3D Secure 2 integration guides: [Web 3D Secure 2 Component](https://docs.adyen.com/online-payments/3d-secure/native-3ds2/web-component#3ds2-component) [iOS 3D Secure 2 Component](https://docs.adyen.com/online-payments/3d-secure/native-3ds2/ios-component) [Android 3D Secure 2 Component](https://docs.adyen.com/online-payments/3d-secure/native-3ds2/android-component#3ds2-component) |

### Show the voucher or QR code to your shopper

For voucher and QR code actions, you must use the information in the `action` object to show something to the shopper.

> [tab] Voucher
>
> For the **voucher** `action.type`:
>
> 1. Get the voucher data from the `action` object and present this information on your front end or client app.
>
>    For example, for Indonesian bank transfer payments, you get the following fields in the response:
>
>    | Parameter | Description |
>    | - | - |
>    | `expiresAt` | The voucher expiry date. |
>    | `initialAmount` | The amount and currency that the shopper has to pay. |
>    | `merchantName` | The name of your shop. |
>    | `instructionsUrl` | The link where the shopper can get additional instructions for the payment. |
>
>    **Voucher action type**
>
>    ```json theme={null}
>    {
>      "resultCode": "PresentToShopper",
>      "action": {
>          "expiresAt": "2021-09-04T19:17:00",
>          "initialAmount": {
>              "currency": "IDR",
>              "value": 10000
>          },
>          "instructionsUrl": "https://checkoutshopper-test.adyen.com/checkoutshopper/voucherInstructions.shtml?txVariant=doku_mandiri_va",
>          "merchantName": "YOUR_SHOP_NAME",
>          "paymentMethodType": "doku_alfamart",
>          "reference": "8520126030105485",
>          "shopperEmail": "john.smith@adyen.com",
>          "shopperName": "John Smith",
>          "totalAmount": {
>              "currency": "IDR",
>              "value": 10000
>          },
>          "type": "voucher"
>      }
>    }
>    ```
>
> 2. After you show the voucher to the shopper, [get the payment outcome](#get-the-payment-outcome).

> [tab] QR code
>
> For the **qrCode** `action.type`:
>
> 1. Get the `qrCodeData` from the `action` object. This parameter contains a URL that renders the QR code.
>
>    For example, for WeChat Pay desktop QR payments, you get the following in the response:
>
>    **QR code action type**
>
>    ```json theme={null}
>    {
>      "resultCode": "Pending",
>      "action": {
>          "paymentData": "Ab02b4c0!BQAB..",
>          "paymentMethodType": "wechatpayQR",
>          "qrCodeData": "weixin://wxpay/bizpayurl?pr=IM7BCOW",
>          "type": "qrCode"
>      }
>      ...
>    }
>    ```
>
> 2. Show the QR code on your checkout page.
>
> 3. After the shopper scans the QR code and completes the payment, we send a [webhook](https://adyen-preview.mintlify.site/development-resources/webhooks.md) that includes the payment result.
>
> ### Handle the redirect
>
> For redirect payment methods or redirect 3D Secure 2 authentication, you get `action.type`: **redirect**. You must redirect the shopper.
>
> 1. Get the `action.url` from the response.

> [tab] Redirect payment method
>
> **Example response for a redirect payment method**
>
> ```json theme={null}
> {
>   "action": {
>     "method": "GET",
>     "paymentMethodType": "ideal",
>     "type": "redirect",
>     "url": "https://test.adyen.com/hpp/redirectIdeal.shtml?brandCode=ideal&currencyCode=EUR&issuerId=1121..."
>   }
> }
> ```

> [tab] Redirect 3D Secure 2
>
> **Example response for redirect 3D Secure 2 authentication**
>
> ```json theme={null}
> {
>   "action": {
>     "method": "POST",
>     "paymentMethodType": "scheme",
>     "type": "redirect",
>     "url": "https://checkoutshopper-test.adyen.com/checkoutshopper/threeDS/checkoutRedirect/...",
>     "data": {
>       "MD": "OEVudmZVMUlkWjd0MDNwUWs2bmhSdz09...",
>       "PaReq": "eNpVUttygjAQ/RXbDyAXBYRZ00HpTH3wUosPfe..."
>     }
>   }
> }
> ```
>
> 2. Redirect the shopper to the `action.url` with the HTTP method from `action.method`.

> [tab] Redirect payment method
>
> For redirect payment methods, the`action.method` is **GET**:
>
> **Redirect payment method URL**
>
> ```bash theme={null}
> curl https://test.adyen.com/hpp/redirectIdeal.shtml?brandCode=ideal&currencyCode=EUR&issuerId=1121... \
> ```

> [tab] Redirect 3D Secure 2
>
> For 3D Secure redirect, the `action.method` is **POST**:
>
> **Redirect 3D Secure URL**
>
> ```bash theme={null}
> curl https://checkoutshopper-test.adyen.com/checkoutshopper/threeDS/checkoutRedirect/... \
> --data-urlencode 'PaReq=eNpVUttygjAQ/RXbDyAXBYRZ00HpTH3wUosPfe...' \
> --data-urlencode 'MD=OEVudmZVMUlkWjd0MDNwUWs2bmhSdz09...'
> ```
>
> The shopper is redirected to a page where they need to take additional action, depending on the payment method.
>
> For security reasons, when displaying the redirect in an app, we recommend that you use [SFSafariViewController](https://developer.apple.com/documentation/safariservices/sfsafariviewcontroller) for iOS or [Chrome Custom Tabs](https://developer.chrome.com/multidevice/android/customtabs) for Android, instead of [WebView](https://developer.android.com/topic/security/best-practices#webview) objects.
>
> After the shopper completes the payment, they are redirected back to your `returnUrl` using the [HTTP GET method](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/GET). The URL includes a Base64-encoded `redirectResult`:
>
> ```raw theme={null}
> GET /?shopperOrder=12xy..&&redirectResult=X6XtfGC3%21Y... HTTP/1.1
> Host: www.your-company.example.com/checkout
> ```
>
> 3. Get the `redirectResult` appended to the URL and pass it to your server. If the shopper completes the payment but doesn't return to your website or app, you do not get the `redirectResult`. Instead, you get the outcome of the payment in a [webhook](https://adyen-preview.mintlify.site/development-resources/webhooks.md).
>
> 4. From your server, make a POST [/payments/details](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/details) request, specifying:
>
>    | Parameter | Description |
>    | - | - |
>    | `details` | Contains the URL-decoded `redirectResult`. |
>
>    **/payments/details request**
>
>    #### curl
>
>    ```bash theme={null}
>    curl https://checkout-test.adyen.com/v72/payments/details \
>    -H 'x-api-key: ADYEN_API_KEY' \
>    -H 'content-type: application/json' \
>    -d '{
>        "details": {
>          "redirectResult": "eyJ0cmFuc1N0YXR1cyI6IlkifQ=="
>      }
>    }'
>    ```
>
>    #### Java
>
>    ```java theme={null}
>    // Adyen Java API Library v32.0.0
>    import com.adyen.Client;
>    import com.adyen.enums.Environment;
>    import com.adyen.model.checkout.*;
>    import java.time.OffsetDateTime;
>    import java.util.*;
>    import com.adyen.model.RequestOptions;
>    import com.adyen.service.checkout.*;
>
>    // For the LIVE environment, also include your liveEndpointUrlPrefix.
>    Client client = new Client("ADYEN_API_KEY", Environment.TEST);
>
>    // Create the request object(s)
>    // Send the request
>    PaymentsApi service = new PaymentsApi(client);
>    PaymentDetailsResponse response = service.paymentsDetails(paymentDetailsRequest, new RequestOptions().idempotencyKey("UUID"));
>    ```
>
>    #### PHP
>
>    ```php theme={null}
>    <?php
>    // Adyen PHP API Library v23.0.0
>    use Adyen\Client;
>    use Adyen\Environment;
>    use Adyen\Service\Checkout\PaymentsApi;
>
>    $client = new Client();
>    $client->setXApiKey("ADYEN_API_KEY");
>    // For the LIVE environment, also include your liveEndpointUrlPrefix.
>    $client->setEnvironment(Environment::TEST);
>
>
>    // Create the request object(s)
>    $requestOptions['idempotencyKey'] = 'UUID';
>
>    // Send the request
>    $service = new PaymentsApi($client);
>    $response = $service->paymentsDetails($paymentDetailsRequest, $requestOptions);
>    ```
>
>    #### C\#
>
>    ```cs theme={null}
>    // Adyen .net API Library v26.0.0
>    using Adyen;
>    using Environment = Adyen.Model.Environment;
>    using Adyen.Model;
>    using Adyen.Model.Checkout;
>    using Adyen.Service.Checkout;
>
>    // For the LIVE environment, also include your liveEndpointUrlPrefix.
>    var config = new Config()
>    {
>        XApiKey = "ADYEN_API_KEY",
>        Environment = Environment.Test
>    };
>    var client = new Client(config);
>
>    // Create the request object(s)
>    // Send the request
>    var service = new PaymentsService(client);
>    var response = service.PaymentsDetails(paymentDetailsRequest, requestOptions: new RequestOptions { IdempotencyKey = "UUID"});
>    ```
>
>    #### NodeJS (JavaScript)
>
>    ```js theme={null}
>    // Adyen Node API Library v22.1.0
>    // Require the parts of the module you want to use
>    const { Client, CheckoutAPI } = require('@adyen/api-library');
>
>    // For the LIVE environment, also include your liveEndpointUrlPrefix.
>    const client = new Client({ apiKey: "ADYEN_API_KEY", environment: "TEST" });
>
>    // Create the request object(s)
>    const paymentDetailsRequest = {
>      details: {
>        redirectResult: "eyJ0cmFuc1N0YXR1cyI6IlkifQ=="
>      }
>    }
>
>    // Send the request
>    const checkoutAPI = new CheckoutAPI(client);
>    const response = checkoutAPI.PaymentsApi.paymentsDetails(paymentDetailsRequest, { idempotencyKey: "UUID" });
>    ```
>
>    #### Go
>
>    ```go theme={null}
>    // Adyen Go API Library v16.1.0
>    import (
>      "context"
>      "github.com/adyen/adyen-go-api-library/v9/src/common"
>      "github.com/adyen/adyen-go-api-library/v9/src/adyen"
>      "github.com/adyen/adyen-go-api-library/v9/src/checkout"
>    )
>    // For the LIVE environment, also include your liveEndpointUrlPrefix.
>    client := adyen.NewClient(&common.Config{
>      ApiKey:      "ADYEN_API_KEY",
>      Environment: common.TestEnv,
>    })
>
>    // Create the request object(s)
>    // Send the request
>    service := client.Checkout()
>    req := service.PaymentsApi.PaymentsDetailsInput().IdempotencyKey("UUID").PaymentDetailsRequest(paymentDetailsRequest)
>    res, httpRes, err := service.PaymentsApi.PaymentsDetails(context.Background(), req)
>    ```
>
>    #### Python
>
>    ```py theme={null}
>    # Adyen Python API Library v13.2.0
>    import Adyen
>
>    adyen = Adyen.Adyen()
>    adyen.client.xapikey = "ADYEN_API_KEY"
>    # For the LIVE environment, also include your liveEndpointUrlPrefix.
>    adyen.client.platform = "test" # The environment to use library in.
>
>    # Create the request object(s)
>    json_request = {
>      "details": {
>        "redirectResult": "eyJ0cmFuc1N0YXR1cyI6IlkifQ=="
>      }
>    }
>
>    # Send the request
>    result = adyen.checkout.payments_api.payments_details(request=json_request, idempotency_key="UUID")
>    ```
>
>    #### Ruby
>
>    ```rb theme={null}
>    # Adyen Ruby API Library v10.1.0
>    require "adyen-ruby-api-library"
>
>    adyen = Adyen::Client.new
>    adyen.api_key = 'ADYEN_API_KEY'
>    # For the LIVE environment, also include your liveEndpointUrlPrefix.
>    adyen.env = :test # Set to "live" for live environment
>
>    # Create the request object(s)
>    request_body = {
>      :details => {
>        :redirectResult => 'eyJ0cmFuc1N0YXR1cyI6IlkifQ=='
>      }
>    }
>
>    # Send the request
>    result = adyen.checkout.payments_api.payments_details(request_body, headers: { 'Idempotency-Key' => 'UUID' })
>    ```
>
>    #### NodeJS (TypeScript)
>
>    ```ts theme={null}
>    // Adyen Node API Library v22.1.0
>    // Require the parts of the module you want to use
>    import { Client, CheckoutAPI, Types } from "@adyen/api-library";
>
>    // For the LIVE environment, also include your liveEndpointUrlPrefix.
>    const client = new Client({ apiKey: "ADYEN_API_KEY", environment: "TEST" });
>
>    // Create the request object(s)
>    // Send the request
>    const checkoutAPI = new CheckoutAPI(client);
>    const response = checkoutAPI.PaymentsApi.paymentsDetails(paymentDetailsRequest, { idempotencyKey: "UUID" });
>    ```
>
>    The response includes the following:
>
>    | Parameter | Description |
>    | - | - |
>    | `resultCode` | The current status of the payment. |
>    | `pspReference` | Our unique identifier for the payment. |
>
>    **/payments/details response**
>
>    ```json theme={null}
>    {
>      "resultCode": "Authorised",
>      "pspReference": "NC6HT9CRT65ZGN82"
>    }
>    ```
>
> ## Make updates for authentication
>
> If your Classic API integration uses [3D Secure authentication](https://adyen-preview.mintlify.site/online-payments/classic-integrations/classic-api-integration/3d-secure-authentication), update it to use 3D Secure 2 on Checkout API.
>
> Key improvements in Checkout API v67 and later:
>
> * **Unified redirect flow**: The shopper is redirected back from the issuer with the [HTTP GET method](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/GET) instead of the [HTTP POST method](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST). This reduces errors caused by loss of cookies.
> * **Authorization before redirect**: The payment is authorized before the shopper is redirected back. You no longer need to make a [/payments/details](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/details) request to authorize the payment. This helps authorize payments even if there is an error during the redirect.
> * **Simplified 3D Secure 2 flow**: The fingerprint and challenge steps are combined under one `action` in the [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) response. You no longer need to make two [/payments/details](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/details) requests.
> * **Higher authorization rates**: Based on recent migrations, authorization rates for payments with 3D Secure in the EU region increase after migrating.
>
> To migrate your 3D Secure implementation:
>
> 1. Replace your Classic 3D Secure requests ( [authorise3d](https://docs.adyen.com/api-explorer/Payment/latest/post/authorise3d) and [/authorise3ds2](https://docs.adyen.com/api-explorer/Payment/latest/post/authorise3ds2)) with [/payments/details](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/details).
> 2. If you use a custom 3D Secure 2 implementation, migrate from the [legacy Classic implementation](https://adyen-preview.mintlify.site/online-payments/classic-integrations/classic-api-integration/3d-secure-authentication/native-3ds2/browser-based-integration) to the [Checkout custom 3D Secure 2 implementation](https://docs.adyen.com/checkout-build-your-own-3ds2/).
>
> For details on testing, refer to the [3D Secure 2 authentication testing guide](https://adyen-preview.mintlify.site/development-resources/testing/3d-secure-2-authentication.md).
>
> ## Make updates for tokenization
>
> If your Classic API integration uses Tokenization (for recurring payments), update how you handle stored payment details.
>
> On Checkout API, the **Recurring** toggle in your Customer Area no longer functions to enable Tokenization. You must specify the type of shopper interaction and recurring processing model in each payment request.
>
> To migrate your tokenization:
>
> 1. Update the endpoints that you use to create and manage tokens.
> 2. Update your payment requests to [create tokens to store payment details](https://adyen-preview.mintlify.site/online-payments/tokenization/create-tokens.md#create-a-token), including the shopper interaction and recurring processing model.
> 3. Update your payment requests to [make payments with tokens](https://adyen-preview.mintlify.site/online-payments/tokenization/make-token-payments.md), including the shopper interaction and recurring processing model.
> 4. (Optional) [Import stored payment details](https://adyen-preview.mintlify.site/online-payments/tokenization/create-tokens.md#import-stored-payment-details).
> 5. Enable the [tokenization webhook](https://adyen-preview.mintlify.site/online-payments/tokenization/create-tokens.md#enable-the-webhook) to manage your token lifecycle.
>
> The following table shows corresponding endpoints:
>
> | Classic API | Checkout API |
> | - | - |
> | `POST` [/disable](https://docs.adyen.com/api-explorer/Recurring/latest/post/disable) | `DELETE` [/storedPaymentMethods/\{storedPaymentMethodId}](https://docs.adyen.com/api-explorer/Checkout/latest/delete/storedPaymentMethods/\(storedPaymentMethodId\)) |
> | `POST` [/listRecurringDetails](https://docs.adyen.com/api-explorer/Recurring/latest/post/listRecurringDetails) | `GET` [/storedPaymentMethods](https://docs.adyen.com/api-explorer/Checkout/latest/get/storedPaymentMethods) |
>
> The following table shows corresponding parameters:
>
> | Classic API | Checkout API |
> | - | - |
> | `recurring.contract` | `shopperInteraction` and `recurringProcessingModel` |
>
> ## Make updates for wallets and local payment methods
>
> If your Classic API integration supports wallets or local payment methods, you must update the payment flow for Checkout API.
>
> ### Google Pay
>
> The transaction variant has changed:
>
> | Classic API | Checkout API |
> | - | - |
> | `paywithgoogle` transaction variant | `googlepay` transaction variant |
>
> Use Google Pay on Checkout API v67 or later. The flow is different from Classic API. Refer to the [Google Pay API-only integration guide](https://adyen-preview.mintlify.site/payment-methods/google-pay/api-only#requirements).
>
> ### Apple Pay
>
> * Update your Apple Pay integration to use the [Checkout API flow](https://adyen-preview.mintlify.site/payment-methods/apple-pay/api-only).
> * To enable Apple Pay across all your merchant accounts quickly, use [Adyen certificate mass enablement](https://adyen-preview.mintlify.site/payment-methods/apple-pay/apple-pay-certificate).
>
> ### PIX
>
> * Replace the [Classic PIX integration](https://adyen-preview.mintlify.site/online-payments/classic-integrations/classic-api-integration/classic-pix.md) with the [Checkout PIX integration](https://adyen-preview.mintlify.site/payment-methods/pix/api-only).
>
> ### Gift cards
>
> * Classic API allowed multi-PSP gift card payments.
> * On Checkout API, if a gift card does not cover the full amount, you must process [partial payments](https://adyen-preview.mintlify.site/online-payments/partial-payments.md) using the Orders API.
> * We recommend that you use `/balanceCheck` when a shopper adds a gift card, and then authorize all partial payments at once when the shopper selects pay. Refer to the [gift cards integration guide](https://adyen-preview.mintlify.site/payment-methods/gift-cards/api-only).
>
> ## Migrate client-side encryption
>
> If your Classic API integration uses [Client-Side Encryption (CSE)](https://adyen-preview.mintlify.site/online-payments/classic-integrations/classic-api-integration/client-side-encryption), you must replace it. It does not work with Checkout API.
>
> You can replace CSE with the following options:
>
> | Option | Description |
> | - | - |
> | **Card Component** (recommended) | Use the [Card Component](https://adyen-preview.mintlify.site/payment-methods/cards/web-component) for lower PCI-DSS compliance requirements and a quick go-live. |
> | **Custom Card Component** | Use the [Custom Card Component](https://adyen-preview.mintlify.site/payment-methods/cards/custom-card-integration) for lower PCI-DSS compliance requirements with more UI flexibility. |
> | **JWE on Checkout API** | Use [JSON Web Encryption (JWE)](https://adyen-preview.mintlify.site/payment-methods/cards/custom-card-integration) for a fully custom client side with encrypted card data. |
>
> ## Migrate webhooks
>
> [Standard webhooks](https://adyen-preview.mintlify.site/development-resources/webhooks/webhook-types) have not changed because they use v1. Migration is minimal for standard webhooks.
>
> To migrate your webhooks:
>
> 1. If you use SOAP webhooks, migrate them to the JSON format. Refer to the [webhook types documentation](https://adyen-preview.mintlify.site/development-resources/webhooks/webhook-types#webhook-structure).
> 2. If you use tokenization, add [tokenization webhooks](https://docs.adyen.com/api-explorer/Tokenization-webhooks/latest/overview) to manage your token lifecycle.
> 3. If you use a differently structured AUTHORISATION webhook, review the old structure and compare it with the current structure.
>
> ## Update security settings
>
> On both Classic API and Checkout API, you authorize API requests with an [API key](https://adyen-preview.mintlify.site/development-resources/api-credentials.md#generate-api-key) or [basic authentication](https://adyen-preview.mintlify.site/development-resources/api-credentials.md#basic-authentication) credentials.
>
> | Your setup | What you must do |
> | - | - |
> | You use Adyen [API libraries](https://adyen-preview.mintlify.site/development-resources/libraries.md). | Generate and provide the credentials for your chosen authentication type. |
> | You use Adyen [Drop-in/Components](https://github.com/Adyen/#online-payments). | Set up [client-side authentication](https://adyen-preview.mintlify.site/development-resources/client-side-authentication) with a client key and allowed origins. |
>
> ## Assess the impact to your PCI compliance
>
> The impact on your PCI compliance depends on your integration type:
>
> | Integration type | Impact |
> | - | - |
> | **API-only to API-only, custom client-side interface** | No impact on PCI compliance. |
> | **API-only to API-only, with Components** | Using Adyen client-side SDKs can lower your PCI DSS scope. Refer to the [PCI DSS compliance guide](https://adyen-preview.mintlify.site/development-resources/pci-dss-compliance-guide#online-payments). We no longer support [Client Side Encryption (CSE)](https://adyen-preview.mintlify.site/online-payments/classic-integrations/classic-api-integration/client-side-encryption). Replace it with [JWE](https://adyen-preview.mintlify.site/development-resources/pci-dss-compliance-guide#json-web-encryption-jwe) to encrypt payment details. |
> | **Accessibility** | You can use Adyen Drop-in/Components to comply with accessibility directives. Refer to the [accessibility documentation](https://adyen-preview.mintlify.site/online-payments/accessibility.md#achieving-a-flawless-level-aa-rating). |
>
> ## Make changes to enhanced scheme data
>
> If your industry uses [enhanced scheme data](https://adyen-preview.mintlify.site/payment-methods/cards/enhanced-scheme-data) (for example, airline or lodging data), you must update how you include it in your API requests. In Checkout API v71 or later, the parameters for such data have moved from the `additionalData` object to the root-level `enhancedSchemeData` object.
>
> | Classic API | Checkout API v71 or later |
> | - | - |
> | [additionalData.enhancedSchemeData](https://docs.adyen.com/api-explorer/Payment/latest/post/authorise#request-additionalData-listOfValues-enhancedSchemeData-customerReference) | [enhancedSchemeData](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-enhancedSchemeData) |
> | [additionalData.airline](https://docs.adyen.com/api-explorer/Payment/latest/post/authorise#request-additionalData-AdditionalDataAirline) | [enhancedSchemeData.airline](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-enhancedSchemeData-airline) |
> | [additionalData.enhancedSchemeData.customerReference](https://docs.adyen.com/api-explorer/Payment/latest/post/authorise#request-additionalData-AdditionalDataLevel23) | [enhancedSchemeData.levelTwoThree.customerReferenceNumber](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-enhancedSchemeData-levelTwoThree-customerReferenceNumber) |
>
> Some other data that you include in `additionalData` can have a corresponding root-level parameter in the Checkout API. If you identify such parameters, update your requests to use the root-level parameter instead.
>
> ## Request additional configuration (optional)
>
> Adyen supports some features that require additional configuration that you cannot do yourself. If you previously required Adyen to help you set up a feature or you encounter a new feature that you cannot enable yourself, contact our [Support Team](https://ca-test.adyen.com/ca/ca/contactUs/support.shtml?form=other).
>
> ## Optimize performance of your payments
>
> After you migrate to Checkout API, you can optimize the performance of your payments:
>
> | Area | Recommendation | Impact |
> | - | - | - |
> | Conversion | Collect as much information as possible about the shopper and their purchase in your payment request. Enable [Adyen Uplift](https://adyen-preview.mintlify.site/uplift/uplift-requirements.md) to reduce risk and costs. | Up to +6% higher conversion on payments. |
> | Conversion, cost, shopper experience | Use Adyen Drop-in/Components with [sessions](https://adyen-preview.mintlify.site/online-payments/build-your-integration/sessions-flow.md) on the server. | Lower PCI scope, higher conversion, fewer payment-related errors, easier to unlock new payment methods. |
> | Cost | Use Adyen [server-side API libraries](https://adyen-preview.mintlify.site/development-resources/libraries.md) to reduce development time. | Lower development time for your engineering team. |
> | Engagement, conversion | Add [shopper loyalty programs](https://adyen-preview.mintlify.site/unified-commerce/loyalty-program) with Checkout tokenization. | Shopper retention, personalized offers, increased conversion. |
> | Fraud, costs | Collect risk-related data for better fraud management with the [Adyen risk engine](https://adyen-preview.mintlify.site/risk-management.md). | Reduced chargebacks, blocked fraudulent payments. |
>
> ## Handle new errors
>
> Make changes to your server's business logic to handle [errors in Checkout API responses](https://adyen-preview.mintlify.site/development-resources/error-codes.md).
>
> A Classic API integration can get only [generic error codes](https://adyen-preview.mintlify.site/development-resources/error-codes.md#generic-error-codes).
>
> A Checkout API integration can get all error codes.
>
> ## Use our API library
>
> When you migrate to Checkout API, we recommend that you use one of our [API libraries](https://adyen-preview.mintlify.site/development-resources/libraries.md), available in many languages, to help you make requests.
>
> If you use an API library for your Classic API integration, [upgrade your API library version](https://adyen-preview.mintlify.site/online-payments/upgrade-your-integration/migrate-to-checkout-api/upgrade-api-library.md) to get the latest changes for Checkout API.
>
> ## Test your updates
>
> Follow our guide to [test your online payments integration](https://adyen-preview.mintlify.site/development-resources/testing).
>
> ## Go live
>
> You can test your Checkout API integration in the live environment by processing some live payments. While testing in the live environment, you can continue to process payments with your Classic API integration.
>
> After you verify that Checkout API meets your requirements in the live environment, we recommend that you stop using the Classic API integration.
>
> ## See also
>
> * [Integration checklist](https://adyen-preview.mintlify.site/online-payments/integration-checklist.md)
> * [Advanced flow Drop-in/Components integration guide](https://adyen-preview.mintlify.site/online-payments/build-your-integration/advanced-flow.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.