# TOKEN

A **card token** is a unique digital identifier that replaces actual card details for secure payments. By using a token, you can complete transactions without exposing the actual card number.

## How to Obtain a Card Token?

#### There are two ways to generate a token:

1. **During a Payment Transaction** – When initiating a [Purchase](https://docs.merchant.alb.ua/en/payment-methods-h2h/purchase/purchase-request-step-1) or [C2A](https://docs.merchant.alb.ua/en/payment-methods-h2h/c2a/c2a-transaction-request-step-1) request, include the additional parameter:

   ```json
   "typeToken": "TOKEN_PER_CUSTOMER"
   ```
2. **Via a Separate Request** – Using the dedicated `"Create Token"` request.

## How to Pay Using a Token?

Once a token is created, a payment can be processed through a dedicated endpoint:

* `"Process Payment via Token"` for the **Purchase** transaction type.
* `"Process Payment via Token"` for the **C2A** transaction type.

Simply pass the token instead of card details, and the payment will be securely and efficiently processed.

Using tokens eliminates the need to store sensitive card data, enhancing the security of transactions.

## Additional Token-Related Requests

🔹 [**Retrieve Token by Customer ID**](https://docs.merchant.alb.ua/en/payment-methods-h2h/token/retrieve-token-by-customerid)\
To find a token linked to a specific customer, use the `"Retrieve Token by Customer ID"` request.

🔹 [**Retrieve Token Details**](https://docs.merchant.alb.ua/en/payment-methods-h2h/token/retrieve-token-data)\
To obtain detailed information about a token (such as expiration date, status, or associated card), use the `"Retrieve Token Details"` request.

These requests enable seamless token management and ensure a secure and efficient payment process.


---

# 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/authorization-2.0/payment-methods-h2h/token.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.
