Приём крипто-платежей для интернет-магазинов, форекс-брокеров и сервисов. Клиент платит USDT или любой монетой (BTC, ETH, SOL, TRX…) — магазин всегда получает USDT. Зачисление автоматическое.
🚀 Подключение за 4 шага
1. Создай API-ключ: бот Mintar → 🪙 → вкладка API → «Создать ключ». Ключ kpk_… и секрет вебхуков показываются один раз — сохрани их.
2. Со своего сервера создай счёт — в ответе придёт ссылка pay_url:
curl -X POST https://mintar.ormanto.com/api/v1/invoices \
-H "Authorization: Bearer kpk_ваш_ключ" \
-H "Content-Type: application/json" \
-d '{"amount": 25, "network": "tron", "description": "Заказ #1024"}'
3. Отправь покупателя по pay_url: он платит USDT или любой монетой (BTC, ETH, SOL…), конвертация в USDT автоматическая.
4. На твой callback_url придёт вебхук invoice.paid с подписью HMAC-SHA256 — проверь подпись и зачисли заказ. Готово.
🌐 Вызываешь API не с сервера, а из браузера (фронтенд сайта)? Добавь домен фронтенда в CORS_ORIGINS в .env и перезапусти бота — иначе браузер заблокирует запросы.
💡 Не хочешь возиться с кодом? Создавай счета прямо в Mini App (➕ Новый счёт) и отправляй ссылку покупателю — работает так же.
POST Создать счёт
POST /api/v1/invoices · заголовок Authorization: Bearer kpk_…
| Поле | Тип | Описание |
amount | number | Сумма в USDT (0.01–1 000 000). Обязательно. |
network | string | Сеть получения USDT: tron (по умолчанию), bsc, polygon, arbitrum, base. |
description | string | Описание/номер заказа, до 200 символов. Придёт в вебхуке. |
callback_url | string | Куда прислать вебхук по этому счёту (переопределяет URL ключа). |
curl -X POST https://mintar.ormanto.com/api/v1/invoices \
-H "Authorization: Bearer kpk_ваш_ключ" \
-H "Content-Type: application/json" \
-d '{"amount": 25, "network": "tron", "description": "Заказ #1024"}'
Ответ:
{
"ok": true,
"invoice": {
"id": "a1b2c3d4e5",
"amount": 25,
"status": "pending",
"network": "tron",
"network_label": "TRON",
"deposit_address": "T…",
"pay_url": "https://mintar.ormanto.com/pay/a1b2c3d4e5",
"expires_at": 1731000000000
}
}
GET Статус счёта
GET /api/v1/invoices/<id> — статусы: pending (ждём оплату) → paid (оплачен) / expired (истёк). В ответе те же поля, что при создании, плюс received и last_tx.
GET Балансы и сводка
GET /api/v1/balance — балансы магазина по сетям. Зачисление 0% — всё, что пришло, попадает на баланс; комиссия шлюза 0,5% и сетевая комиссия (по себестоимости) списываются один раз при выводе.
GET /api/v1/info — сети, комиссия, список монет для оплаты «любой монетой».
🔔 Вебхуки (уведомления об оплате)
Когда счёт оплачивается или истекает, Mintar присылает POST на callback_url (указанный у ключа или у счёта):
{
"event": "invoice.paid",
"invoice_id": "a1b2c3d4e5",
"amount": 25,
"received": 25.01,
"network": "tron",
"asset": "USDT-TRC20",
"description": "Заказ #1024",
"tx_hash": "abc123…",
"ts": 1731000000000
}
Заголовки: X-Mintar-Event (тип события), X-Mintar-Delivery (id доставки), X-Mintar-Signature — HMAC-SHA256 от тела запроса с твоим webhook_secret. Отвечай 2xx; иначе повторим через 1 мин, 5 мин, 30 мин, 2 ч, 6 ч, 24 ч.
Проверка подписи на PHP:
$secret = 'whs_ваш_секрет';
$payload = file_get_contents('php://input');
$sig = $_SERVER['HTTP_X_Mintar_SIGNATURE'] ?? '';
$calc = hash_hmac('sha256', $payload, $secret);
if (!hash_equals($calc, $sig)) { http_response_code(403); exit; }
$data = json_decode($payload, true);
if (($data['event'] ?? '') === 'invoice.paid') {
// $data['invoice_id'], $data['amount'], $data['description'] — заказ оплачен
}
http_response_code(200);
Python (FastAPI):
import hmac, hashlib
from fastapi import Request, HTTPException
@app.post("/webhook")
async def webhook(request: Request):
body = await request.body()
sig = request.headers.get("x-mintar-signature", "")
calc = hmac.new(SECRET.encode(), body, hashlib.sha256).hexdigest()
if not hmac.compare_digest(calc, sig):
raise HTTPException(403)
data = await request.json()
if data.get("event") == "invoice.paid":
... # зачислить заказ
return {"ok": True}
Node.js (Express):
const crypto = require('crypto');
app.post('/webhook', express.raw({ type: '*/*' }), (req, res) => {
const calc = crypto.createHmac('sha256', SECRET).update(req.body).digest('hex');
if (calc !== req.header('X-Mintar-Signature')) return res.status(403).end();
const data = JSON.parse(req.body);
if (data.event === 'invoice.paid') { /* заказ оплачен */ }
res.sendStatus(200);
});
⚠️ Проверяй подпись всегда — иначе кто угодно сможет прислать тебе фейковое «оплачено».
🛒 Полный пример: PHP + заказ
// 1) при оформлении заказа
$inv = json_decode(file_get_contents('https://mintar.ormanto.com/api/v1/invoices', false,
stream_context_create(['http' => ['method' => 'POST',
'header' => "Authorization: Bearer kpk_ваш_ключ\r\nContent-Type: application/json\r\n",
'content' => json_encode(['amount' => $orderTotal, 'network' => 'tron',
'description' => "Заказ #$orderId"]),
]])), true);
header('Location: ' . $inv['invoice']['pay_url']); // покупатель платит
// 2) вебхук /webhook из примера выше зачисляет заказ
🤖 Авто-выплаты
В Mini App → ⚙️ Настройки → «Настройка выплат» можно включить автоматические выплаты: когда баланс дорастёт до порога (например, 50 USDT), система сама переведёт USDT на заданные адреса. Между попытками — пауза 30 минут.
💵 Способы оплаты покупателем
- USDT напрямую — TRON (TRC-20), BNB Chain (BEP-20), Polygon, Arbitrum, Base.
- Любая монета — BTC, ETH, SOL, BNB, TRX, XRP, ZEC, LTC, DOGE: покупатель переводит монету, сервис обмена конвертирует её в USDT автоматически (5–15 минут), счёт закрывается сам.
Список монет можно получить из GET /api/v1/info (поле swap_currencies).
❗ Ошибки
| Код | Когда |
invalid_api_key | Нет/неверен заголовок Authorization (401) |
invalid_amount | Сумма ≤ 0 или > 1 000 000 |
invalid_network | Неизвестная сеть |
invalid_callback_url | callback_url не http(s) |
not_found | Счёт не найден или чужой (404) |
Crypto payment gateway for online shops, forex brokers and services. Customers pay with USDT or any coin (BTC, ETH, SOL, TRX…) — the merchant always receives USDT. Settlement is fully automatic.
🚀 Connect in 4 steps
1. Create an API key: Mintar bot → 🪙 → API tab → “Create key”. The kpk_… key and the webhook secret are shown once — save them.
2. Create an invoice from your server — the response contains a pay_url:
curl -X POST https://mintar.ormanto.com/api/v1/invoices \
-H "Authorization: Bearer kpk_your_key" \
-H "Content-Type: application/json" \
-d '{"amount": 25, "network": "tron", "description": "Order #1024"}'
3. Send the customer to pay_url: they pay with USDT or any coin (BTC, ETH, SOL…), conversion to USDT is automatic.
4. Your callback_url receives an invoice.paid webhook signed with HMAC-SHA256 — verify the signature and credit the order. Done.
🌐 Calling the API from a browser (site frontend, not a server)? Add the frontend domain to CORS_ORIGINS in .env and restart the bot — otherwise the browser will block the requests.
POST Create invoice
POST /api/v1/invoices · header Authorization: Bearer kpk_…
| Field | Type | Description |
amount | number | Amount in USDT (0.01–1,000,000). Required. |
network | string | USDT network: tron (default), bsc, polygon, arbitrum, base. |
description | string | Order reference, up to 200 chars. Echoed in the webhook. |
callback_url | string | Per-invoice webhook URL (overrides the key's URL). |
curl -X POST https://mintar.ormanto.com/api/v1/invoices \
-H "Authorization: Bearer kpk_your_key" \
-H "Content-Type: application/json" \
-d '{"amount": 25, "network": "tron", "description": "Order #1024"}'
Response:
{
"ok": true,
"invoice": {
"id": "a1b2c3d4e5",
"amount": 25,
"status": "pending",
"network": "tron",
"network_label": "TRON",
"deposit_address": "T…",
"pay_url": "https://mintar.ormanto.com/pay/a1b2c3d4e5",
"expires_at": 1731000000000
}
}
GET Invoice status
GET /api/v1/invoices/<id> — statuses: pending → paid / expired. Same fields as on creation plus received and last_tx.
GET Balances & info
GET /api/v1/balance — merchant balances per network. Crediting is 0% — everything that arrives lands on the balance; the 0.5% gateway fee and the network fee (at cost) are deducted once, on payout.
GET /api/v1/info — networks, fee, coins available for “pay with any coin”.
🔔 Webhooks
When an invoice is paid or expires, Mintar sends a POST to your callback_url:
{
"event": "invoice.paid",
"invoice_id": "a1b2c3d4e5",
"amount": 25,
"received": 25.01,
"network": "tron",
"asset": "USDT-TRC20",
"description": "Order #1024",
"tx_hash": "abc123…",
"ts": 1731000000000
}
Headers: X-Mintar-Event, X-Mintar-Delivery, X-Mintar-Signature — HMAC-SHA256 of the raw body using your webhook_secret. Respond with 2xx; otherwise we retry after 1 min, 5 min, 30 min, 2 h, 6 h, 24 h.
Signature verification (Python / FastAPI):
import hmac, hashlib
from fastapi import Request, HTTPException
@app.post("/webhook")
async def webhook(request: Request):
body = await request.body()
calc = hmac.new(SECRET.encode(), body, hashlib.sha256).hexdigest()
if not hmac.compare_digest(calc, request.headers.get("x-mintar-signature", "")):
raise HTTPException(403)
data = await request.json()
if data.get("event") == "invoice.paid":
... # credit the order
return {"ok": True}
⚠️ Always verify the signature — otherwise anyone could send you a fake “paid” notification.
🛒 Full example: Node.js checkout
// create an invoice when the customer checks out
const res = await fetch('https://mintar.ormanto.com/api/v1/invoices', {
method: 'POST',
headers: { Authorization: 'Bearer kpk_your_key', 'Content-Type': 'application/json' },
body: JSON.stringify({ amount: order.total, network: 'tron',
description: 'Order #' + order.id }),
});
const { invoice } = await res.json();
res.redirect(invoice.pay_url); // customer pays
// webhook endpoint verifies the signature and credits the order
🤖 Auto payouts
In the Mini App → 🔌 API you can enable automatic payouts: once the balance reaches a threshold (e.g. 50 USDT), the system sends USDT to your payout addresses by itself. 30-minute cooldown between attempts.
💵 Customer payment methods
- Direct USDT — TRON (TRC-20), BNB Chain (BEP-20), Polygon, Arbitrum, Base.
- Any coin — BTC, ETH, SOL, BNB, TRX, XRP, ZEC, LTC, DOGE: the customer sends a coin, the exchange service converts it to USDT automatically (5–15 min), the invoice closes by itself.
Available coins: GET /api/v1/info (swap_currencies field).
❗ Errors
| Code | When |
invalid_api_key | Missing/invalid Authorization header (401) |
invalid_amount | Amount ≤ 0 or > 1,000,000 |
invalid_network | Unknown network |
invalid_callback_url | callback_url is not http(s) |
not_found | Invoice not found or not yours (404) |