> ## Documentation Index
> Fetch the complete documentation index at: https://www.marqeta.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Simulate authorization

> Simulate an authorization type transaction by including the cardtoken and other authorization details in your request.

POST/simulate/authorization

Simulate an `authorization` type transaction by including the `card_token` and other authorization details in your request.

## Body field details

| Fields | Description |
| - | - |
| card\_token string  Required | The unique identifier of the card involved in the transaction. **Allowable Values:**  255 char max |
| amount decimal  Required | The amount of the transaction. **Allowable Values:**  Format: 0.00 |
| mid string  Required | The Merchant Identifier of the merchant participating in the transaction. **Allowable Values:**  50 char max |
| is\_pre\_auth boolean  Optional | Set to `true` to mark the amount as an authorization only. **Allowable Values:**  `true`, `false` **Default value:** `false` |
| card\_acceptor object  Optional | Contains attributes that describe the merchant. **Allowable Values:**  A valid `card_acceptor` object. |
| card\_options object  Optional | Contains attributes that govern card usage. **Allowable Values:**  A valid `card_options` object. |
| transaction\_options object  Optional | Contains additional information about the transaction. **Allowable Values:**  A valid `transaction_options` object. |
| pin string  Optional | If the transaction involves a PIN-protected account, this is the PIN number. **Allowable Values:**  4 char max |
| cash\_back\_amount decimal  Optional | If the transaction simulates authorization for cash back, this is the cash amount. **Allowable Values:**  Format: 0.00 |
| network\_fees array of objects  Optional | Simulates various types of fees levied on the transaction. **Allowable Values:**  A valid array of `network_fees` objects. |
| webhook object  Optional | Allows information to be posted asynchronously to endpoints hosted in your environment. **Allowable Values:**  A valid `webhook` object. |

## The card\_options object

| Fields | Description |
| - | - |
| cvv string  Optional | The CVV2 number for the card. **Allowable Values:**  4 char max |
| expiration string  Optional | The expiration date of the card. **Allowable Values:**  mmdd |
| billing\_address object  Optional | Used for AVS (address verification system). The address-related fields in this object are verified against known values. **Allowable Values:**  A valid `billing_address` object. |
| card\_present boolean  Optional | A value of `true` requires that the card be present for the transaction. **Allowable Values:**  `true`, `false` **Default value:** `false` |

## The card\_options.billing\_address object

| Fields | Description |
| - | - |
| first\_name string  Optional | Cardholder's first name. **Allowable Values:**  To pass AVS, must match the first name on record. |
| last\_name string  Optional | Cardholder's last name. **Allowable Values:**  To pass AVS, must match the last name on record. |
| address string  Optional | Cardholder's street address. **Allowable Values:**  To pass AVS, must match the address on record. |
| zip string  Optional | Cardholder's postal code. **Allowable Values:**  To pass AVS, must match the postal code on record. |

## The card\_acceptor object

| Fields | Description |
| - | - |
| mcc string  Optional | Merchant category code. **Allowable Values:**  5 char max |
| partial\_approval\_capable boolean  Optional | Whether the response can approve an amount less than or equal to the requested amount. **Allowable Values:**  `true`, `false` **Default value:** `false` |
| name string  Optional | Merchant name. **Allowable Values:**  255 char max |
| address string  Optional | Merchant address. **Allowable Values:**  255 char max |
| city string  Optional | Merchant city. **Allowable Values:**  255 char max |
| state string  Optional | Merchant state. **Allowable Values:**  2 char max |
| zip string  Optional | Merchant ZIP or postal code. **Allowable Values:**  10 char max |
| country string  Optional | Merchant country. **Allowable Values:**  40 char max |
| ecommerce\_security\_level\_indicator string  Optional | Contains the fields representing the security protocol and cardholder authentication type associated with the transaction. **Allowable Values:**  0-9 |

## The transaction\_options object

| Fields | Description |
| - | - |
| additional\_data string  Optional | Additional information about the transaction. **Allowable Values:**  255 char max |

## The network\_fees object

| Fields | Description |
| - | - |
| type string  Required | Specifies the type of fee. - **ISSUER\_FEE** – Fee charged by the issuing bank. Does not impact account balance. - **SWITCH\_FEE** – Fee charged per transaction by the card network. Does not impact account balance. - **PINDEBIT\_ASSOC\_FEE** – Fee associated with a PIN-debit transaction, such as at an ATM. Impacts account balance. - **ACQUIRER\_FEE** – Fee charged by the acquiring bank. Impacts account balance. - **INTERCHANGE\_FEE** – Fee charged per transaction by the card network. Does not impact account balance. - **CUR\_CONV\_CARDHOLDER\_FEE** – Currency conversion fee charged to the cardholder by the card network. Impacts account balance. - **CUR\_CONV\_ISSUER\_FEE** – Currency conversion fee paid for by the issuer. Does not impact account balance. - **CROSS\_BORDER\_ISSUER\_FEE** – Cross-border fee charged by the network, and paid for by the issuer. Does not impact account balance. **Allowable Values:**  `ISSUER_FEE`, `SWITCH_FEE`, `PINDEBIT_ASSOC_FEE`, `ACQUIRER_FEE`, `INTERCHANGE_FEE`, `CUR_CONV_CARDHOLDER_FEE`, `CUR_CONV_ISSUER_FEE`, `CROSS_BORDER_ISSUER_FEE` |
| amount decimal  Optional | Specifies the amount of the fee. **Allowable Values:**  Format: 0.00 |
| credit\_debit string  Optional | Specifies whether the fee credits or debits the account balance. **Allowable Values:**  C, D  The default value depends on the setting of the `type` field, as listed below:  Fee Type / Default  `ISSUER_FEE` / C  `SWITCH_FEE` / D  `PINDEBIT_ASSOC_FEE` / D  `ACQUIRER_FEE` / D  `INTERCHANGE_FEE` / C  `CUR_CONV_CARDHOLDER_FEE` / D  `CUR_CONV_ISSUER_FEE` / C  `CROSS_BORDER_ISSUER_FEE` / C |

