---
title: "Authorise a payment with 3D Secure 2 authenticated data"
description: "Submit a payment authorisation with Adyen, using authentication data from a third-party 3D Secure 2 provider."
url: "https://docs.adyen.com/online-payments/classic-integrations/classic-api-integration/3d-secure-authentication/other-3ds-flows/authorize-mpidata"
source_url: "https://docs.adyen.com/online-payments/classic-integrations/classic-api-integration/3d-secure-authentication/other-3ds-flows/authorize-mpidata.md"
canonical: "https://docs.adyen.com/online-payments/classic-integrations/classic-api-integration/3d-secure-authentication/other-3ds-flows/authorize-mpidata"
last_modified: "2024-06-19T16:48:00+02:00"
language: "en"
---

# Authorise a payment with 3D Secure 2 authenticated data

Submit a payment authorisation with Adyen, using authentication data from a third-party 3D Secure 2 provider.

[View source](/online-payments/classic-integrations/classic-api-integration/3d-secure-authentication/other-3ds-flows/authorize-mpidata.md)

**Adyen is no longer developing the Classic API integration**

This page is for the Classic API (`/authorise`) integration, which we no longer accept new integrations with.

We strongly recommend migrating to the newer [authorisation-only integration on Checkout API](/online-payments/3d-secure/other-3ds-flows/authorize-mpidata) integration. To use this newer integration, you must also [migrate to the Checkout API](/online-payments/upgrade-your-integration/migrate-to-checkout-api).

## Before you begin

Before you can start accepting 3D Secure 2 authenticated transactions on browsers or in-app, make sure that you:

