# Simulate a card transaction authorisation

Simulates a card transaction authorisation request in the sandbox environment. It can simulate ATM withdrawals, POS purchases, e-commerce transactions, and refunds. This is an authorisation hold, where funds are held, but not yet captured by the acquirer.

The cardNumber represents the 16-digit Primary Account Number (PAN) of the card, and must be a valid PAN retrieved from sensitive card details. Please follow the detailed guide on retrieving sensitive card details.

#### Refund

A refund is a 2-step process: first authorise with transactionType set to REFUND, then clear using the clearing endpoint with the same transaction type.

{% admonition type="warning" %}
Refund simulation doesn't work with Mastercard.
{% /admonition %}

Endpoint: POST /v2/simulation/spend/profiles/{profileId}/cards/{cardToken}/transactions/authorisation
Security: UserToken

## Path parameters:

  - `profileId` (integer, required)
    The profile ID.

  - `cardToken` (string, required)
    The card token.

## Request fields (application/json):

  - `pos` (string)
    The point-of-sale used for the transaction.
- For POS transactions: CHIP_AND_PIN
- For e-commerce transactions: E_COMMERCE_NO_3DS
- For ATM transactions: CHIP_AND_PIN
- For refund transactions: CHIP_AND_PIN or E_COMMERCE_NO_3DS

  - `transactionType` (string)
    The type of the transaction.
- For POS and e-commerce transactions: GOODS_AND_SERVICES
- For ATM transactions: CASH_WITHDRAWAL
- For refund transactions: REFUND

  - `amount` (object)

  - `amount.value` (number)
    Transaction amount.

  - `amount.currency` (string)
    Currency code.

  - `mcc` (integer)
    Merchant category code.

  - `cardNumber` (string)
    Primary Account Number of the card.

## Response 200 fields (application/json):

  - `reference` (object)
    The transaction reference. This can be used in a following request for reversal and clearing.

  - `error` (string,null)
    An error returned by the transaction, if it exists.


