# Simulate 3DS authentication

**POST** `/simulate/issuing/cards/{card_id}/threeds/challenge`

Simulate a 3DS authentication attempt for a sandbox card and return the resulting 3DS attempt.

Set `realtime_decision` to supply the authentication decision without calling your endpoint. When it is omitted, Column
sends a 3DS authentication decision request to your endpoint subscribed to `decision.issuing.card_authentication`; if
no endpoint is subscribed, the simulator creates an OTP challenge.

`frictionless_approve` authenticates the attempt and fires `issuing.3ds.authentication_completed`.
`challenge` starts an OTP challenge and fires `issuing.3ds.otp_generated`. Finish it with the complete 3DS challenge

endpoint.

`decline_authentication` rejects the attempt and fires `issuing.3ds.authentication_completed`.

### Path Parameters

- `card_id` `string` _(required)_ — Unique identifier for the card.

### Body Parameters

- `amount` `number` _(required)_ — Transaction amount in the smallest unit of the currency (e.g., cents for USD).
- `currency` `string` _(required)_ — ISO 4217 currency code for the transaction.
- `decline_reason` `enum` — The simulated decline reason. Only meaningful when `realtime_decision` is
  `decline_authentication`; when omitted, Column defaults to `suspected_fraud`.
  Possible values: `suspected_fraud`, `transaction_not_permitted`
- `merchant_category_code` `string` — Optional merchant category code (ISO 18245 MCC) to put on the simulated 3DS attempt and on the
  decision request, so that authentication rules that depend on the merchant category can be
  exercised in sandbox.
- `merchant_country_code` `string` — Optional merchant country, ISO 3166-1 alpha-2, to put on the simulated 3DS attempt and on the
  decision request.
- `merchant_name` `string` — Optional merchant name to put on the simulated 3DS attempt and on the
  `decision.issuing.card_authentication` request. Omitted, it stays `null`.
- `merchant_url` `string` — Optional merchant URL to put on the simulated 3DS attempt and on the decision request.
- `message_category` `enum` — Optional 3DS message category to put on the decision request: `payment` or `non_payment`
  (for example, adding a card to a merchant's file). Omitted, it stays `null`.
  Possible values: `payment`, `non_payment`
- `realtime_decision` `enum` — Overrides the real-time 3DS decisioning webhook response for this simulated authentication.
  When omitted and the platform has a webhook endpoint subscribed to
  `decision.issuing.card_authentication`, the webhook is actually invoked.
  Possible values: `frictionless_approve`, `challenge`, `decline_authentication`

**Request**

```shell
curl 'https://api.column.com/simulate/issuing/cards/<card_id>/threeds/challenge' \
  -XPOST \
  -u :<YOUR API KEY> \
  -H 'Content-Type: application/json' \
  -d '{
  "amount": 1000,
  "currency": "USD",
  "decline_reason": "suspected_fraud",
  "merchant_category_code": "5812",
  "merchant_country_code": "CA",
  "merchant_name": "BLUE BOTTLE COFFEE",
  "merchant_url": "https://bluebottlecoffee.com",
  "message_category": "payment",
  "realtime_decision": "frictionless_approve"
}'
```

**Response 200**

```json
{
  "acs_transaction_id": "9a2c4e6b-3f1d-4b8a-a5e7-1c3d5f7b9e20",
  "amount": 12345,
  "attempt_count": 1,
  "attempt_status": "authenticated",
  "card_account_id": "cacc_2x8gszy5folpA9s0TOCseE9ABDM",
  "card_id": "card_2x8gszy5folpA9s0TOCseE9ABDM",
  "chosen_challenge": "otp",
  "created_at": "2024-01-15T09:30:00Z",
  "currency": "USD",
  "ds_transaction_id": "4f8b2c1e-9a3d-4e7b-8c6f-2d1a5b9e3c70",
  "id": "tdsa_2x8gszy5folpA9s0TOCseE9ABDM",
  "merchant_category_code": "5411",
  "merchant_country_code": "US",
  "merchant_name": "Yellen Cocktails, LLC",
  "merchant_url": "https://example.com",
  "outcome_reason": "challenged_accepted",
  "realtime_decision": "frictionless_approve",
  "three_ds_message_version": "2.3.1",
  "updated_at": "2024-01-15T09:30:00Z"
}
```