## The webhook object

| Fields | Description |
| - | - |
| endpoint string  Optional | Endpoint to which a copy of the response is sent. **Allowable Values:**  - HTTPS URL  - 250 char max  - Empty string not allowed |
| username string  Optional | Username for accessing the endpoint. **Allowable Values:**  50 char max |
| password string  Optional | Password for accessing the endpoint. **Allowable Values:**  No restrictions |

## Sample request body

```json JSON lines wrap theme={null}
{
  "amount": "10.00",
  "mid": "11111",
  "card_token": "4abf0fe1-2470-4cc8-b83e-c7db9a59bcdb",
  "transaction_options": {
    "additional_data": "my_additional data"
  },
  "card_acceptor": {
    "name": "Aegis Fleet Services",
    "address": "111 Main St",
    "city": "Berkeley",
    "state": "CA",
    "zip": "94702"
  },
  "webhook": {
    "endpoint": "https://mysecuredomain.com",
    "username": "my_username",
    "password": "My_passw0rd"
  }
}
```

## Sample response body

```json JSON expandable lines wrap theme={null}
{
  "type": "authorization",
  "state": "PENDING",
  "token": "9cbbdb91-81bb-4d26-acea-2734a67a96d2",
  "user_token": "b2d2c739-a9fe-4af0-9f34-964aae4c3e31",
  "acting_user_token": "b2d2c739-a9fe-4af0-9f34-964aae4c3e31",
  "card_token": "4abf0fe1-2470-4cc8-b83e-c7db9a59bcdb",
  "gpa": {
    "currency_code": "USD",
    "ledger_balance": 20,
    "available_balance": 0,
    "credit_balance": 0,
    "pending_credits": 0,
    "impacted_amount": -10,
    "balances": {
      "USD": {
        "currency_code": "USD",
        "ledger_balance": 20,
        "available_balance": 0,
        "credit_balance": 0,
        "pending_credits": 0,
        "impacted_amount": -10
      }
    }
  },
  "gpa_order": {
    "token": "3f55f689-7622-4660-9ce9-209a9e6b1a5a",
    "amount": 10,
    "created_time": "2024-07-11T16:30:00Z",
    "last_modified_time": "2024-07-11T16:30:00Z",
    "transaction_token": "e8fdd8d3-cc41-4cd6-9df0-e1071993c633",
    "state": "PENDING",
    "response": {
      "code": "0000",
      "memo": "Approved or completed successfully"
    },
    "funding": {
      "amount": 10,
      "source": {
        "type": "program",
        "token": "**********b4c2",
        "active": true,
        "name": "PFS for simulating transactions",
        "is_default_account": false,
        "created_time": "2024-07-10T00:09:35Z",
        "last_modified_time": "2024-07-10T00:09:35Z"
      }
    },
    "funding_source_token": "**********b4c2",
    "user_token": "b2d2c739-a9fe-4af0-9f34-964aae4c3e31",
    "currency_code": "USD"
  },
  "duration": 202,
  "created_time": "2024-07-11T16:30:00Z",
  "user_transaction_time": "2024-07-11T16:30:00Z",
  "settlement_date": "2024-07-11T00:00:00Z",
  "request_amount": 10,
  "amount": 10,
  "issuer_interchange_amount": 0,
  "currency_code": "USD",
  "approval_code": "015382",
  "response": {
    "code": "0000",
    "memo": "Approved or completed successfully"
  },
  "network": "VISA",
  "subnetwork": "VISANET",
  "acquirer_fee_amount": 0,
  "acquirer": {
    "system_trace_audit_number": "049258"
  },
  "user": {
    "metadata": {}
  },
  "card": {
    "metadata": {}
  },
  "card_acceptor": {
    "mid": "11111",
    "mcc": "6411",
    "name": "Aegis Fleet Services",
    "street_address": "111 Main St",
    "city": "Berkeley",
    "state": "CA",
    "zip": "94702",
    "country_code": "USA"
  },
  "pos": {
    "partial_approval_capable": true,
    "purchase_amount_only": false,
    "is_recurring": false
  }
}
```


## Related topics

- [Simulate authorization](https://www.marqeta.com/docs/core-api/simulations-card-transactions/authorizations/simulate-authorization-v2.md)
- [Simulate authorization advice](https://www.marqeta.com/docs/core-api/simulating-transactions/simulate-authorization-advice-legacy.md)
- [Simulate authorization reversal](https://www.marqeta.com/docs/core-api/simulations-card-transactions/authorizations/simulate-authorization-reversal.md)
- [Simulate authorization clearing](https://www.marqeta.com/docs/core-api/simulations-card-transactions/authorizations/simulate-authorization-clearing.md)
- [Simulate authorization cash back](https://www.marqeta.com/docs/core-api/simulations-card-transactions/authorizations/simulate-authorization-cash-back.md)
