> For the complete documentation index, see [llms.txt](https://firstoken.gitbook.io/api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://firstoken.gitbook.io/api-docs/api-reference/transactions/create-a-transaction.md).

# Create a Transaction

You can use this method to create a transaction from your application or interface. This method receives and retains value payment data for a period defined in the “ttl” key and returns a transaction identifier with no sensitive data.

{% tabs %}
{% tab title="cUrl" %}
**POST /V1/request**

```
curl -X POST https://api.firstoken.co/transactions/requests 
-H 'x-api-key: YOUR_API_KEY' 
-H "Content-Type: application/json"
```

{% endtab %}

{% tab title="Attributes of the request" %}
**chd** *{object}*

> Required: true
>
> Cards value represents an array of credit cards JSON object. Each object has the attributes:
>
> Provide at least one of `card`, `cvv`, or `track_2`. No token is generated when none are provided.
>
> * **card**: *integer*
>
>   Example: 4242424242424242
>
>   Required: conditionally required\
>   An object with the CHD
> * **name**: *string*
>
>   Example: Steve Jobs
>
>   Required: false
>
>   The cardholder name.
> * **exp**: *string*
>
>   Example: 01/27
>
>   Required: false
>
>   A valid expiration card date with the format MM/YY.
> * **cvv**: *integer*
>
>   Example: 000
>
>   Required: conditionally required
>
>   A valid CVV code for the card.
> * **track\_2**: *string*
>
>   Example: 4000000000000002=251210116499394
>
>   Required: conditionally required
>
>   Magnetic-stripe Track 2 data. It contains card details in a single string and can be used to generate a token.

**amount**: *integer*

> Required: true
>
> The amount to capture. Send `0` when no amount needs capturing.
>
> Example: 100

**currency**: *string*

> Required: true
>
> The three digits ISO code for the currency.
>
> Example: USD

**additional\_info:** *{object}*

> Required: true
>
> An object with the additional fields. This field is required, but can be empty ({}). You can send multiple additional fields with every capture in the format {"key": "value"}.
>
> Example: {"phone": "(555) 555-1234"}

**TTL**: *integer*

> Required: true
>
> Time to live (TTL) specifies how long Firstoken Capture retains this capture, in minutes.
>
> Example: 480 (8 hours)
>
> Common values:
>
> * 1 day: 1440
> * 3 days: 4320
> * 5 days: 7200
>   {% endtab %}
>   {% endtabs %}

<details>

<summary>Example JSON request body</summary>

```json
{
    "chd": {
        "card": "4242424242424242",
        "name": "Jhon Smith",
        "exp": "01/25",
        "cvv": "987",
        "track_2": "4000000000000002=251210116499394"
    },
    "amount": 100,
    "currency": "USD",
    "additional_info": {
        "client_id": "client_sydbwe67643773_26272",
        "email": "john.smith@example.com",
        "phone": "+1 555 555 1234",
        "address": "123 Main Street, Miami, FL 33101"
    },
    "ttl": 1440
}
```

</details>

<details>

<summary>Example JSON response body</summary>

```json
{
    "status_code": 200,
    "status": "success",
    "desc": "Success",
    "data": {
        "id": {"4cae6bf0-d245-408e-8f6a-9e91f23396e6"}
    }
}
```

</details>