1. Sign up for an Adyen test account at <https://www.adyen.com/signup>. 
2. [Get your API Key](/development-resources/api-credentials#generate-api-key). Save a copy as you'll need it for API calls you make to the Adyen payments platform.
3. Install one of our [Libraries](/development-resources/libraries) to connect with the Adyen APIs. For more information on these steps, refer to [Get started with Adyen](/get-started-with-adyen).

## Get authentication data

If you didn't authenticate with Adyen, refer to [Mapping Adyen parameters to EMVCo ones](/online-payments/3d-secure/api-reference#adyen-emvco-map-mpidata).

### Tab: 3D Secure 1

To authorise a 3D Secure 1 authenticated payment, you need the following data:

* [authenticationResponse](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/details#responses-200-additionalData-ResponseAdditionalDataCommon-threeDAuthenticatedResponse)
* [directoryResponse](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/details__resParam_additionalData-ResponseAdditionalDataCommon-threeDOfferedResponse)
* [cavv](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/details__resParam_additionalData-ResponseAdditionalData3DSecure-cavv)
* [cavvAlgorithm](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/details__resParam_additionalData-ResponseAdditionalData3DSecure-cavvAlgorithm)
* [xid](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/details__resParam_additionalData-ResponseAdditionalDataCommon-xid)
* [eci](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/details__resParam_additionalData-ResponseAdditionalDataCommon-eci)

### Tab: 3D Secure 2

To authorise a 3D Secure 2 authenticated payment, you need the following data:

Some issuers do not provide all fields; the **Applies to** column shows which fields you need from which issuers.

| Field                                                                                                                                                                     | Applies to       |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------- |
| [authenticationResponse](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/details#responses-200-threeDS2Result-authenticationValue)                      | All issuers      |
| [directoryResponse](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/details#responses-200-threeDS2Result-transStatus)                                   | All issuers      |
| [authenticationValue](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/details#responses-200-threeDS2Result-authenticationValue)                         | All issuers      |
| [dsTransID](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/details#responses-200-threeDS2Result-dsTransID)                                             | All issuers      |
| [eci](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/details__resParam_threeDS2Result-eci)                                                    | All issuers      |
| [threeDSVersion](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/details__resParam_additionalData-ResponseAdditionalDataCommon-threeDSVersion) | All issuers      |
| [cavv](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/details__resParam_additionalData-ResponseAdditionalData3DSecure-cavv)                   | All issuers      |
| [cavvAlgorithm](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/details__resParam_threeDS2Result-cavvAlgorithm)                                | Cartes Bancaires |
| [challengeCancel](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/details__resParam_threeDS2Result-challengeCancel)                            | Cartes Bancaires |
| [challengeIndicator](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/details#responses-200-threeDS2Result-challengeIndicator)                           | Cartes Bancaires |
| [exemptionIndicator](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/details__resParam_threeDS2Result-exemptionIndicator)                      | Cartes Bancaires |
| [riskScore](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/details__resParam_threeDS2Result-riskScore)                                        | Cartes Bancaires |

## Send a payment authorisation request with 3D Secure authentication data

### Tab: 3D Secure 1

Make a POST [/authorise](https://docs.adyen.com/api-explorer/#/Payment/authorise) request and include the following:

* [selectedBrand](https://docs.adyen.com/api-explorer/#/Payment/latest/post/authorise__reqParam_selectedBrand): Learn more for [co-badged cards](#co-badged-cards).
* [mpiData.authenticationResponse](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-mpiData-authenticationResponse)
* [mpiData.directoryResponse](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-mpiData-directoryResponse)
* [mpiData.cavv](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__reqParam_mpiData-cavv)
* [mpiData.cavvAlgorithm](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__reqParam_mpiData-cavvAlgorithm)
* [mpiData.xid](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__reqParam_mpiData-xid)
* [mpiData.eci](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__reqParam_mpiData-eci)

### Tab: 3D Secure 2

Make a POST [/authorise](https://docs.adyen.com/api-explorer/#/Payment/authorise) request and include the following:

Some issuers do not require all fields; the **Applies to** column shows which issuers require each field.

| Field                                                                                                                                                                   | Applies to                                                       |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- |
| [selectedBrand](https://docs.adyen.com/api-explorer/#/Payment/latest/post/authorise__reqParam_selectedBrand)                                                            | All issuers. Learn more for [co-badged cards](#co-badged-cards). |
| [mpiData.authenticationResponse](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-mpiData-authenticationResponse)                              | All issuers                                                      |
| [mpiData.directoryResponse](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-mpiData-directoryResponse)                                        | All issuers                                                      |
| [mpiData.cavv](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__reqParam_mpiData-cavv)                                                       | All issuers                                                      |
| [dsTransID](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-mpiData-dsTransID)                                                                | All issuers                                                      |
| [mpiData.eci](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__reqParam_mpiData-eci)                                                         | All issuers                                                      |
| [mpiData.threeDSVersion](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__reqParam_mpiData-threeDSVersion)                                   | All issuers                                                      |
| [threeDS2RequestData.challengeIndicator](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__reqParam_threeDS2RequestData-challengeIndicator)   | Cartes Bancaires                                                 |
| [mpiData.cavvAlgorithm](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__reqParam_mpiData-cavvAlgorithm)                                     | Cartes Bancaires                                                 |
| [mpiData.challengeCancel](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-mpiData-challengeCancel)                                            | Cartes Bancaires                                                 |
| [mpiData.riskScore](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__reqParam_mpiData-riskScore)                                             | Cartes Bancaires                                                 |
| [additionalData.acquirerCode](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#responses-200-additionalData-ResponseAdditionalDataCommon-acquirerCode) | Cartes Bancaires. Set to `"AdyenCartesBancaires"`.               |
| [additionalData.scaExemption](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__reqParam_additionalData-AdditionalData3DSecure-scaExemption)  | Cartes Bancaires                                                 |

### Co-badged cards

If you are authorising for a co-badged card, you need to set the [selectedBrand](https://docs.adyen.com/api-explorer/Payment/latest/post/authorise#request-selectedBrand) value to the scheme that authenticated the payment. For example, if you are authorising for a card co-badged with Visa and Cartes Bancaires, set the value to either `visa` or `cartebancaire`, depending on which scheme performed the authentication. Otherwise, the authorisation can be refused.

#### Sample request

### Tab: 3D Secure 1

**/authorise request**

#### curl

```bash
curl https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise \
-H 'x-api-key: ADYEN_API_KEY' \
-H 'content-type: application/json' \
-d '{
  "card":{
    "cvc":"737",
    "expiryMonth":"03",
    "expiryYear":"2030",
    "holderName":"Simon Hopper",
    "number":"4035501428146300"
  },
  "selectedBrand": "visa",
  "amount":{
    "value":1499,
    "currency":"EUR"
  },
  "mpiData":{
    "cavv":"3q2+78r+ur7erb7vyv66vv\/\/\/\/8=",
    "cavvAlgorithm":"1",
    "eci":"05",
    "xid":"ODUzNTYzOTcwODU5NzY3Qw==",
    "directoryResponse":"Y",
    "authenticationResponse":"Y"
  },
  "reference":"YOUR_REFERENCE_NUMBER",
  "merchantAccount":"YOUR_MERCHANT_ACCOUNT"
}'
```

#### Java

```java
// Adyen Java API Library v26.3.0
import com.adyen.Client;
import com.adyen.enums.Environment;
import com.adyen.model.payment.*;
import java.time.OffsetDateTime;
import java.util.*;
import com.adyen.service.*;

Client client = new Client("ADYEN_API_KEY", Environment.TEST);

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

Card card = new Card()
  .cvc("737")
  .number("4035501428146300")
  .holderName("Simon Hopper")
  .expiryMonth("03")
  .expiryYear("2030");

ThreeDSecureData threeDSecureData = new ThreeDSecureData()
  .authenticationResponse(ThreeDSecureData.AuthenticationResponseEnum.Y)
  .cavvAlgorithm("1")
  .directoryResponse(ThreeDSecureData.DirectoryResponseEnum.Y)
  .eci("05");

PaymentRequest paymentRequest = new PaymentRequest()
  .reference("YOUR_REFERENCE_NUMBER")
  .amount(amount)
  .merchantAccount("YOUR_MERCHANT_ACCOUNT")
  .selectedBrand("visa")
  .card(card)
  .mpiData(threeDSecureData);

// Send the request
paymentApi service = new paymentApi(client);
PaymentResult response = service.authorise(paymentRequest, null);
```

#### PHP

```php
// Adyen PHP API Library v18.2.1
use Adyen\Client;
use Adyen\Environment;
use Adyen\Model\Payments\Amount;
use Adyen\Model\Payments\Card;
use Adyen\Model\Payments\ThreeDSecureData;
use Adyen\Model\Payments\PaymentRequest;
use Adyen\Service\Payments\PaymentsApi;

$client = new Client();
$client->setXApiKey("ADYEN_API_KEY");
$client->setEnvironment(Environment::TEST);


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

$card = new Card();
$card
  ->setCvc("737")
  ->setNumber("4035501428146300")
  ->setHolderName("Simon Hopper")
  ->setExpiryMonth("03")
  ->setExpiryYear("2030");

$threeDSecureData = new ThreeDSecureData();
$threeDSecureData
  ->setAuthenticationResponse("Y")
  ->setCavvAlgorithm("1")
  ->setDirectoryResponse("Y")
  ->setEci("05");

$paymentRequest = new PaymentRequest();
$paymentRequest
  ->setReference("YOUR_REFERENCE_NUMBER")
  ->setAmount($amount)
  ->setMerchantAccount("YOUR_MERCHANT_ACCOUNT")
  ->setSelectedBrand("visa")
  ->setCard($card)
  ->setMpiData($threeDSecureData);

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

#### C\#

```cs
// Adyen .net API Library v17.0.0
using Adyen;
using Environment = Adyen.Model.Environment;
using Adyen.Model;
using Adyen.Model.Payment;
using Adyen.Service;

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 = 1499
};

Card card = new Card
{
  Cvc = "737",
  Number = "4035501428146300",
  HolderName = "Simon Hopper",
  ExpiryMonth = "03",
  ExpiryYear = "2030"
};

ThreeDSecureData threeDSecureData = new ThreeDSecureData
{
  AuthenticationResponse = ThreeDSecureData.AuthenticationResponseEnum.Y,
  CavvAlgorithm = "1",
  DirectoryResponse = ThreeDSecureData.DirectoryResponseEnum.Y,
  Eci = "05"
};

PaymentRequest paymentRequest = new PaymentRequest
{
  Reference = "YOUR_REFERENCE_NUMBER",
  Amount = amount,
  MerchantAccount = "YOUR_MERCHANT_ACCOUNT",
  SelectedBrand = "visa",
  Card = card,
  MpiData = threeDSecureData
};

// Send the request
var service = new PaymentService(client);
var response = service.Authorise(paymentRequest);
```

#### NodeJS (JavaScript)

```js
// Adyen Node API Library v17.3.0
// Require the parts of the module you want to use
const { Client, PaymentAPI } = require('@adyen/api-library');
// Initialize the client object
const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"});

// Create the request object(s)
const paymentRequest = {
  card: {
    cvc: "737",
    expiryMonth: "03",
    expiryYear: "2030",
    holderName: "Simon Hopper",
    number: "4035501428146300"
  },
  selectedBrand: "visa",
  amount: {
    value: 1499,
    currency: "EUR"
  },
  mpiData: {
    cavv: "3q2+78r+ur7erb7vyv66vv////8=",
    cavvAlgorithm: "1",
    eci: "05",
    xid: "ODUzNTYzOTcwODU5NzY3Qw==",
    directoryResponse: "Y",
    authenticationResponse: "Y"
  },
  reference: "YOUR_REFERENCE_NUMBER",
  merchantAccount: "YOUR_MERCHANT_ACCOUNT"
}

// Send the request
const paymentAPI = new PaymentAPI(client);
const response = paymentAPI.authorise(paymentRequest);
```

#### Go

```go
// Adyen Go API Library v10.4.0
import (
  "context"
  "github.com/adyen/adyen-go-api-library/v9/src/common"
  "github.com/adyen/adyen-go-api-library/v9/src/adyen"
  "github.com/adyen/adyen-go-api-library/v9/src/payments"
)
client := adyen.NewClient(&common.Config{
  ApiKey:      "ADYEN_API_KEY",
  Environment: common.TestEnv,
})

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

card := payments.Card{
  Cvc: common.PtrString("737"),
  Number: common.PtrString("4035501428146300"),
  HolderName: common.PtrString("Simon Hopper"),
  ExpiryMonth: common.PtrString("03"),
  ExpiryYear: common.PtrString("2030"),
}

threeDSecureData := payments.ThreeDSecureData{
  AuthenticationResponse: common.PtrString("Y"),
  CavvAlgorithm: common.PtrString("1"),
  DirectoryResponse: common.PtrString("Y"),
  Eci: common.PtrString("05"),
}

paymentRequest := payments.PaymentRequest{
  Reference: "YOUR_REFERENCE_NUMBER",
  Amount: amount,
  MerchantAccount: "YOUR_MERCHANT_ACCOUNT",
  SelectedBrand: common.PtrString("visa"),
  Card: &card,
  MpiData: &threeDSecureData,
}

// Send the request
service := client.Payments()
req := service.PaymentsApi.AuthoriseInput().PaymentRequest(paymentRequest)
res, httpRes, err := service.PaymentsApi.Authorise(context.Background(), req)
```

#### Python

```py
# Adyen Python API Library v12.5.1
import Adyen

adyen = Adyen.Adyen()
adyen.client.xapikey = "ADYEN_API_KEY"
adyen.client.platform = "test" # The environment to use library in.

# Create the request object(s)
json_request = {
  "card": {
    "cvc": "737",
    "expiryMonth": "03",
    "expiryYear": "2030",
    "holderName": "Simon Hopper",
    "number": "4035501428146300"
  },
  "selectedBrand": "visa",
  "amount": {
    "value": 1499,
    "currency": "EUR"
  },
  "mpiData": {
    "cavv": "3q2+78r+ur7erb7vyv66vv////8=",
    "cavvAlgorithm": "1",
    "eci": "05",
    "xid": "ODUzNTYzOTcwODU5NzY3Qw==",
    "directoryResponse": "Y",
    "authenticationResponse": "Y"
  },
  "reference": "YOUR_REFERENCE_NUMBER",
  "merchantAccount": "YOUR_MERCHANT_ACCOUNT"
}

# Send the request
result = adyen.payment.payments_api.authorise(request=json_request)
```

#### Ruby

```rb
# Adyen Ruby API Library v9.5.1
require "adyen-ruby-api-library"

adyen = Adyen::Client.new
adyen.api_key = 'ADYEN_API_KEY'
adyen.env = :test # Set to "live" for live environment

# Create the request object(s)
request_body = {
  :card => {
    :cvc => '737',
    :expiryMonth => '03',
    :expiryYear => '2030',
    :holderName => 'Simon Hopper',
    :number => '4035501428146300'
  },
  :selectedBrand => 'visa',
  :amount => {
    :value => 1499,
    :currency => 'EUR'
  },
  :mpiData => {
    :cavv => '3q2+78r+ur7erb7vyv66vv////8=',
    :cavvAlgorithm => '1',
    :eci => '05',
    :xid => 'ODUzNTYzOTcwODU5NzY3Qw==',
    :directoryResponse => 'Y',
    :authenticationResponse => 'Y'
  },
  :reference => 'YOUR_REFERENCE_NUMBER',
  :merchantAccount => 'YOUR_MERCHANT_ACCOUNT'
}

# Send the request
result = adyen.payment.payments_api.authorise(request_body)
```

#### NodeJS (TypeScript)

```ts
// Adyen Node API Library v17.3.0
// Require the parts of the module you want to use
import { Client, PaymentAPI, Types } from "@adyen/api-library";
// Initialize the client object
const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"});

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

const card: Types.payment.Card = {
  cvc: "737",
  number: "4035501428146300",
  holderName: "Simon Hopper",
  expiryMonth: "03",
  expiryYear: "2030"
};

const threeDSecureData: Types.payment.ThreeDSecureData = {
  authenticationResponse: Types.payment.ThreeDSecureData.AuthenticationResponseEnum.Y,
  cavvAlgorithm: "1",
  directoryResponse: Types.payment.ThreeDSecureData.DirectoryResponseEnum.Y,
  eci: "05"
};

const paymentRequest: Types.payment.PaymentRequest = {
  reference: "YOUR_REFERENCE_NUMBER",
  amount: amount,
  merchantAccount: "YOUR_MERCHANT_ACCOUNT",
  selectedBrand: "visa",
  card: card,
  mpiData: threeDSecureData
};

// Send the request
const paymentAPI = new PaymentAPI(client);
const response = paymentAPI.authorise(paymentRequest);
```

### Tab: 3D Secure 2

**/authorise request**

#### curl

```bash
curl https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise \
-H 'x-api-key: ADYEN_API_KEY' \
-H 'content-type: application/json' \
-d '{
  "card":{
    "cvc":"737",
    "expiryMonth":"03",
    "expiryYear":"2030",
    "holderName":"Simon Hopper",
    "number":"4035501428146300"
  },
  "selectedBrand": "visa",
  "amount":{
    "value":1499,
    "currency":"EUR"
  },
  "mpiData":{
    "cavv": "3q2+78r+ur7erb7vyv66vv\/\/\/\/8=",
    "eci":"05",
    "dsTransID":"c4e59ceb-a382-4d6a-bc87-385d591fa09d",
    "directoryResponse":"C",
    "authenticationResponse":"Y",
    "threeDSVersion":"2.1.0",
    "{hint: Only required for Cartes Bancaires.}cavvAlgorithm{/hint}":"ABC",
    "{hint: Only required for Cartes Bancaires.}challengeCancel{/hint}": "00",
    "{hint: Only required for Cartes Bancaires.}riskScore{/hint}": "95"
  },
  "{hint: Only required for Cartes Bancaires.}threeDS2RequestData{/hint}": {
    "challengeIndicator": "requestChallenge"
  },
  "{hint: Only required for Cartes Bancaires.}additionalData{/hint}": {
    "scaExemption": "lowValue",
    "acquirerCode": "AdyenCartesBancaires"
  },
  "reference":"YOUR_REFERENCE_NUMBER",
  "merchantAccount":"YOUR_MERCHANT_ACCOUNT"
}'
```

#### Java

```java
// Adyen Java API Library v26.3.0
import com.adyen.Client;
import com.adyen.enums.Environment;
import com.adyen.model.payment.*;
import java.time.OffsetDateTime;
import java.util.*;
import com.adyen.service.*;

Client client = new Client("ADYEN_API_KEY", Environment.TEST);

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

ThreeDS2RequestData threeDS2RequestData = new ThreeDS2RequestData()
  .challengeIndicator(ThreeDS2RequestData.ChallengeIndicatorEnum.REQUESTCHALLENGE);

Card card = new Card()
  .cvc("737")
  .number("4035501428146300")
  .holderName("Simon Hopper")
  .expiryMonth("03")
  .expiryYear("2030");

ThreeDSecureData threeDSecureData = new ThreeDSecureData()
  .authenticationResponse(ThreeDSecureData.AuthenticationResponseEnum.Y)
  .cavvAlgorithm("ABC")
  .dsTransID("c4e59ceb-a382-4d6a-bc87-385d591fa09d")
  .directoryResponse(ThreeDSecureData.DirectoryResponseEnum.C)
  .challengeCancel(ThreeDSecureData.ChallengeCancelEnum.00)
  .eci("05")
  .riskScore("95")
  .threeDSVersion("2.1.0");

PaymentRequest paymentRequest = new PaymentRequest()
  .reference("YOUR_REFERENCE_NUMBER")
  .amount(amount)
  .threeDS2RequestData(threeDS2RequestData)
  .merchantAccount("YOUR_MERCHANT_ACCOUNT")
  .selectedBrand("visa")
  .additionalData(new HashMap<String, String>(Map.of(
    "acquirerCode", "AdyenCartesBancaires",
    "scaExemption", "lowValue"
  )))
  .card(card)
  .mpiData(threeDSecureData);

// Send the request
paymentApi service = new paymentApi(client);
PaymentResult response = service.authorise(paymentRequest, null);
```

#### PHP

```php
// Adyen PHP API Library v18.2.1
use Adyen\Client;
use Adyen\Environment;
use Adyen\Model\Payments\Amount;
use Adyen\Model\Payments\ThreeDS2RequestData;
use Adyen\Model\Payments\Card;
use Adyen\Model\Payments\ThreeDSecureData;
use Adyen\Model\Payments\PaymentRequest;
use Adyen\Service\Payments\PaymentsApi;

$client = new Client();
$client->setXApiKey("ADYEN_API_KEY");
$client->setEnvironment(Environment::TEST);


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

$threeDS2RequestData = new ThreeDS2RequestData();
$threeDS2RequestData
  ->setChallengeIndicator("requestChallenge");

$card = new Card();
$card
  ->setCvc("737")
  ->setNumber("4035501428146300")
  ->setHolderName("Simon Hopper")
  ->setExpiryMonth("03")
  ->setExpiryYear("2030");

$threeDSecureData = new ThreeDSecureData();
$threeDSecureData
  ->setAuthenticationResponse("Y")
  ->setCavvAlgorithm("ABC")
  ->setDsTransID("c4e59ceb-a382-4d6a-bc87-385d591fa09d")
  ->setDirectoryResponse("C")
  ->setChallengeCancel("00")
  ->setEci("05")
  ->setRiskScore("95")
  ->setThreeDSVersion("2.1.0");

$paymentRequest = new PaymentRequest();
$paymentRequest
  ->setReference("YOUR_REFERENCE_NUMBER")
  ->setAmount($amount)
  ->setThreeDS2RequestData($threeDS2RequestData)
  ->setMerchantAccount("YOUR_MERCHANT_ACCOUNT")
  ->setSelectedBrand("visa")
  ->setAdditionalData(
    array(
      "acquirerCode" => "AdyenCartesBancaires",
      "scaExemption" => "lowValue"
    )
  )
  ->setCard($card)
  ->setMpiData($threeDSecureData);

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

#### C\#

```cs
// Adyen .net API Library v17.0.0
using Adyen;
using Environment = Adyen.Model.Environment;
using Adyen.Model;
using Adyen.Model.Payment;
using Adyen.Service;

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 = 1499
};

ThreeDS2RequestData threeDS2RequestData = new ThreeDS2RequestData
{
  ChallengeIndicator = ThreeDS2RequestData.ChallengeIndicatorEnum.RequestChallenge
};

Card card = new Card
{
  Cvc = "737",
  Number = "4035501428146300",
  HolderName = "Simon Hopper",
  ExpiryMonth = "03",
  ExpiryYear = "2030"
};

ThreeDSecureData threeDSecureData = new ThreeDSecureData
{
  AuthenticationResponse = ThreeDSecureData.AuthenticationResponseEnum.Y,
  CavvAlgorithm = "ABC",
  DsTransID = "c4e59ceb-a382-4d6a-bc87-385d591fa09d",
  DirectoryResponse = ThreeDSecureData.DirectoryResponseEnum.C,
  ChallengeCancel = ThreeDSecureData.ChallengeCancelEnum.00,
  Eci = "05",
  RiskScore = "95",
  ThreeDSVersion = "2.1.0"
};

PaymentRequest paymentRequest = new PaymentRequest
{
  Reference = "YOUR_REFERENCE_NUMBER",
  Amount = amount,
  ThreeDS2RequestData = threeDS2RequestData,
  MerchantAccount = "YOUR_MERCHANT_ACCOUNT",
  SelectedBrand = "visa",
  AdditionalData = new Dictionary<string, string>
  {

    { "acquirerCode", "AdyenCartesBancaires" },
    { "scaExemption", "lowValue" }
  },
  Card = card,
  MpiData = threeDSecureData
};

// Send the request
var service = new PaymentService(client);
var response = service.Authorise(paymentRequest);
```

#### NodeJS (JavaScript)

```js
// Adyen Node API Library v17.3.0
// Require the parts of the module you want to use
const { Client, PaymentAPI } = require('@adyen/api-library');
// Initialize the client object
const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"});

// Create the request object(s)
const paymentRequest = {
  card: {
    cvc: "737",
    expiryMonth: "03",
    expiryYear: "2030",
    holderName: "Simon Hopper",
    number: "4035501428146300"
  },
  selectedBrand: "visa",
  amount: {
    value: 1499,
    currency: "EUR"
  },
  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: {
    challengeIndicator: "requestChallenge"
  },
  additionalData: {
    scaExemption: "lowValue",
    acquirerCode: "AdyenCartesBancaires"
  },
  reference: "YOUR_REFERENCE_NUMBER",
  merchantAccount: "YOUR_MERCHANT_ACCOUNT"
}

// Send the request
const paymentAPI = new PaymentAPI(client);
const response = paymentAPI.authorise(paymentRequest);
```

#### Go

```go
// Adyen Go API Library v10.4.0
import (
  "context"
  "github.com/adyen/adyen-go-api-library/v9/src/common"
  "github.com/adyen/adyen-go-api-library/v9/src/adyen"
  "github.com/adyen/adyen-go-api-library/v9/src/payments"
)
client := adyen.NewClient(&common.Config{
  ApiKey:      "ADYEN_API_KEY",
  Environment: common.TestEnv,
})

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

threeDS2RequestData := payments.ThreeDS2RequestData{
  ChallengeIndicator: common.PtrString("requestChallenge"),
}

card := payments.Card{
  Cvc: common.PtrString("737"),
  Number: common.PtrString("4035501428146300"),
  HolderName: common.PtrString("Simon Hopper"),
  ExpiryMonth: common.PtrString("03"),
  ExpiryYear: common.PtrString("2030"),
}

threeDSecureData := payments.ThreeDSecureData{
  AuthenticationResponse: common.PtrString("Y"),
  CavvAlgorithm: common.PtrString("ABC"),
  DsTransID: common.PtrString("c4e59ceb-a382-4d6a-bc87-385d591fa09d"),
  DirectoryResponse: common.PtrString("C"),
  ChallengeCancel: common.PtrString("00"),
  Eci: common.PtrString("05"),
  RiskScore: common.PtrString("95"),
  ThreeDSVersion: common.PtrString("2.1.0"),
}

paymentRequest := payments.PaymentRequest{
  Reference: "YOUR_REFERENCE_NUMBER",
  Amount: amount,
  ThreeDS2RequestData: &threeDS2RequestData,
  MerchantAccount: "YOUR_MERCHANT_ACCOUNT",
  SelectedBrand: common.PtrString("visa"),
  AdditionalData: &map[string]string{
    "acquirerCode": "AdyenCartesBancaires",
    "scaExemption": "lowValue",
  },
  Card: &card,
  MpiData: &threeDSecureData,
}

// Send the request
service := client.Payments()
req := service.PaymentsApi.AuthoriseInput().PaymentRequest(paymentRequest)
res, httpRes, err := service.PaymentsApi.Authorise(context.Background(), req)
```

#### Python

```py
# Adyen Python API Library v12.5.1
import Adyen

adyen = Adyen.Adyen()
adyen.client.xapikey = "ADYEN_API_KEY"
adyen.client.platform = "test" # The environment to use library in.

# Create the request object(s)
json_request = {
  "card": {
    "cvc": "737",
    "expiryMonth": "03",
    "expiryYear": "2030",
    "holderName": "Simon Hopper",
    "number": "4035501428146300"
  },
  "selectedBrand": "visa",
  "amount": {
    "value": 1499,
    "currency": "EUR"
  },
  "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": {
    "challengeIndicator": "requestChallenge"
  },
  "additionalData": {
    "scaExemption": "lowValue",
    "acquirerCode": "AdyenCartesBancaires"
  },
  "reference": "YOUR_REFERENCE_NUMBER",
  "merchantAccount": "YOUR_MERCHANT_ACCOUNT"
}

# Send the request
result = adyen.payment.payments_api.authorise(request=json_request)
```

#### Ruby

```rb
# Adyen Ruby API Library v9.5.1
require "adyen-ruby-api-library"

adyen = Adyen::Client.new
adyen.api_key = 'ADYEN_API_KEY'
adyen.env = :test # Set to "live" for live environment

# Create the request object(s)
request_body = {
  :card => {
    :cvc => '737',
    :expiryMonth => '03',
    :expiryYear => '2030',
    :holderName => 'Simon Hopper',
    :number => '4035501428146300'
  },
  :selectedBrand => 'visa',
  :amount => {
    :value => 1499,
    :currency => 'EUR'
  },
  :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 => {
    :challengeIndicator => 'requestChallenge'
  },
  :additionalData => {
    :scaExemption => 'lowValue',
    :acquirerCode => 'AdyenCartesBancaires'
  },
  :reference => 'YOUR_REFERENCE_NUMBER',
  :merchantAccount => 'YOUR_MERCHANT_ACCOUNT'
}

# Send the request
result = adyen.payment.payments_api.authorise(request_body)
```

#### NodeJS (TypeScript)

```ts
// Adyen Node API Library v17.3.0
// Require the parts of the module you want to use
import { Client, PaymentAPI, Types } from "@adyen/api-library";
// Initialize the client object
const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"});

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

const threeDS2RequestData: Types.payment.ThreeDS2RequestData = {
  challengeIndicator: Types.payment.ThreeDS2RequestData.ChallengeIndicatorEnum.RequestChallenge
};

const card: Types.payment.Card = {
  cvc: "737",
  number: "4035501428146300",
  holderName: "Simon Hopper",
  expiryMonth: "03",
  expiryYear: "2030"
};

const threeDSecureData: Types.payment.ThreeDSecureData = {
  authenticationResponse: Types.payment.ThreeDSecureData.AuthenticationResponseEnum.Y,
  cavvAlgorithm: "ABC",
  dsTransID: "c4e59ceb-a382-4d6a-bc87-385d591fa09d",
  directoryResponse: Types.payment.ThreeDSecureData.DirectoryResponseEnum.C,
  challengeCancel: Types.payment.ThreeDSecureData.ChallengeCancelEnum.00,
  eci: "05",
  riskScore: "95",
  threeDSVersion: "2.1.0"
};

const paymentRequest: Types.payment.PaymentRequest = {
  reference: "YOUR_REFERENCE_NUMBER",
  amount: amount,
  threeDS2RequestData: threeDS2RequestData,
  merchantAccount: "YOUR_MERCHANT_ACCOUNT",
  selectedBrand: "visa",
  additionalData: {
    "acquirerCode": "AdyenCartesBancaires",
    "scaExemption": "lowValue"
  },
  card: card,
  mpiData: threeDSecureData
};

// Send the request
const paymentAPI = new PaymentAPI(client);
const response = paymentAPI.authorise(paymentRequest);
```

#### Sample response

You will receive an **Authorised** `resultCode` if the payment authorisation was successful. Otherwise, see [Result codes](/online-payments/payment-result-codes) for a complete list of values and the actions that you need to take.

**/authorise request**

```json
{
    "additionalData": {
        "liabilityShift": "true",
        "authCode": "76233",
        "avsResult": "4 AVS not supported for this card type",
        "threeDOffered": "true",
        "refusalReasonRaw": "AUTHORISED",
        "authorisationMid": "1000",
        "acquirerAccountCode": "TestPmmAcquirerAccount",
        "cvcResult": "1 Matches",
        "avsResultRaw": "4",
        "threeDAuthenticated": "true",
        "cvcResultRaw": "M",
        "acquirerCode": "TestPmmAcquirer",
        "acquirerReference": "7CAT290GCFV"
    },
    "pspReference": "8535505811653878",
    "resultCode": "Authorised",
    "authCode": "76233"
}
```
