# Create 3DS2 Setup

Register the 3D Secure 2 setup data your integration has collected: the cardholder's browser environment and any pre-computed device fingerprints. In return, receive a `three_d_secure_setup_id` to reference on the subsequent `POST /v1/payments`.

<Note>
**Server-to-server integrations only**

Use this endpoint when you operate a server-to-server (B2B) integration and collect 3DS2 device data on your side, through your own SDK, a fraud-screening provider's collector, or a 3DS2 server you call directly.

If you integrate through the WHITELABEL Web/Mobile SDK and a checkout session, you can skip this endpoint entirely. The SDK collects the device data and registers it automatically as part of the checkout flow.
</Note>

<Note>
**Registration step only**

This endpoint does not call the issuer, does not render a challenge, and does not bind to a specific card. The card and the `three_d_secure_setup_id` travel together on the payment call.
</Note>

<Warning>
**Device-data quality matters**

The payment provider uses `browser_info` and `device_fingerprints` to score risk and decide between frictionless flow and challenge when the payment is submitted. Missing or stale fields raise the challenge rate. Send the values exactly as observed in the cardholder's browser at the moment you call this endpoint.
</Warning>

<Note>
**How the merchant supplies device data**

The `type` field tells WHITELABEL where the device data was gathered. `MERCHANT_PROVIDED`, currently the only supported value, means you collected the browser environment and device fingerprints on your side and are passing them in directly. WHITELABEL does not run its own collector for this endpoint. If you need WHITELABEL to capture the browser/device data, use the [SDK variant](/docs/payment-features/3ds-standalone) instead.
</Note>

## How to use the response

1. **Store the id.** Keep `three_d_secure_setup_id` against the order on your side.
2. **Reference it on the payment.** On the subsequent [Create Payment](/reference/payments/create-payment), pass it under `payment_method.detail.card.three_d_secure.three_d_secure_setup_id` alongside the card or vaulted token. WHITELABEL attaches the registered `browser_info` and `device_fingerprints` to the request it sends to the payment provider.

