> For the complete documentation index, see [llms.txt](https://docs.lotex.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.lotex.io/types/editor.md).

# Создание платежа

<mark style="color:green;">`POST`</mark> `/api/v1/merch/create/pay`

**Используются заголовки авторизации**

**Body**

| Name                                            | Type   | Description                                                                                            |
| ----------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------ |
| `amount`<mark style="color:red;">`*`</mark>     | number | Сумма платежа                                                                                          |
| `type_pay`<mark style="color:red;">`*`</mark>   | string | Тип оплаты, доступные варианты представлены в конце страницы                                           |
| `result_url`<mark style="color:red;">`*`</mark> | string | Куда будет направлен пользователь после оплаты                                                         |
| `webhook_url`                                   | string | Ссылка, на которую будет направлен callback со статусом оплаты                                         |
| `currency`                                      | string | Валюта оплаты, доступные варианты представлены в конце страницы                                        |
| `unique`                                        | bool   | Уникализация суммы заявки                                                                              |
| `is_async`                                      | bool   | Включение асинхронного режима создания платежа                                                         |
| `bank`                                          | string | Указание конкретного банка, чтобы получить реквизит, именно по этому банку                             |
| `order_id`                                      | string | Указание id платежа в Вашей системе. При изменении статуса платежа также будет передаваться в callback |
| `fiat`                                          | string | Валюта получения, используется для Трансграничных переводов                                            |
| `ttl`                                           | number | Время жизни сделки, указывается в секундах                                                             |
| `client_id`                                     | string | ID клиента. Желательно указывать в запросе                                                             |
| `customer_requisite`                            | string | Реквизит клиента, с которого будет сделан перевод                                                      |
| `customer`                                      | object | Информация о клиенте                                                                                   |
| `customer.fio`                                  | string | <p>Полное имя клиента<br><br><em>Обязательно для валют</em>: TRY, AED</p>                              |
| `customer.email`                                | string | Почта клиента                                                                                          |

**Response**

{% tabs %}
{% tab title="201 H2H" %}

```json
{
    "payment_id": "2502-2538-0534-94r8q-f1jl9bpxa4mxfp82ssss",
    "amount": 4100.0,
    "amount_usdt": 46.06742,
    "rate": 89,
    "type": "C2C",
    "full_name": "Юнусов Осмон Сайфулоевич",
    "reqisite": "2200 1545 4104 5497",
    "bank": "Альфа Банк",
    "bank_schema": "100000000111",
    "fiat": "RUB"
}
```

{% endtab %}

{% tab title="201 API" %}

```json
{
    "payment_url": "https://pay.fastpaygate.ru/2502-2538-0534-94r8q-f1jl9bpxa4mxfp82ssss",
    "payment_id": "2502-2538-0534-94r8q-f1jl9bpxa4mxfp82ssss"
}
```

{% endtab %}

{% tab title="400" %}

```json
{
    "error": "No payment"
}
```

{% endtab %}
{% endtabs %}

### Типы оплаты

* `C2C`
* `SBP`
* `SberPay`
* `TPay`
* `VTB`
* `ALFA`
* `ALFA_SBP`
* `ALFA_C2C`
* `Sber_SBP`
* `Sber_C2C`
* `Ecom`
* `NSPK`
* `MOBILE`
* `UPI`
* `IBAN`&#x20;
* `BankTransfer`
* `E-Wallet`

### Доступные валюты

* `RUB`  - Россия
* `TJS`  - Таджикистан
* `AZN`  - Азербайджан
* `GEL`  - Грузия
* `KGS`  - Киргизия
* `ARS`  - Аргентина
* `INR` - Индия
* `MDL` - Молдова
* `AED` - ОАЭ
* `DZD` - Алжир
* `BHD` - Бахрейн
* `CLP` - Чили
* `BOB` - Боливия
* `ABX` - Абхазия
* `VES` - Венесуэла
* `MNT`- Монголия
* `IQD` - Ирак
* `EGP` - Египет
* `UZS` - Узбекистан
* `JOD` - Иордания
* `SYP` - Сирия
* `IDR` - Индонезия
* `MAD` - Марокко
* `TRY` - Турция
* `KZT` - Казахстан
* `SAR` - Саудовская Аравия
* `LBP` - Ливан
* `BRL` - Бразилия

### Ecom H2H

Для передачи карты клиента используется следующая ссылка

<mark style="color:green;">`POST`</mark>` ``api/pay/ecom/h2h/<pay_id>`

**Используются заголовки авторизации**

| Name                                             | Type   | Description                                                                                                     |
| ------------------------------------------------ | ------ | --------------------------------------------------------------------------------------------------------------- |
| `card_number`<mark style="color:red;">`*`</mark> | string | Номер карты                                                                                                     |
| `card_holder`<mark style="color:red;">`*`</mark> | string | Владелец карты                                                                                                  |
| `expiry_date`<mark style="color:red;">`*`</mark> | string | MM/YY                                                                                                           |
| `cvv`<mark style="color:red;">`*`</mark>         | string | Код карты                                                                                                       |
| `code_link`                                      | bool   | При указании значения *True* в ответе возвращается ссылка на форму для ввода кода. Стандартное значение *False* |

В ответ вам вернется то же тело запроса

Для передачи кода подтверждения используется следующая ссылка

<mark style="color:purple;">`PUT`</mark>` ``api/pay/ecom/h2h/<pay_id>`

**Используются заголовки авторизации**

| Name                                      | Type   | Description               |
| ----------------------------------------- | ------ | ------------------------- |
| `code`<mark style="color:red;">`*`</mark> | string | Код подтверждения платежа |

### Статусы CallBack Ecom

* `wait code`  - Клиенту нужно передать код подтверждения
* `wait approve client`  - Клиенту нужно подтвердить платеж в своем банке(передавайте код - 000000)

### Статусы CallBack NSPK

* `send link`  - Клиенту нужно передать код подтверждения. В теле приходит поле `requisite` , в нем содержится сама ссылка для оплаты

### Асинхронное создание платежа

При включенном асинхронном режиме, ответ на запрос поступает сразу и выглядит так

```json
{
    "payment_id": "2502-2538-0534-94r8q-f1jl9bpxa4mxfp82ssss",
    "status": "search card"
}
```

Далее на указанный webhook url придет оповещение, нашелся реквизит или нет

```
{
    "from": "lotex.io",
    "payment_id": "2502-2538-0534-94r8q-f1jl9bpxa4mxfp82ssss",
    "status": "created", // "created" - Создан ИЛИ "not created" - Не создан
    "amount": 5001.0,
    "amount_usdt": 10.29707,
    "type": "TPay",
    "rate": 485.67,
    "payment_type": "payin",
    "percent": 15,
    "order_id": "560ca044-b921-4ce1-b6ba-5bb0e8cb5250",
    "requisite": "XXX",
    "full_name": "XXX",
    "bank": "XXX",
    "bank_schema": "XXX"
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.lotex.io/types/editor.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
