# Simulate card authorization

**POST** `/simulate/issuing/cards/{card_id}/card-transactions/authorization`

Simulate a card authorization for a sandbox card. The cardholder is always billed in `USD`; when `merchant_currency`
is not `USD`, provide `cardholder_fx_rate`.

When neither `realtime_decision` nor `network_standin` is set, Column sends a real-time authorization decision request
to your endpoint subscribed to `decision.issuing.card_transaction`, and declines if none is configured. Set
`realtime_decision` to supply the decision without calling your endpoint, or `network_standin` to simulate the card
network deciding on your behalf. To attach 3DS authentication details, pass an `authenticated` `three_ds_attempt_id`
for the same card.

### Path Parameters

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

### Body Parameters

- `cardholder_amount` `number` _(required)_ — Transaction amount in the merchant's currency, expressed in the smallest currency unit.
  For example, 1000 represents 10.00 `EUR`. When `merchant_currency` is not `USD`,
  this amount is multiplied by `cardholder_fx_rate` to derive the `USD` billing amount.
  Must not exceed 999999999999.
- `cardholder_fx_rate` `string` — Foreign exchange rate to convert from merchant currency to `USD` (cardholder billing currency),
  as a decimal string. Required when `merchant_currency` is not `USD`.
  For example, if `merchant_currency` is `EUR` and `cardholder_fx_rate` is `"1.10"`,
  a 10.00 `EUR` transaction will result in an 11.00 `USD` cardholder charge.
- `merchant_currency` `string` _(required)_ — Merchant's currency code in ISO 4217 format.
- `network_decision_reason` `string` — The reason for the network's decline decision. Only applicable when
  `network_standin` is `declined`. Determines the network response code
  on the transaction. Defaults to `generic_decline` if not specified.
- `network_standin` `enum` — Simulates a scenario where the card network makes the authorization decision
  on behalf of the issuer (e.g., due to issuer timeout). When set, the resulting
  transaction will have `decision_source` set to `card_network`.`approved` — the network approves the transaction.
  `declined` — the network declines the transaction.Possible values: `approved`, `declined`
- `realtime_decision` `enum` — Specifies the issuer's real-time authorization decision to inject if the transaction
  reaches the real-time decisioning step. Mutually exclusive with `network_standin`.`approve` — the issuer approves the transaction.
  `decline` — the issuer declines the transaction (see `realtime_decision_reason`).
  `partially_approve` — the issuer partially approves the transaction(requires `realtime_partially_approved_amount`).When neither `realtime_decision` nor `network_standin` is provided, the simulator
  attempts a real real-time authorization decision webhook to the platform's configured
  `decision.issuing.card_transaction` destination (declining if no destination is configured).
  Possible values: `approve`, `decline`, `partially_approve`
- `realtime_decision_reason` `string` — The reason for the issuer's real-time decline decision. Only applicable when
  `realtime_decision` is `decline`. Defaults to `generic_decline` if not specified.
- `realtime_partially_approved_amount` `number` — The amount to partially approve, expressed in the smallest currency unit.
  Required when `realtime_decision` is `partially_approve`, and must be less than the
  requested `cardholder_amount`.
- `three_ds_attempt_id` `string` — Optional 3DS attempt ID to link to this authorization. The 3DS attempt must be in
  `authenticated` status and belong to the same card. When provided, the authorization
  will include authentication details with liability shift.

**Request**

```shell
curl 'https://api.column.com/simulate/issuing/cards/<card_id>/card-transactions/authorization' \
  -XPOST \
  -u :<YOUR API KEY> \
  -H 'Content-Type: application/json' \
  -d '{
  "cardholder_amount": 1000,
  "merchant_currency": "EUR",
  "three_ds_attempt_id": "tdsa_2x8gszy5folpA9s0TOCseE9ABDM",
  "cardholder_fx_rate": "1.10",
  "network_decision_reason": "insufficient_funds",
  "network_standin": "approved",
  "realtime_decision": "approve",
  "realtime_decision_reason": "insufficient_funds",
  "realtime_partially_approved_amount": 50
}'
```

**Response 200**

```json
{
  "authentication_details": {
    "three_ds_attempt_id": "tdsa_2x8gszy5folpA9s0TOCseE9ABDM"
  },
  "card_account_id": "cacc_2x8gszy5folpA9s0TOCseE9ABDM",
  "card_id": "card_2x8gszy5folpA9s0TOCseE9ABDM",
  "card_program_id": "cpgm_2x8gszy5folpA9s0TOCseE9ABDM",
  "created_at": "2024-01-15T09:30:00Z",
  "id": "ctxn_2x8gszy5folpA9s0TOCseE9ABDM"
}
```