Note that this request requires an `X-Idempotency-Key`. The same key with the same payload returns the original setup id within a 24-hour replay window. Check the [Authentication](/reference/authentication#idempotency) page for more information.

## Field rules and edge cases

| Rule | Behavior |
|---|---|
| `type` set to a value other than `MERCHANT_PROVIDED` | `400 INVALID_PARAMETERS`. Other values are reserved for future use. |
| `browser_info.platform` set to an unsupported value | `400 INVALID_PARAMETERS`. Allowed: `WEB`, `IOS`, `ANDROID`. |
| `device_fingerprints` omitted | Accepted. WHITELABEL will skip device-fingerprint enrichment for any provider that wasn't pre-supplied. |
| `device_fingerprints[*].provider_id` not found in your account | Entry is dropped silently; setup proceeds with the remaining entries. |
| `account_id` not owned by the API key | Treated as an authorization failure (`403`). |

**POST** `/three-d-secure/setups`

Base URL: `https://api-sandbox.whitelabel.com/v1`

Register the 3D Secure 2 setup data your integration has collected — the cardholder's browser environment and any pre-computed device fingerprints — and receive a `three_d_secure_setup_id` to reference on the subsequent `POST /v1/payments`.

## Authorization

- public-api-key (apiKey in header)
- private-secret-key (apiKey in header)
- X-Idempotency-Key (apiKey in header)

## Body

Content type: `application/json`

- `account_id` (string<uuid>, required)
  Account UUID that owns this 3DS2 setup.
- `type` ("MERCHANT_PROVIDED", required)
  Source of the device data. `MERCHANT_PROVIDED` means you collected the browser/device data on your side and are passing it in directly.
- `browser_info` (object, required)
  Browser environment captured from the cardholder's session. Forwarded verbatim to the 3DS2 server for risk scoring and frictionless decisioning.
  - `user_agent` (string, required)
    `navigator.userAgent` of the cardholder's browser.
  - `accept_header` (string, required)
    Value of the `Accept` HTTP header sent by the browser.
  - `color_depth` (string, required)
    `screen.colorDepth`, e.g. `"24"`.
  - `screen_height` (string, required)
    `screen.height` in pixels.
  - `screen_width` (string, required)
    `screen.width` in pixels.
  - `language` (string, required)
    BCP-47 language tag from `navigator.language`, e.g. `"es-CO"`.
  - `javascript_enabled` (boolean)
    Whether JavaScript is enabled. Defaults to `true` when omitted.
  - `java_enabled` (boolean)
    Whether the Java plugin is enabled. Almost always `false` on modern browsers.
  - `browser_time_difference` (string)
    UTC offset of the browser in minutes, signed (e.g. `"-300"` for UTC-5). Equivalent to `new Date().getTimezoneOffset()`.
  - `platform` ("WEB" | "IOS" | "ANDROID")
    Channel that captured the data.
  - `accept_content` (string)
    Optional `Accept-Encoding` value if you capture it.
  - `accept_browser` (string)
    Optional `Accept-Language` value if you capture it.
- `device_fingerprints` (object[])
  One or more provider-scoped device fingerprints already collected on your side. WHITELABEL will not run device collection again for any `provider_id` you include here.
  - `provider_id` (string<uuid>, required)
    UUID of the fraud or device-intelligence connection in your WHITELABEL account that produced this fingerprint. Find it in **Dashboard → Connections** or via `GET /v1/connections`.
  - `id` (string, required)
    The fingerprint value as returned by that provider's collector.

Example:

```json
{
  "account_id": "00000000-0000-0000-0000-000000000000",
  "type": "MERCHANT_PROVIDED",
  "browser_info": {
    "user_agent": "string",
    "accept_header": "string",
    "color_depth": "string",
    "screen_height": "string",
    "screen_width": "string",
    "language": "string",
    "javascript_enabled": true,
    "java_enabled": true,
    "browser_time_difference": "string",
    "platform": "WEB",
    "accept_content": "string",
    "accept_browser": "string"
  },
  "device_fingerprints": [
    {
      "provider_id": "00000000-0000-0000-0000-000000000000",
      "id": "string"
    }
  ]
}
```

## Responses

### 201

201

- `three_d_secure_setup_id` (string)
  Generated identifier of the 3DS2 setup. Pass this under `payment_method.detail.card.three_d_secure.three_d_secure_setup_id` on the subsequent `POST /v1/payments`.
- `account_id` (string)
  Echo of the request `account_id`.
- `type` (string)
  Echo of the request `type`.
- `browser_info` (object)
  Echo of the request `browser_info`.
  - `user_agent` (string)
  - `accept_header` (string)
  - `color_depth` (string)
  - `screen_height` (string)
  - `screen_width` (string)
  - `language` (string)
  - `javascript_enabled` (boolean)
  - `java_enabled` (boolean)
  - `browser_time_difference` (string)
  - `platform` (string)
- `device_fingerprints` (object[])
  Echo of the request `device_fingerprints`.
  - `provider_id` (string)
  - `id` (string)

Example:

```json
{
  "three_d_secure_setup_id": "a17b4f2c-08d1-4e9b-b6c5-9a3e0c7f1b22",
  "account_id": "11111111-1111-1111-1111-111111111111",
  "type": "MERCHANT_PROVIDED",
  "browser_info": {
    "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36",
    "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9",
    "color_depth": "24",
    "screen_height": "1080",
    "screen_width": "1920",
    "language": "es-CO",
    "javascript_enabled": true,
    "java_enabled": false,
    "browser_time_difference": "-300",
    "platform": "WEB"
  },
  "device_fingerprints": [
    {
      "provider_id": "f3a8b5d2-9c4e-4a7b-b1f8-2d6c9e0a4f12",
      "id": "fp_abc123xyz"
    }
  ]
}
```

### 400

400

- `code` (string)
- `messages` (string[])
- `httpCode` (integer)

Example:

```json
{
  "code": "INVALID_PARAMETERS",
  "messages": [
    "account_id must be a valid UUIDv4"
  ],
  "httpCode": 400
}
```

### 401

401

- `code` (string)
- `messages` (string[])
- `httpCode` (integer)

Example:

```json
{
  "code": "NOT_AUTHENTICATED",
  "messages": [
    "Missing API credentials"
  ],
  "httpCode": 401
}
```

### 403

403

- `code` (string)
- `messages` (string[])
- `httpCode` (integer)

Example:

```json
{
  "code": "FORBIDDEN",
  "messages": [
    "Account inactive or lacks 3DS2 entitlement"
  ],
  "httpCode": 403
}
```