# Token Creation

### Request Parameters

| Parameter           | Description                                               | Data Format | Required | Example                              |
| ------------------- | --------------------------------------------------------- | ----------- | -------- | ------------------------------------ |
| merchantRequestId   | Unique identifier generated by the merchant's system      | string(36)  | Yes      | 137d9304-0368-11ed-b939-0242ac120002 |
| merchantId          | Merchant ID generated in Ecom                             | string(36)  | Yes      | 137d9304-0368-11ed-b939-0242ac120002 |
| customerId          | Customer ID                                               | string(255) | Yes      | 12345                                |
| encryptedCardNumber | Card number encrypted in JWE using the public payment key | string      | Yes      | 5573670000000304 (decrypted example) |
| encryptedExpDate    | Card expiration date encrypted in JWE                     | string      | Yes      | `2503` (decrypted example)           |
| date                | Date and time of the transaction                          | string      | Yes      | {{currentdateT}}.00+00:00            |

### Response Parameters

| Parameter  | Description                   | Data Format | Example                              |
| ---------- | ----------------------------- | ----------- | ------------------------------------ |
| customerId | Customer ID                   | string(255) | 14534543                             |
| token      | Token ID                      | string      | TlcMw5uKf9Gp6nM\_7cHGAf              |
| maskedPan  | Masked card number            | string      | 528529••••••0255                     |
| merchantId | Merchant ID generated in Ecom | string(36)  | 137d9304-0368-11ed-b939-0242ac168002 |
| status     | Token status                  | string      | ACTIVE                               |

#### Example Request Body

```
{
    "merchantId": "137d9304-0368-11ed-b939-0242ac168002",
    "customerId": "14534543",
    "encryptedCardNumber": "eyJhbGciOiJFQ0RILUVTK0EyNTZLVyIsImVuYyI6IkEyNTZHQ00iLCJlcGsiOnsia3R5IjoiRUMiLCJ4IjoidE1sRVIyWGNHWGpxUTg2dEpRTEgyeHRyQ2NvVzdLUXJnVVZRNVJtQmNSaEZycmhnZnlxVW5sLTF2WVh0cjZIeiIsInkiOiJ3T0xyV3R5RzBqYlA4OWlUaVl1UkF2Si1valNoZE0yVWUycnVlYkhqUmlIMEt5clJELVBfdGFZV0ZxX3dGemRvIiwiY3J2IjoiUC0zODQifX0.ZAIlVIU6nh2Nt5yAx1QVolk82fEb-Gyw8X6DZxmhCbq-E1Kvz83jYQ.HGw9tqjLb8HtdmeF.nCXcOe4S9KcX-k4MKHNpXw.bDUYIFzik3HfHBrYYz-Wdw",
    "encryptedExpDate": "eyJhbGciOiJFQ0RILUVTK0EyNTZLVyIsImVuYyI6IkEyNTZHQ00iLCJlcGsiOnsia3R5IjoiRUMiLCJ4IjoibHZxMTdaWnBVWTNsX1JlcFpFU0lRUnlOeWlpS09xU0tfRUF5aHdvNGk4c0QwaVF4ZnE3ZTQxM1VjRFJMbjJQZyIsInkiOiIwVXJkcjJialhOTS16SUxiOTg1bGNZYjJrcUJReGNBMkZSNzdhWXhVVU1qUHFNR0Z6SlBxUDhpT2hGaU9pZHNiIiwiY3J2IjoiUC0zODQifX0.L35f-ycKXciH_WM2Zh-iOzMqsjL9pTz6OBPu8BVkqj9kp8Ck-faNjg.Q5CGl2neg0laf4TP.TZ_giQ.w7e9zx6LTbA_e607veBRHA",
    "date": "2025-02-20 16:42:05.00+00:00",
    "merchantRequestId": "8d1b3cbb-3d31-4067-81bd-57edbe050011"
}
```

#### Example Response Body

```
{
    "customerId": "14534543",
    "token": "_TlcMw5uKf9Gp6nM_7cHGAf_",
    "maskedPan": "528529••••••0255",
    "merchantId": "137d9304-0368-11ed-b939-0242ac168002",
    "status": "ACTIVE"
}
```


---

# 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://docs.merchant.alb.ua/en/payment-methods-h2h/token/token-creation.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.
