# Card Authorisations

{% hint style="info" %}
This step assumes you have successfully issued a card using [card-issuance](https://docs.offblocks.xyz/developer-guides/step-by-step-guide/card-issuance "mention")step of this guide
{% endhint %}

Now that you have created a customer account and issued a first card, you are able to simulate card authorisations and process simulated transactions. To do so, you need to use `/simulator/cards/{cardId}/authorisation` `POST` request.

{% openapi src="<https://1545901005-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTToCQFhAYRMgObGgbSjC%2Fuploads%2FV89o79d3urx40FHQswwW%2Foffblocks-api-spec_master_api.yaml?alt=media&token=762e0468-4f4f-407e-9281-df4ee98be768>" path="/simulator/cards/{cardId}/authorisation" method="post" expanded="true" %}
[offblocks-api-spec\_master\_api.yaml](https://1545901005-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTToCQFhAYRMgObGgbSjC%2Fuploads%2FV89o79d3urx40FHQswwW%2Foffblocks-api-spec_master_api.yaml?alt=media\&token=762e0468-4f4f-407e-9281-df4ee98be768)
{% endopenapi %}

Let's say we want to create an authorisation for €20 and automatically capture the funds:

```json
{
  "amount": "20.0",
  "currency": "EUR",
  "capture": true
}
```

If everything was successful, you will receive a response with status `201 (Created)` which looks similar to the following:

```json
{
    "accountId": "ae61c362-4136-49af-8e01-544457fe265b",
    "amount": "20",
    "cardId": "fc4912aa-cac9-4bb0-a6a7-6ec50bf45879",
    "createdAt": "2024-01-12T15:22:29.451485Z",
    "currency": "EUR",
    "exchangeRate": "1",
    "id": "532a52af-9f68-429b-8945-184773d0889d",
    "merchant": {
        "city": "London",
        "country": "GB",
        "id": "TEST",
        "mcc": 9999,
        "name": "Test Merchant"
    },
    "merchantAmount": "20",
    "merchantCurrency": "EUR",
    "status": "pending",
    "updatedAt": "2024-01-12T15:22:29.905768Z"
}
```

As automatic capture happens asynchronously, you can verify it has been successfully captured and a new transaction created and processed by first making a `GET` request to `/authorisations/{authorisationId}`.

{% openapi src="<https://1545901005-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTToCQFhAYRMgObGgbSjC%2Fuploads%2FV89o79d3urx40FHQswwW%2Foffblocks-api-spec_master_api.yaml?alt=media&token=762e0468-4f4f-407e-9281-df4ee98be768>" path="/authorisations/{authorisationId}" method="get" expanded="true" %}
[offblocks-api-spec\_master\_api.yaml](https://1545901005-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTToCQFhAYRMgObGgbSjC%2Fuploads%2FV89o79d3urx40FHQswwW%2Foffblocks-api-spec_master_api.yaml?alt=media\&token=762e0468-4f4f-407e-9281-df4ee98be768)
{% endopenapi %}

```json
{
    "accountId": "ae61c362-4136-49af-8e01-544457fe265b",
    "amount": "20",
    "cardId": "fc4912aa-cac9-4bb0-a6a7-6ec50bf45879",
    "createdAt": "2024-01-12T15:22:29.451485Z",
    "currency": "EUR",
    "exchangeRate": "1",
    "id": "532a52af-9f68-429b-8945-184773d0889d",
    "merchant": {
        "city": "London",
        "country": "GB",
        "id": "TEST",
        "mcc": 9999,
        "name": "Test Merchant"
    },
    "merchantAmount": "20",
    "merchantCurrency": "EUR",
    "status": "captured",
    "updatedAt": "2024-01-12T15:22:30.2762Z"
}
```

And then making a `GET` request to `/transactions/{transactionId}` with the same ID.

{% openapi src="<https://1545901005-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTToCQFhAYRMgObGgbSjC%2Fuploads%2FV89o79d3urx40FHQswwW%2Foffblocks-api-spec_master_api.yaml?alt=media&token=762e0468-4f4f-407e-9281-df4ee98be768>" path="/transactions/{transactionId}" method="get" expanded="true" %}
[offblocks-api-spec\_master\_api.yaml](https://1545901005-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTToCQFhAYRMgObGgbSjC%2Fuploads%2FV89o79d3urx40FHQswwW%2Foffblocks-api-spec_master_api.yaml?alt=media\&token=762e0468-4f4f-407e-9281-df4ee98be768)
{% endopenapi %}

```json
{
    "accountId": "ae61c362-4136-49af-8e01-544457fe265b",
    "amount": "20",
    "authorisationId": "532a52af-9f68-429b-8945-184773d0889d",
    "cardId": "fc4912aa-cac9-4bb0-a6a7-6ec50bf45879",
    "chainTransactions": [
        {
            "chainId": "eip155:280:0x0000000000000000000000000000000067517441607a481e825155eaaadcf7e9",
            "createdAt": "2024-01-12T15:22:30.14091932Z"
        }
    ],
    "createdAt": "2024-01-12T15:22:30.268311Z",
    "currency": "EUR",
    "direction": "debit",
    "exchangeRate": "1",
    "fees": [
        {
            "tokenAmount": "0.1",
            "type": "network"
        }
    ],
    "id": "532a52af-9f68-429b-8945-184773d0889d",
    "merchant": {
        "city": "London",
        "country": "GB",
        "id": "TEST",
        "mcc": 9999,
        "name": "Test Merchant"
    },
    "merchantAmount": "20",
    "merchantCurrency": "EUR",
    "status": "processed",
    "token": "eip155:280/erc20:0x6B175474E89094C44Da98b954EedeAC495271d0F",
    "tokenAmount": "20.1",
    "updatedAt": "2024-01-12T15:22:30.479706Z"
}
```
