curl --request POST \
--url https://api.example.com/v1/public/invoices \
--header 'Content-Type: application/json' \
--header 'X-Signature: <api-key>' \
--data '
{
"assetCode": "<string>",
"amount": "100.50",
"amountUsd": "50.00",
"ttlMinutes": 60,
"orderId": "<string>",
"title": "<string>",
"description": "<string>",
"sweepDestinationWalletUuid": "<string>",
"urlReturn": "https://shop.example/cart",
"urlSuccess": "https://shop.example/thanks",
"urlCallback": "https://shop.example/hooks/wallet",
"accuracyPaymentPercent": 50,
"allowTopUp": true
}
'import requests
url = "https://api.example.com/v1/public/invoices"
payload = {
"assetCode": "<string>",
"amount": "100.50",
"amountUsd": "50.00",
"ttlMinutes": 60,
"orderId": "<string>",
"title": "<string>",
"description": "<string>",
"sweepDestinationWalletUuid": "<string>",
"urlReturn": "https://shop.example/cart",
"urlSuccess": "https://shop.example/thanks",
"urlCallback": "https://shop.example/hooks/wallet",
"accuracyPaymentPercent": 50,
"allowTopUp": True
}
headers = {
"X-Signature": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Signature': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
assetCode: '<string>',
amount: '100.50',
amountUsd: '50.00',
ttlMinutes: 60,
orderId: '<string>',
title: '<string>',
description: '<string>',
sweepDestinationWalletUuid: '<string>',
urlReturn: 'https://shop.example/cart',
urlSuccess: 'https://shop.example/thanks',
urlCallback: 'https://shop.example/hooks/wallet',
accuracyPaymentPercent: 50,
allowTopUp: true
})
};
fetch('https://api.example.com/v1/public/invoices', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/public/invoices",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'assetCode' => '<string>',
'amount' => '100.50',
'amountUsd' => '50.00',
'ttlMinutes' => 60,
'orderId' => '<string>',
'title' => '<string>',
'description' => '<string>',
'sweepDestinationWalletUuid' => '<string>',
'urlReturn' => 'https://shop.example/cart',
'urlSuccess' => 'https://shop.example/thanks',
'urlCallback' => 'https://shop.example/hooks/wallet',
'accuracyPaymentPercent' => 50,
'allowTopUp' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Signature: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/public/invoices"
payload := strings.NewReader("{\n \"assetCode\": \"<string>\",\n \"amount\": \"100.50\",\n \"amountUsd\": \"50.00\",\n \"ttlMinutes\": 60,\n \"orderId\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"sweepDestinationWalletUuid\": \"<string>\",\n \"urlReturn\": \"https://shop.example/cart\",\n \"urlSuccess\": \"https://shop.example/thanks\",\n \"urlCallback\": \"https://shop.example/hooks/wallet\",\n \"accuracyPaymentPercent\": 50,\n \"allowTopUp\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Signature", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/public/invoices")
.header("X-Signature", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"assetCode\": \"<string>\",\n \"amount\": \"100.50\",\n \"amountUsd\": \"50.00\",\n \"ttlMinutes\": 60,\n \"orderId\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"sweepDestinationWalletUuid\": \"<string>\",\n \"urlReturn\": \"https://shop.example/cart\",\n \"urlSuccess\": \"https://shop.example/thanks\",\n \"urlCallback\": \"https://shop.example/hooks/wallet\",\n \"accuracyPaymentPercent\": 50,\n \"allowTopUp\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/public/invoices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Signature"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"assetCode\": \"<string>\",\n \"amount\": \"100.50\",\n \"amountUsd\": \"50.00\",\n \"ttlMinutes\": 60,\n \"orderId\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"sweepDestinationWalletUuid\": \"<string>\",\n \"urlReturn\": \"https://shop.example/cart\",\n \"urlSuccess\": \"https://shop.example/thanks\",\n \"urlCallback\": \"https://shop.example/hooks/wallet\",\n \"accuracyPaymentPercent\": 50,\n \"allowTopUp\": true\n}"
response = http.request(request)
puts response.read_body{
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"orderId": "<string>",
"token": "<string>",
"payPath": "/invoice/abc123",
"assetCode": "USDT_TRC20",
"network": "TRON",
"address": "<string>",
"memo": "<string>",
"amount": "100.50",
"amountUsd": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"status": "pending",
"payUrl": "<string>",
"urlReturn": "<string>",
"urlSuccess": "<string>",
"urlCallback": "<string>",
"theme": "light",
"locale": "ru",
"receivedAmount": "<string>",
"txhash": "<string>",
"createdAt": "2023-11-07T05:31:56Z"
}Create invoice (payment link) — for exchanger CMS
Создаёт счёт для вызывающего сайта и возвращает ссылку оплаты (payPath / payUrl + token). При оплате вебхуки депозита уйдут на callback_url сайта (или на urlCallback счёта) с вашим order_id. 1.4.0: urlReturn (кнопка «вернуться»), urlSuccess (авто-редирект после оплаты с ?order_id&invoice&status), urlCallback, theme (light|dark|auto), locale (ru|en).
curl --request POST \
--url https://api.example.com/v1/public/invoices \
--header 'Content-Type: application/json' \
--header 'X-Signature: <api-key>' \
--data '
{
"assetCode": "<string>",
"amount": "100.50",
"amountUsd": "50.00",
"ttlMinutes": 60,
"orderId": "<string>",
"title": "<string>",
"description": "<string>",
"sweepDestinationWalletUuid": "<string>",
"urlReturn": "https://shop.example/cart",
"urlSuccess": "https://shop.example/thanks",
"urlCallback": "https://shop.example/hooks/wallet",
"accuracyPaymentPercent": 50,
"allowTopUp": true
}
'import requests
url = "https://api.example.com/v1/public/invoices"
payload = {
"assetCode": "<string>",
"amount": "100.50",
"amountUsd": "50.00",
"ttlMinutes": 60,
"orderId": "<string>",
"title": "<string>",
"description": "<string>",
"sweepDestinationWalletUuid": "<string>",
"urlReturn": "https://shop.example/cart",
"urlSuccess": "https://shop.example/thanks",
"urlCallback": "https://shop.example/hooks/wallet",
"accuracyPaymentPercent": 50,
"allowTopUp": True
}
headers = {
"X-Signature": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Signature': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
assetCode: '<string>',
amount: '100.50',
amountUsd: '50.00',
ttlMinutes: 60,
orderId: '<string>',
title: '<string>',
description: '<string>',
sweepDestinationWalletUuid: '<string>',
urlReturn: 'https://shop.example/cart',
urlSuccess: 'https://shop.example/thanks',
urlCallback: 'https://shop.example/hooks/wallet',
accuracyPaymentPercent: 50,
allowTopUp: true
})
};
fetch('https://api.example.com/v1/public/invoices', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/public/invoices",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'assetCode' => '<string>',
'amount' => '100.50',
'amountUsd' => '50.00',
'ttlMinutes' => 60,
'orderId' => '<string>',
'title' => '<string>',
'description' => '<string>',
'sweepDestinationWalletUuid' => '<string>',
'urlReturn' => 'https://shop.example/cart',
'urlSuccess' => 'https://shop.example/thanks',
'urlCallback' => 'https://shop.example/hooks/wallet',
'accuracyPaymentPercent' => 50,
'allowTopUp' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Signature: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/public/invoices"
payload := strings.NewReader("{\n \"assetCode\": \"<string>\",\n \"amount\": \"100.50\",\n \"amountUsd\": \"50.00\",\n \"ttlMinutes\": 60,\n \"orderId\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"sweepDestinationWalletUuid\": \"<string>\",\n \"urlReturn\": \"https://shop.example/cart\",\n \"urlSuccess\": \"https://shop.example/thanks\",\n \"urlCallback\": \"https://shop.example/hooks/wallet\",\n \"accuracyPaymentPercent\": 50,\n \"allowTopUp\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Signature", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/public/invoices")
.header("X-Signature", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"assetCode\": \"<string>\",\n \"amount\": \"100.50\",\n \"amountUsd\": \"50.00\",\n \"ttlMinutes\": 60,\n \"orderId\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"sweepDestinationWalletUuid\": \"<string>\",\n \"urlReturn\": \"https://shop.example/cart\",\n \"urlSuccess\": \"https://shop.example/thanks\",\n \"urlCallback\": \"https://shop.example/hooks/wallet\",\n \"accuracyPaymentPercent\": 50,\n \"allowTopUp\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/public/invoices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Signature"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"assetCode\": \"<string>\",\n \"amount\": \"100.50\",\n \"amountUsd\": \"50.00\",\n \"ttlMinutes\": 60,\n \"orderId\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"sweepDestinationWalletUuid\": \"<string>\",\n \"urlReturn\": \"https://shop.example/cart\",\n \"urlSuccess\": \"https://shop.example/thanks\",\n \"urlCallback\": \"https://shop.example/hooks/wallet\",\n \"accuracyPaymentPercent\": 50,\n \"allowTopUp\": true\n}"
response = http.request(request)
puts response.read_body{
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"orderId": "<string>",
"token": "<string>",
"payPath": "/invoice/abc123",
"assetCode": "USDT_TRC20",
"network": "TRON",
"address": "<string>",
"memo": "<string>",
"amount": "100.50",
"amountUsd": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"status": "pending",
"payUrl": "<string>",
"urlReturn": "<string>",
"urlSuccess": "<string>",
"urlCallback": "<string>",
"theme": "light",
"locale": "ru",
"receivedAmount": "<string>",
"txhash": "<string>",
"createdAt": "2023-11-07T05:31:56Z"
}Authorizations
HMAC-SHA256-Hex(timestamp + "." + raw_body, api_secret)
Body
Код актива (TRX, USDT_TRC20, GRAM, USDT_TON, …).
Сумма к оплате в АКТИВЕ (decimal-строка; строго > 0). Ровно одно из amount / amountUsd.
"100.50"
USD-пег: сумма счёта в долларах; крипто-сумма фиксируется по курсу на момент выставления. Ровно одно из amount / amountUsd. 409 PROVIDER_UNAVAILABLE если у оракула нет курса актива.
"50.00"
Срок действия в минутах (по умолчанию 60). После — счёт просрочен, ссылка живёт ещё 1 день.
5 <= x <= 43200Ваш order_id. Если не указан — сгенерируется. Уникален в рамках сайта.
Заголовок/назначение (показывается клиенту).
Описание (показывается клиенту).
UUID системного кошелька-получателя свипа после оплаты. Не указан → дефолтная маршрутизация. Кошелёк должен быть active, той же сети что актив, роли hot/admin/payout/cold.
Ссылка «Вернуться в магазин» на странице оплаты (http/https).
"https://shop.example/cart"
Куда автоматически перенаправить клиента после подтверждённой оплаты (через 5 с, с кнопкой). Платформа добавит query: ?order_id=…&invoice=&status=paid|overpaid.
"https://shop.example/thanks"
Webhook-URL именно для этого счёта — события депозита счёта уйдут сюда вместо callback_url сайта (подпись тем же секретом сайта). Приватные адреса — по настройке webhook.allow_private_urls.
"https://shop.example/hooks/wallet"
Тема страницы оплаты. По умолчанию — настройка сайта / auto.
light, dark, auto Язык страницы оплаты. По умолчанию — настройка сайта / ru.
ru, en 1.4.0: допуск недоплаты (%) для депозита счёта.
0 <= x <= 1001.4.0: режим доплаты — при недоплате клиент может дослать остаток на тот же адрес.
Response
Ваш order_id (или сгенерированный).
Публичный токен ссылки.
Путь страницы оплаты. Абсолютная ссылка: https://<ваш-домен-кошелька>{payPath}.
"/invoice/abc123"
"USDT_TRC20"
"TRON"
Адрес для оплаты.
Memo (для memo-based сетей).
"100.50"
USD-пег счёта (null = счёт выставлен в активе).
pending, detected, paid, overpaid, underpaid, underpaid_waiting, refunded, expired 1.4.0: абсолютная ссылка на страницу оплаты (если оператор задал базовый адрес).
light, dark, auto ru, en Полученная сумма (после детекции tx).