# Quick Start: Tokenize a Card via API

This guide walks through the minimum steps required to tokenize a credit card using the Firstoken API.

***

### Step 1: Create an API Key

1. Log in to the Sandbox Firstoken Console.
2. Navigate to **Keys** and click **Add API Key**.
3. Complete the following fields:

| Field        | Value                                             |
| ------------ | ------------------------------------------------- |
| Name         | Any identifying name (e.g., `my-first-key`).      |
| Permissions  | Select **Tokenize card(s)**.                      |
| IP Whitelist | Click **Add IP**, enter `0.0.0.0/0`, and confirm. |

4. Click **Create**. A modal displays your **API Key ID**.

> **Important:** The API Key ID is shown only once. Copy and store it immediately — it cannot be retrieved after closing this modal.

***

### Step 2: Tokenize a card

Make a `POST` request to the Simple Tokenization endpoint using your API Key ID in the `x-api-key` header.

**Endpoint**

```
POST https://api.firstoken-staging.co/v1/tokenization/simple
```

**Headers**

```
x-api-key: YOUR_API_KEY
Content-Type: application/json
```

**Request body**

```json
{
    "chd": [
        {
            "card": "4242424242424242",
            "name": "Steve Jobs",
            "exp": "01/27"
        }
    ],
    "tags": [],
    "scheme": "7"
}
```

**Response**

```json
{
    "status_code": 200,
    "status": "success",
    "desc": "Success",
    "data": {
        "tokens": [
            {
                "card": "424242******4242",
                "token": "f9f87a88-488e-4a84-b887-730b792c79f7",
                "tags": [],
                "scheme": 7,
                "created_by": {
                    "name": "API"
                },
                "status": 1,
                "createdAt": "2020-02-07T14:22:58.015Z"
            }
        ]
    }
}
```

The `token` value in the response is your permanent token. The original card number is never returned.

***

### Next steps

* View and manage your tokens from the Firstoken Console under **Tokens**.
* For the full API reference, see [Simple Tokenization](/api-docs/api-reference/permanent-tokenization/create-a-permanent-token.md).
* To transmit card data to a third party using the token, see [Proxy API](/api-docs/api-reference/proxy.md).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://firstoken.gitbook.io/api-docs/guides/quick-start-tokenize-a-card-via-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
