РАЗРАБОТЧИКАМ
Справочник API
Все эндпоинты REST SMetaGateway, сгенерированные из контракта OpenAPI 3.1. Используйте bearer-ключи API на сервере; суммы — десятичные строки.
- Базовый URL
https://smg.sabco24.com/api/v1- Версия
0.2.0 · OpenAPI 3.1
Эндпоинты
Все операции, сгруппированные по ресурсам.
| Метод | Путь | Описание | Доступ |
|---|
| Система |
|---|
| GET | /health | Проверить состояние сервиса и режим шлюза. | Публичный |
| GET | /config | Получить публичную конфигурацию клиента, включая ключ сайта капчи. | Публичный |
| Аутентификация |
|---|
| POST | /auth/register | Зарегистрировать продавца и открыть сессию владельца. | Публичный |
| POST | /auth/login | Войти и открыть сессию владельца. | Публичный |
| POST | /auth/verify-email | Подтвердить email по ссылке из письма и открыть сессию владельца. | Публичный |
| POST | /auth/password/forgot | Отправить ссылку для сброса пароля на email. | Публичный |
| POST | /auth/password/reset | Задать новый пароль по ссылке для сброса и войти. | Публичный |
| POST | /auth/google | Войти или зарегистрироваться через Google и открыть сессию владельца. | Публичный |
| GET | /auth/session | Проверить, выполнен ли вход в этом браузере. | Публичный |
| POST | /auth/logout | Завершить текущую сессию владельца. | Публичный |
| Аккаунт |
|---|
| GET | /me | Получить аккаунт, кошельки, счета, ключи, вебхуки и статистику. | Сессия владельца |
| PATCH | /me | Изменить отображаемое имя продавца. | Сессия владельца |
| Кошельки |
|---|
| GET | /wallets | Список зарегистрированных адресов. | Ключ API или сессия |
| POST | /wallets | Зарегистрировать адрес TRON с корректной контрольной суммой (владение не проверено). | Сессия владельца |
| Счета |
|---|
| GET | /invoices | Последние 500 счетов. | Ключ API или сессия |
| POST | /invoices | Создать счёт и зарезервировать уникальную точную сумму на 90 дней. | Ключ API или сессия |
| GET | /invoices/{id} | Получить счёт этого продавца. | Ключ API или сессия |
| Оплата |
|---|
| GET | /checkout/{token} | Получить безопасные для плательщика данные оплаты по токену. | Публичный |
| Ключи API |
|---|
| POST | /api-keys | Создать API-ключ с необязательным сроком действия; секрет показывается один раз. | Сессия владельца |
| POST | /api-keys/{id}/roll | Заменить API-ключ новым секретом с тем же именем и сроком. | Сессия владельца |
| DELETE | /api-keys/{id} | Немедленно отозвать ключ API. | Сессия владельца |
| Реестр |
|---|
| GET | /ledger.csv | Выгрузить полный операционный реестр в CSV. | Ключ API или сессия |
| Вебхуки |
|---|
| POST | /webhooks | Зарегистрировать публичный HTTPS-вебхук; секрет подписи показывается один раз. | Сессия владельца |
| DELETE | /webhooks/{id} | Отключить эндпоинт и отменить ожидающие доставки. | Сессия владельца |
| POST | /webhooks/{id}/test | Отправить подписанное событие webhook.test. | Сессия владельца |
| POST | /webhooks/deliveries/{id}/retry | Повторить неудачную или ожидающую доставку вебхука. | Сессия владельца |
| Поддержка |
|---|
| POST | /support/chat | Начать чат на сайте с именем, email и первым сообщением; возвращает приватный токен чата. | Публичный |
| GET | /support/chat | Прочитать чат на сайте по его токену. | Публичный |
| POST | /support/chat/messages | Отправить ещё одно сообщение в чат на сайте; закрытый чат открывается снова. | Публичный |
| POST | /support/contact | Написать в поддержку без аккаунта. | Публичный |
| GET | /support/tickets | Список ваших обращений. | Сессия владельца |
| POST | /support/tickets | Создать обращение в поддержку. | Сессия владельца |
| GET | /support/tickets/{id} | Прочитать обращение вместе с сообщениями. | Сессия владельца |
| POST | /support/tickets/{id}/messages | Ответить в обращении; закрытое обращение откроется снова. | Сессия владельца |
| POST | /support/tickets/{id}/close | Закрыть обращение. | Сессия владельца |
| GET | /support/inbox | Служба поддержки: все обращения, сначала открытые. | Сессия владельца |
| GET | /support/inbox/{id} | Служба поддержки: обращение с контактными данными. | Сессия владельца |
| POST | /support/inbox/{id}/messages | Служба поддержки: ответить мерчанту. | Сессия владельца |
| POST | /support/inbox/{id}/status | Служба поддержки: изменить статус обращения. | Сессия владельца |
Система
GET/api/v1/health
ПубличныйПроверить состояние сервиса и режим шлюза.
Возвращает: 200 application/json
| Поле | Тип | Обязательно | Описание |
|---|
status | "ok" | Нет | |
mode | "live" | Нет | Invoices are confirmed from verified TRON mainnet transfers. |
live_payments_enabled | true | Нет | |
Ответы
200Success400Validation error401Authentication required403Insufficient scope or invalid origin404Resource not found409Conflict, exhausted amount pool or manual review required429Rate limit exceeded500Internal server error
curl -X GET "https://smg.sabco24.com/api/v1/health"
GET/api/v1/config
ПубличныйПолучить публичную конфигурацию клиента, включая ключ сайта капчи.
captcha is null when Cloudflare Turnstile is not configured; otherwise send captcha_token with sign-in, registration, contact and chat requests. google is null when Google sign-in is not configured.
Возвращает: 200 application/json
| Поле | Тип | Обязательно | Описание |
|---|
captcha | object | Да | |
google | object | Да | |
Ответы
200Success400Validation error401Authentication required403Insufficient scope or invalid origin404Resource not found409Conflict, exhausted amount pool or manual review required429Rate limit exceeded500Internal server error
curl -X GET "https://smg.sabco24.com/api/v1/config"
Аутентификация
POST/api/v1/auth/register
ПубличныйЗарегистрировать продавца и открыть сессию владельца.
No session is started. The account can sign in after the emailed link (valid 24 hours, single use) is confirmed with POST /auth/verify-email. Answers 503 email_unavailable when the server cannot send email.
Тело запроса
| Поле | Тип | Обязательно | Описание |
|---|
email | string (email) | Да | |
password | string (password) | Да | length 12–128 |
captcha_token | string | Нет | Cloudflare Turnstile response token. Required when GET /config returns a captcha site key; each token is single use. — length 0–2048 |
name | string | Нет | length 0–100 |
locale | "en" | "fa" | "ar" | "zh" | "es" | "fr" | "ru" | Нет | Language of the email. — default "en" |
Возвращает: 201 application/json
| Поле | Тип | Обязательно | Описание |
|---|
verification_required | true | Да | |
email | string (email) | Да | |
email_sent | boolean | Да | False when the SMTP server rejected the message; signing in later sends a new link. |
Ответы
201Account created; confirmation email sent400Validation error401Authentication required403Insufficient scope or invalid origin404Resource not found409Conflict, exhausted amount pool or manual review required429Rate limit exceeded500Internal server error503Email delivery is not configured (email_unavailable) or captcha verification is unavailable
curl -X POST "https://smg.sabco24.com/api/v1/auth/register" \
-H "Content-Type: application/json" \
-d '{"name":"Example Store","email":"merchant@example.com","password":"a-long-unique-passphrase","locale":"en"}'
POST/api/v1/auth/login
ПубличныйВойти и открыть сессию владельца.
An account whose email is not yet confirmed answers 403 email_not_verified after a correct password, and a new confirmation link is emailed at most every 5 minutes.
Тело запроса
| Поле | Тип | Обязательно | Описание |
|---|
email | string (email) | Да | |
password | string (password) | Да | length 10–128 |
captcha_token | string | Нет | Cloudflare Turnstile response token. Required when GET /config returns a captcha site key; each token is single use. — length 0–2048 |
locale | "en" | "fa" | "ar" | "zh" | "es" | "fr" | "ru" | Нет | Language of the email. — default "en" |
Возвращает: 200 application/json
| Поле | Тип | Обязательно | Описание |
|---|
merchant | Merchant | Нет | |
Ответы
200Success400Validation error401Authentication required403Insufficient scope or invalid origin404Resource not found409Conflict, exhausted amount pool or manual review required429Rate limit exceeded500Internal server error503Captcha verification is temporarily unavailable
curl -X POST "https://smg.sabco24.com/api/v1/auth/login" \
-H "Content-Type: application/json" \
-d '{"email":"merchant@example.com","password":"a-long-unique-passphrase"}'
POST/api/v1/auth/verify-email
ПубличныйПодтвердить email по ссылке из письма и открыть сессию владельца.
token comes from the #verify= fragment of the emailed link. Tokens are single use; a newer email replaces older links.
Тело запроса
| Поле | Тип | Обязательно | Описание |
|---|
token | string | Да | Single-use token from the emailed link. — pattern ^[A-Za-z0-9_-]{43}$ |
Возвращает: 200 application/json
| Поле | Тип | Обязательно | Описание |
|---|
merchant | Merchant | Нет | |
Ответы
200Success400Validation error401Authentication required403Insufficient scope or invalid origin404Resource not found409Conflict, exhausted amount pool or manual review required429Rate limit exceeded500Internal server error
curl -X POST "https://smg.sabco24.com/api/v1/auth/verify-email" \
-H "Content-Type: application/json" \
-d '{"token":"TOKEN_FROM_THE_EMAILED_LINK"}'
POST/api/v1/auth/password/forgot
ПубличныйОтправить ссылку для сброса пароля на email.
Always answers 202 whether or not an account exists. The link is valid for 1 hour and single use.
Тело запроса
| Поле | Тип | Обязательно | Описание |
|---|
email | string (email) | Да | |
captcha_token | string | Нет | Cloudflare Turnstile response token. Required when GET /config returns a captcha site key; each token is single use. — length 0–2048 |
locale | "en" | "fa" | "ar" | "zh" | "es" | "fr" | "ru" | Нет | Language of the email. — default "en" |
Возвращает: 202 application/json
| Поле | Тип | Обязательно | Описание |
|---|
success | true | Да | |
Ответы
202Accepted400Validation error401Authentication required403Insufficient scope or invalid origin404Resource not found409Conflict, exhausted amount pool or manual review required429Rate limit exceeded500Internal server error503Email delivery is not configured (email_unavailable) or captcha verification is unavailable
curl -X POST "https://smg.sabco24.com/api/v1/auth/password/forgot" \
-H "Content-Type: application/json" \
-d '{"email":"merchant@example.com","locale":"en"}'
POST/api/v1/auth/password/reset
ПубличныйЗадать новый пароль по ссылке для сброса и войти.
token comes from the #reset= fragment of the emailed link. Every existing session of the account is revoked, and the email counts as confirmed.
Тело запроса
| Поле | Тип | Обязательно | Описание |
|---|
token | string | Да | Single-use token from the emailed link. — pattern ^[A-Za-z0-9_-]{43}$ |
password | string (password) | Да | length 12–128 |
Возвращает: 200 application/json
| Поле | Тип | Обязательно | Описание |
|---|
merchant | Merchant | Нет | |
Ответы
200Success400Validation error401Authentication required403Insufficient scope or invalid origin404Resource not found409Conflict, exhausted amount pool or manual review required429Rate limit exceeded500Internal server error
curl -X POST "https://smg.sabco24.com/api/v1/auth/password/reset" \
-H "Content-Type: application/json" \
-d '{"token":"TOKEN_FROM_THE_EMAILED_LINK","password":"a-new-long-unique-passphrase"}'
POST/api/v1/auth/google
ПубличныйВойти или зарегистрироваться через Google и открыть сессию владельца.
Send the credential returned by Google Identity Services. The server verifies the RS256 signature against Google keys, the issuer, audience (GOOGLE_CLIENT_ID), expiry and email_verified. A new email creates an account (201). An existing confirmed account with the same email is linked to the Google account on first use; an unconfirmed one is claimed by the Google owner and its password stops working.
Тело запроса
| Поле | Тип | Обязательно | Описание |
|---|
credential | string | Да | Google ID token (JWT). — length 20–4096 |
Возвращает: 200 application/json
| Поле | Тип | Обязательно | Описание |
|---|
merchant | Merchant | Нет | |
Ответы
200Signed in201Account created400Validation error401Authentication required403Insufficient scope or invalid origin404Resource not found409Conflict, exhausted amount pool or manual review required429Rate limit exceeded500Internal server error503Google keys are temporarily unreachable
curl -X POST "https://smg.sabco24.com/api/v1/auth/google" \
-H "Content-Type: application/json" \
-d '{"credential":"GOOGLE_ID_TOKEN_FROM_GOOGLE_IDENTITY_SERVICES"}'
GET/api/v1/auth/session
ПубличныйПроверить, выполнен ли вход в этом браузере.
Возвращает: 200 application/json
| Поле | Тип | Обязательно | Описание |
|---|
signed_in | boolean | Да | |
Ответы
200Success400Validation error401Authentication required403Insufficient scope or invalid origin404Resource not found409Conflict, exhausted amount pool or manual review required429Rate limit exceeded500Internal server error
curl -X GET "https://smg.sabco24.com/api/v1/auth/session"
POST/api/v1/auth/logout
ПубличныйЗавершить текущую сессию владельца.
Возвращает: 200 application/json
| Поле | Тип | Обязательно | Описание |
|---|
success | true | Да | |
Ответы
200Success400Validation error401Authentication required403Insufficient scope or invalid origin404Resource not found409Conflict, exhausted amount pool or manual review required429Rate limit exceeded500Internal server error
curl -X POST "https://smg.sabco24.com/api/v1/auth/logout" \
-H "Content-Type: application/json" \
-d '{}'
Аккаунт
GET/api/v1/me
Сессия владельцаПолучить аккаунт, кошельки, счета, ключи, вебхуки и статистику.
Требуется cookie сессии владельца панели; ключи API для этой операции не принимаются.
Возвращает: 200 Dashboard
Ответы
200Success400Validation error401Authentication required403Insufficient scope or invalid origin404Resource not found409Conflict, exhausted amount pool or manual review required429Rate limit exceeded500Internal server error
curl -X GET "https://smg.sabco24.com/api/v1/me" \
-H "Cookie: smg_session=$SESSION" \
-H "Origin: https://smg.sabco24.com"
PATCH/api/v1/me
Сессия владельцаИзменить отображаемое имя продавца.
Требуется cookie сессии владельца панели; ключи API для этой операции не принимаются.
Тело запроса
| Поле | Тип | Обязательно | Описание |
|---|
name | string | Да | length 1–100 |
Возвращает: 200 Dashboard
Ответы
200Success400Validation error401Authentication required403Insufficient scope or invalid origin404Resource not found409Conflict, exhausted amount pool or manual review required429Rate limit exceeded500Internal server error
curl -X PATCH "https://smg.sabco24.com/api/v1/me" \
-H "Cookie: smg_session=$SESSION" \
-H "Origin: https://smg.sabco24.com" \
-H "Content-Type: application/json" \
-d '{"name":"string"}'
Кошельки
GET/api/v1/wallets
Ключ API или сессияСписок зарегистрированных адресов.
Возвращает: 200 application/json
| Поле | Тип | Обязательно | Описание |
|---|
wallets | Wallet[] | Нет | |
Ответы
200Success400Validation error401Authentication required403Insufficient scope or invalid origin404Resource not found409Conflict, exhausted amount pool or manual review required429Rate limit exceeded500Internal server error
curl -X GET "https://smg.sabco24.com/api/v1/wallets" \
-H "Authorization: Bearer $SMETA_API_KEY"
POST/api/v1/wallets
Сессия владельцаЗарегистрировать адрес TRON с корректной контрольной суммой (владение не проверено).
Требуется cookie сессии владельца панели; ключи API для этой операции не принимаются.
Тело запроса
| Поле | Тип | Обязательно | Описание |
|---|
label | string | Да | length 1–80 |
address | string | Да | pattern ^T[1-9A-HJ-NP-Za-km-z]{33}$ |
Возвращает: 200 application/json
| Поле | Тип | Обязательно | Описание |
|---|
wallet | Wallet | Нет | |
Ответы
200Existing address201Registered400Validation error401Authentication required403Insufficient scope or invalid origin404Resource not found409Conflict, exhausted amount pool or manual review required429Rate limit exceeded500Internal server error
curl -X POST "https://smg.sabco24.com/api/v1/wallets" \
-H "Cookie: smg_session=$SESSION" \
-H "Origin: https://smg.sabco24.com" \
-H "Content-Type: application/json" \
-d '{"label":"Main business wallet","address":"T_YOUR_PUBLIC_TRON_ADDRESS"}'
Счета
GET/api/v1/invoices
Ключ API или сессияПоследние 500 счетов.
Возвращает: 200 application/json
| Поле | Тип | Обязательно | Описание |
|---|
invoices | Invoice[] | Нет | |
Ответы
200Success400Validation error401Authentication required403Insufficient scope or invalid origin404Resource not found409Conflict, exhausted amount pool or manual review required429Rate limit exceeded500Internal server error
curl -X GET "https://smg.sabco24.com/api/v1/invoices" \
-H "Authorization: Bearer $SMETA_API_KEY"
POST/api/v1/invoices
Ключ API или сессияСоздать счёт и зарезервировать уникальную точную сумму на 90 дней.
Amount allocation is global for (network, token contract, receiving address, final payable micro-units), including merchants sharing an address. Reservations outlive invoice expiry. Historical amount reuse is assigned review status. The invoice is confirmed only when a verified TRON transfer of exactly payable_amount reaches wallet_address between creation and expiry.
Обязательные заголовки
| Поле | Тип | Обязательно | Описание |
|---|
Idempotency-Key | string | Да | Уникальный ключ для каждой попытки создания счёта; используйте его повторно при ретраях. |
| Поле | Тип | Обязательно | Описание |
|---|
merchant_order_id | string | Да | Unique per merchant. Reuse the original idempotency key for retries. — length 1–120 |
amount | string | Да | Base price in USDT; minimum 0.000001, maximum 1000000000. The server adds a disclosed identification adjustment. — pattern ^(0|[1-9][0-9]{0,9})(\.[0-9]{1,6})?$ · e.g. "49.95" |
wallet_id | string | Да | ID of a wallet registered to this merchant. — length 1–100 |
description | string | Нет | length 1–1000 |
metadata | object | Нет | JSON object, at most 16 KiB when serialized. Keep customer secrets out of metadata. |
expires_in_minutes | integer | Нет | range 1–1440 · default 20 |
Возвращает: 200 InvoiceEnvelope
| Поле | Тип | Обязательно | Описание |
|---|
invoice | Invoice | Да | |
idempotent_replay | boolean | Нет | |
Ответы
200Identical idempotent replay201Invoice allocated400Validation error401Authentication required403Insufficient scope or invalid origin404Resource not found409Conflict, exhausted amount pool or manual review required429Rate limit exceeded500Internal server error
curl -X POST "https://smg.sabco24.com/api/v1/invoices" \
-H "Authorization: Bearer $SMETA_API_KEY" \
-H "Idempotency-Key: order-1001" \
-H "Content-Type: application/json" \
-d '{"merchant_order_id":"1001","amount":"49.95","wallet_id":"WALLET_ID","description":"Example order","expires_in_minutes":20}'
GET/api/v1/invoices/{id}
Ключ API или сессияПолучить счёт этого продавца.
Параметры пути
| Поле | Тип | Обязательно | Описание |
|---|
id | string | Да | Invoice ID |
Возвращает: 200 application/json
| Поле | Тип | Обязательно | Описание |
|---|
invoice | Invoice | Нет | |
Ответы
200Success400Validation error401Authentication required403Insufficient scope or invalid origin404Resource not found409Conflict, exhausted amount pool or manual review required429Rate limit exceeded500Internal server error
curl -X GET "https://smg.sabco24.com/api/v1/invoices/ID" \
-H "Authorization: Bearer $SMETA_API_KEY"
Оплата
GET/api/v1/checkout/{token}
ПубличныйПолучить безопасные для плательщика данные оплаты по токену.
Параметры пути
| Поле | Тип | Обязательно | Описание |
|---|
token | string | Да | Checkout capability token from checkout_url |
Возвращает: 200 application/json
Ответы
200Success400Validation error401Authentication required403Insufficient scope or invalid origin404Resource not found409Conflict, exhausted amount pool or manual review required429Rate limit exceeded500Internal server error
curl -X GET "https://smg.sabco24.com/api/v1/checkout/TOKEN"
Ключи API
POST/api/v1/api-keys
Сессия владельцаСоздать API-ключ с необязательным сроком действия; секрет показывается один раз.
Требуется cookie сессии владельца панели; ключи API для этой операции не принимаются.
Тело запроса
| Поле | Тип | Обязательно | Описание |
|---|
name | string | Да | length 1–80 |
expires_in_days | integer | null | Нет | Days until the key expires. Omit or send null for a key that never expires. — range 1–3650 · e.g. 90 |
Возвращает: 201 application/json
| Поле | Тип | Обязательно | Описание |
|---|
api_key | ApiKey & object | Нет | |
secret | string | Нет | |
warning | string | Нет | |
Ответы
201Success400Validation error401Authentication required403Insufficient scope or invalid origin404Resource not found409Conflict, exhausted amount pool or manual review required429Rate limit exceeded500Internal server error
curl -X POST "https://smg.sabco24.com/api/v1/api-keys" \
-H "Cookie: smg_session=$SESSION" \
-H "Origin: https://smg.sabco24.com" \
-H "Content-Type: application/json" \
-d '{"name":"string"}'
POST/api/v1/api-keys/{id}/roll
Сессия владельцаЗаменить API-ключ новым секретом с тем же именем и сроком.
The old key is revoked in the same transaction. The new secret is shown once.
Требуется cookie сессии владельца панели; ключи API для этой операции не принимаются.
Параметры пути
| Поле | Тип | Обязательно | Описание |
|---|
id | string | Да | API key ID |
Возвращает: 201 application/json
| Поле | Тип | Обязательно | Описание |
|---|
api_key | ApiKey & object | Нет | |
secret | string | Нет | |
warning | string | Нет | |
replaced_key_id | string | Нет | |
Ответы
201Success400Validation error401Authentication required403Insufficient scope or invalid origin404Resource not found409Conflict, exhausted amount pool or manual review required429Rate limit exceeded500Internal server error
curl -X POST "https://smg.sabco24.com/api/v1/api-keys/ID/roll" \
-H "Cookie: smg_session=$SESSION" \
-H "Origin: https://smg.sabco24.com" \
-H "Content-Type: application/json" \
-d '{}'
DELETE/api/v1/api-keys/{id}
Сессия владельцаНемедленно отозвать ключ API.
Требуется cookie сессии владельца панели; ключи API для этой операции не принимаются.
Параметры пути
| Поле | Тип | Обязательно | Описание |
|---|
id | string | Да | API key ID |
Возвращает: 200 application/json
| Поле | Тип | Обязательно | Описание |
|---|
success | true | Да | |
Ответы
200Success400Validation error401Authentication required403Insufficient scope or invalid origin404Resource not found409Conflict, exhausted amount pool or manual review required429Rate limit exceeded500Internal server error
curl -X DELETE "https://smg.sabco24.com/api/v1/api-keys/ID" \
-H "Cookie: smg_session=$SESSION" \
-H "Origin: https://smg.sabco24.com"
Реестр
GET/api/v1/ledger.csv
Ключ API или сессияВыгрузить полный операционный реестр в CSV.
Возвращает: 200 text/csv
Ответы
200CSV includes separate base, adjustment and payable columns; not a statutory accounting report.400Validation error401Authentication required403Insufficient scope or invalid origin404Resource not found409Conflict, exhausted amount pool or manual review required429Rate limit exceeded500Internal server error
curl -X GET "https://smg.sabco24.com/api/v1/ledger.csv" \
-H "Authorization: Bearer $SMETA_API_KEY"
Вебхуки
POST/api/v1/webhooks
Сессия владельцаЗарегистрировать публичный HTTPS-вебхук; секрет подписи показывается один раз.
Port 443 only. Local/private targets, IP literals, credentials, URL fragments and redirects are rejected. DNS is resolved and checked again at delivery time.
Требуется cookie сессии владельца панели; ключи API для этой операции не принимаются.
Тело запроса
| Поле | Тип | Обязательно | Описание |
|---|
url | string (uri) | Да | length 0–2048 |
Возвращает: 201 application/json
| Поле | Тип | Обязательно | Описание |
|---|
webhook | Webhook & object | Нет | |
secret | string | Нет | |
Ответы
201Success400Validation error401Authentication required403Insufficient scope or invalid origin404Resource not found409Conflict, exhausted amount pool or manual review required429Rate limit exceeded500Internal server error
curl -X POST "https://smg.sabco24.com/api/v1/webhooks" \
-H "Cookie: smg_session=$SESSION" \
-H "Origin: https://smg.sabco24.com" \
-H "Content-Type: application/json" \
-d '{"url":"https://merchant.example.com/hooks/smeta"}'
DELETE/api/v1/webhooks/{id}
Сессия владельцаОтключить эндпоинт и отменить ожидающие доставки.
Требуется cookie сессии владельца панели; ключи API для этой операции не принимаются.
Параметры пути
| Поле | Тип | Обязательно | Описание |
|---|
id | string | Да | Webhook ID |
Возвращает: 200 application/json
| Поле | Тип | Обязательно | Описание |
|---|
success | true | Да | |
Ответы
200Success400Validation error401Authentication required403Insufficient scope or invalid origin404Resource not found409Conflict, exhausted amount pool or manual review required429Rate limit exceeded500Internal server error
curl -X DELETE "https://smg.sabco24.com/api/v1/webhooks/ID" \
-H "Cookie: smg_session=$SESSION" \
-H "Origin: https://smg.sabco24.com"
POST/api/v1/webhooks/{id}/test
Сессия владельцаОтправить подписанное событие webhook.test.
Требуется cookie сессии владельца панели; ключи API для этой операции не принимаются.
Параметры пути
| Поле | Тип | Обязательно | Описание |
|---|
id | string | Да | Webhook ID |
Возвращает: 200 application/json
Ответы
200Success400Validation error401Authentication required403Insufficient scope or invalid origin404Resource not found409Conflict, exhausted amount pool or manual review required429Rate limit exceeded500Internal server error
curl -X POST "https://smg.sabco24.com/api/v1/webhooks/ID/test" \
-H "Cookie: smg_session=$SESSION" \
-H "Origin: https://smg.sabco24.com" \
-H "Content-Type: application/json" \
-d '{}'
POST/api/v1/webhooks/deliveries/{id}/retry
Сессия владельцаПовторить неудачную или ожидающую доставку вебхука.
Требуется cookie сессии владельца панели; ключи API для этой операции не принимаются.
Параметры пути
| Поле | Тип | Обязательно | Описание |
|---|
id | string | Да | Delivery ID |
Возвращает: 200 application/json
| Поле | Тип | Обязательно | Описание |
|---|
delivery | Delivery | Нет | |
Ответы
200Success400Validation error401Authentication required403Insufficient scope or invalid origin404Resource not found409Conflict, exhausted amount pool or manual review required429Rate limit exceeded500Internal server error
curl -X POST "https://smg.sabco24.com/api/v1/webhooks/deliveries/ID/retry" \
-H "Cookie: smg_session=$SESSION" \
-H "Origin: https://smg.sabco24.com" \
-H "Content-Type: application/json" \
-d '{}'
POSThttps://your-server.example/hooks/smeta
Receive a signed gateway event at your configured URL
Verify HMAC-SHA256(secret, timestamp + "." + original raw body). The signature header is sha256=<lowercase hex>. Reject timestamps outside your five-minute window and deduplicate event IDs. Each retry is freshly signed. GET the saved invoice with your server key and reconcile it before fulfilling once. invoice.confirmed includes the matched on-chain transaction.
Обязательные заголовки
X-SMeta-Event-IdX-SMeta-TimestampX-SMeta-Signature
Ответы
200Persisted successfully or already processed. Any 2xx acknowledges delivery.400Invalid event401Invalid or stale signature503Temporary failure; retry delivery
Поддержка
POST/api/v1/support/chat
ПубличныйНачать чат на сайте с именем, email и первым сообщением; возвращает приватный токен чата.
Opens a ticket from the visitor's first message, name and email. The response contains chat_token, shown only here; send it as X-Support-Chat-Token to read replies and continue. Contact details are never echoed back.
Тело запроса
| Поле | Тип | Обязательно | Описание |
|---|
message | string | Да | length 1–5000 |
name | string | Да | length 1–100 |
email | string (email) | Да | length 0–254 |
captcha_token | string | Нет | Cloudflare Turnstile response token. Required when GET /config returns a captcha site key; each token is single use. — length 0–2048 |
Возвращает: 201 application/json
| Поле | Тип | Обязательно | Описание |
|---|
chat_token | string | Да | Private bearer token for this conversation. |
ticket | object | Да | |
name | string | Да | |
messages | SupportMessage[] | Да | |
Ответы
201Success400Validation error401Authentication required403Insufficient scope or invalid origin404Resource not found409Conflict, exhausted amount pool or manual review required429Rate limit exceeded500Internal server error503Captcha verification is temporarily unavailable
curl -X POST "https://smg.sabco24.com/api/v1/support/chat" \
-H "Content-Type: application/json" \
-d '{"message":"Do you support WooCommerce?","name":"Jane Doe","email":"jane@example.com","captcha_token":"TURNSTILE_RESPONSE_TOKEN"}'
GET/api/v1/support/chat
ПубличныйПрочитать чат на сайте по его токену.
Обязательные заголовки
| Поле | Тип | Обязательно | Описание |
|---|
X-Support-Chat-Token | string | Да | chat_token returned when the chat was started. Keep it private; it is the only key to this conversation. |
Возвращает: 200 application/json
Ответы
200Success400Validation error401Authentication required403Insufficient scope or invalid origin404Resource not found409Conflict, exhausted amount pool or manual review required429Rate limit exceeded500Internal server error
curl -X GET "https://smg.sabco24.com/api/v1/support/chat" \
-H "X-Support-Chat-Token: VALUE"
POST/api/v1/support/chat/messages
ПубличныйОтправить ещё одно сообщение в чат на сайте; закрытый чат открывается снова.
Обязательные заголовки
| Поле | Тип | Обязательно | Описание |
|---|
X-Support-Chat-Token | string | Да | chat_token returned when the chat was started. Keep it private; it is the only key to this conversation. |
Тело запроса
| Поле | Тип | Обязательно | Описание |
|---|
message | string | Да | length 1–5000 |
Возвращает: 201 application/json
Ответы
201Success400Validation error401Authentication required403Insufficient scope or invalid origin404Resource not found409Conflict, exhausted amount pool or manual review required429Rate limit exceeded500Internal server error
curl -X POST "https://smg.sabco24.com/api/v1/support/chat/messages" \
-H "X-Support-Chat-Token: VALUE" \
-H "Content-Type: application/json" \
-d '{"message":"Thanks, that helps."}'
Написать в поддержку без аккаунта.
Creates a ticket that the support team answers by email. Only the reference is returned.
Тело запроса
| Поле | Тип | Обязательно | Описание |
|---|
name | string | Да | length 1–100 |
email | string (email) | Да | length 0–254 |
subject | string | Да | length 1–150 |
category | "general" | "payments" | "technical" | "account" | "other" | Нет | default "general" |
message | string | Да | length 1–5000 |
captcha_token | string | Нет | Cloudflare Turnstile response token. Required when GET /config returns a captcha site key; each token is single use. — length 0–2048 |
Возвращает: 201 application/json
| Поле | Тип | Обязательно | Описание |
|---|
ticket | object | Нет | |
Ответы
201Success400Validation error401Authentication required403Insufficient scope or invalid origin404Resource not found409Conflict, exhausted amount pool or manual review required429Rate limit exceeded500Internal server error503Captcha verification is temporarily unavailable
curl -X POST "https://smg.sabco24.com/api/v1/support/contact" \
-H "Content-Type: application/json" \
-d '{"name":"Jane Doe","email":"jane@example.com","subject":"Question about pricing","category":"general","message":"Do you charge per invoice?","captcha_token":"TURNSTILE_RESPONSE_TOKEN"}'
GET/api/v1/support/tickets
Сессия владельцаСписок ваших обращений.
Требуется cookie сессии владельца панели; ключи API для этой операции не принимаются.
Возвращает: 200 application/json
Ответы
200Success400Validation error401Authentication required403Insufficient scope or invalid origin404Resource not found409Conflict, exhausted amount pool or manual review required429Rate limit exceeded500Internal server error
curl -X GET "https://smg.sabco24.com/api/v1/support/tickets" \
-H "Cookie: smg_session=$SESSION" \
-H "Origin: https://smg.sabco24.com"
POST/api/v1/support/tickets
Сессия владельцаСоздать обращение в поддержку.
Требуется cookie сессии владельца панели; ключи API для этой операции не принимаются.
Тело запроса
| Поле | Тип | Обязательно | Описание |
|---|
subject | string | Да | length 1–150 |
category | "general" | "payments" | "technical" | "account" | "other" | Нет | default "general" |
message | string | Да | length 1–5000 |
Возвращает: 201 SupportThread
Ответы
201Success400Validation error401Authentication required403Insufficient scope or invalid origin404Resource not found409Conflict, exhausted amount pool or manual review required429Rate limit exceeded500Internal server error
curl -X POST "https://smg.sabco24.com/api/v1/support/tickets" \
-H "Cookie: smg_session=$SESSION" \
-H "Origin: https://smg.sabco24.com" \
-H "Content-Type: application/json" \
-d '{"subject":"Webhook signature fails","category":"technical","message":"Deliveries return 401 since yesterday."}'
GET/api/v1/support/tickets/{id}
Сессия владельцаПрочитать обращение вместе с сообщениями.
Требуется cookie сессии владельца панели; ключи API для этой операции не принимаются.
Параметры пути
| Поле | Тип | Обязательно | Описание |
|---|
id | string | Да | Ticket ID |
Возвращает: 200 SupportThread
Ответы
200Success400Validation error401Authentication required403Insufficient scope or invalid origin404Resource not found409Conflict, exhausted amount pool or manual review required429Rate limit exceeded500Internal server error
curl -X GET "https://smg.sabco24.com/api/v1/support/tickets/ID" \
-H "Cookie: smg_session=$SESSION" \
-H "Origin: https://smg.sabco24.com"
POST/api/v1/support/tickets/{id}/messages
Сессия владельцаОтветить в обращении; закрытое обращение откроется снова.
Требуется cookie сессии владельца панели; ключи API для этой операции не принимаются.
Параметры пути
| Поле | Тип | Обязательно | Описание |
|---|
id | string | Да | Ticket ID |
Тело запроса
| Поле | Тип | Обязательно | Описание |
|---|
message | string | Да | length 1–5000 |
Возвращает: 201 SupportThread
Ответы
201Success400Validation error401Authentication required403Insufficient scope or invalid origin404Resource not found409Conflict, exhausted amount pool or manual review required429Rate limit exceeded500Internal server error
curl -X POST "https://smg.sabco24.com/api/v1/support/tickets/ID/messages" \
-H "Cookie: smg_session=$SESSION" \
-H "Origin: https://smg.sabco24.com" \
-H "Content-Type: application/json" \
-d '{"message":"string"}'
POST/api/v1/support/tickets/{id}/close
Сессия владельцаЗакрыть обращение.
Требуется cookie сессии владельца панели; ключи API для этой операции не принимаются.
Параметры пути
| Поле | Тип | Обязательно | Описание |
|---|
id | string | Да | Ticket ID |
Возвращает: 200 SupportThread
Ответы
200Success400Validation error401Authentication required403Insufficient scope or invalid origin404Resource not found409Conflict, exhausted amount pool or manual review required429Rate limit exceeded500Internal server error
curl -X POST "https://smg.sabco24.com/api/v1/support/tickets/ID/close" \
-H "Cookie: smg_session=$SESSION" \
-H "Origin: https://smg.sabco24.com" \
-H "Content-Type: application/json" \
-d '{}'
GET/api/v1/support/inbox
Сессия владельцаСлужба поддержки: все обращения, сначала открытые.
Requires a session for an account listed in SUPPORT_STAFF_EMAILS.
Требуется cookie сессии владельца панели; ключи API для этой операции не принимаются.
Возвращает: 200 application/json
Ответы
200Success400Validation error401Authentication required403Insufficient scope or invalid origin404Resource not found409Conflict, exhausted amount pool or manual review required429Rate limit exceeded500Internal server error
curl -X GET "https://smg.sabco24.com/api/v1/support/inbox" \
-H "Cookie: smg_session=$SESSION" \
-H "Origin: https://smg.sabco24.com"
GET/api/v1/support/inbox/{id}
Сессия владельцаСлужба поддержки: обращение с контактными данными.
Требуется cookie сессии владельца панели; ключи API для этой операции не принимаются.
Параметры пути
| Поле | Тип | Обязательно | Описание |
|---|
id | string | Да | Ticket ID |
Возвращает: 200 SupportThread
Ответы
200Success400Validation error401Authentication required403Insufficient scope or invalid origin404Resource not found409Conflict, exhausted amount pool or manual review required429Rate limit exceeded500Internal server error
curl -X GET "https://smg.sabco24.com/api/v1/support/inbox/ID" \
-H "Cookie: smg_session=$SESSION" \
-H "Origin: https://smg.sabco24.com"
POST/api/v1/support/inbox/{id}/messages
Сессия владельцаСлужба поддержки: ответить мерчанту.
Contact-form tickets return 409 email_reply_required because the visitor has no account.
Требуется cookie сессии владельца панели; ключи API для этой операции не принимаются.
Параметры пути
| Поле | Тип | Обязательно | Описание |
|---|
id | string | Да | Ticket ID |
Тело запроса
| Поле | Тип | Обязательно | Описание |
|---|
message | string | Да | length 1–5000 |
Возвращает: 201 SupportThread
Ответы
201Success400Validation error401Authentication required403Insufficient scope or invalid origin404Resource not found409Conflict, exhausted amount pool or manual review required429Rate limit exceeded500Internal server error
curl -X POST "https://smg.sabco24.com/api/v1/support/inbox/ID/messages" \
-H "Cookie: smg_session=$SESSION" \
-H "Origin: https://smg.sabco24.com" \
-H "Content-Type: application/json" \
-d '{"message":"string"}'
POST/api/v1/support/inbox/{id}/status
Сессия владельцаСлужба поддержки: изменить статус обращения.
Требуется cookie сессии владельца панели; ключи API для этой операции не принимаются.
Параметры пути
| Поле | Тип | Обязательно | Описание |
|---|
id | string | Да | Ticket ID |
Тело запроса
| Поле | Тип | Обязательно | Описание |
|---|
status | "open" | "answered" | "closed" | Да | |
Возвращает: 200 SupportThread
Ответы
200Success400Validation error401Authentication required403Insufficient scope or invalid origin404Resource not found409Conflict, exhausted amount pool or manual review required429Rate limit exceeded500Internal server error
curl -X POST "https://smg.sabco24.com/api/v1/support/inbox/ID/status" \
-H "Cookie: smg_session=$SESSION" \
-H "Origin: https://smg.sabco24.com" \
-H "Content-Type: application/json" \
-d '{"status":"open"}'
Схемы
Объекты, которые API возвращает и принимает.
Error
| Поле | Тип | Обязательно | Описание |
|---|
error | object | Да | |
mode | "live" | Да | Invoices are confirmed from verified TRON mainnet transfers. |
Merchant
| Поле | Тип | Обязательно | Описание |
|---|
id | string | Да | |
name | string | Да | |
email | string (email) | Да | |
mode | "live" | Да | Invoices are confirmed from verified TRON mainnet transfers. |
support_staff | boolean | Нет | True when this account is listed in SUPPORT_STAFF_EMAILS and may use the support inbox. |
SupportTicket
| Поле | Тип | Обязательно | Описание |
|---|
id | string | Да | |
reference | string | Да | Human-friendly reference such as SMG-1A2B3C4D5E. |
subject | string | Да | |
category | "general" | "payments" | "technical" | "account" | "other" | Да | default "general" |
status | "open" | "answered" | "closed" | Да | open: waiting for support; answered: support replied; closed: resolved. |
source | "dashboard" | "contact" | "chat" | Да | dashboard: merchant ticket; contact: contact form, answered by email; chat: website chat widget, answered in place. |
created_at | string (date-time) | Да | |
updated_at | string (date-time) | Да | |
name | string | Нет | Support inbox only. |
email | string (email) | Нет | Support inbox only. |
merchant_id | string | null | Нет | Support inbox only. Null for contact-form and website-chat tickets. |
merchant_name | string | null | Нет | Support inbox only. |
SupportMessage
| Поле | Тип | Обязательно | Описание |
|---|
id | string | Да | |
author | "customer" | "staff" | Да | |
body | string | Да | |
created_at | string (date-time) | Да | |
SupportThread
Wallet
| Поле | Тип | Обязательно | Описание |
|---|
id | string | Да | |
label | string | Да | |
address | string | Да | |
network | "tron-mainnet" | Да | |
verified | false | Да | |
verification_status | "unverified" | Да | |
created_at | string (date-time) | Да | |
CheckoutInvoice
| Поле | Тип | Обязательно | Описание |
|---|
id | string | Да | |
base_amount | string | Да | Exact USDT decimal string, six fractional digits in responses. Never a floating point number. — pattern ^[0-9]+\.[0-9]{6}$ · e.g. "49.953821" |
adjustment | string | Да | Exact USDT decimal string, six fractional digits in responses. Never a floating point number. — pattern ^[0-9]+\.[0-9]{6}$ · e.g. "49.953821" |
payable_amount | string | Да | Exact USDT decimal string, six fractional digits in responses. Never a floating point number. — pattern ^[0-9]+\.[0-9]{6}$ · e.g. "49.953821" |
wallet_address | string | Да | |
status | "pending" | "confirmed" | "expired" | "review" | Да | |
created_at | string (date-time) | Нет | |
expires_at | string (date-time) | Нет | |
reserved_until | string (date-time) | Нет | |
description | string | Нет | |
tx_hash | string | null | Нет | TRON transaction hash of the matched USDT transfer (64 hex characters). |
mode | "live" | Да | Invoices are confirmed from verified TRON mainnet transfers. |
network | "tron-mainnet" | Нет | |
token | "USDT" | Нет | |
token_contract | "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t" | Нет | |
amount_reuse_review | boolean | Нет | |
merchant_name | string | Да | Merchant business display name. |
Invoice
| Поле | Тип | Обязательно | Описание |
|---|
id | string | Да | |
base_amount | string | Да | Exact USDT decimal string, six fractional digits in responses. Never a floating point number. — pattern ^[0-9]+\.[0-9]{6}$ · e.g. "49.953821" |
adjustment | string | Да | Exact USDT decimal string, six fractional digits in responses. Never a floating point number. — pattern ^[0-9]+\.[0-9]{6}$ · e.g. "49.953821" |
payable_amount | string | Да | Exact USDT decimal string, six fractional digits in responses. Never a floating point number. — pattern ^[0-9]+\.[0-9]{6}$ · e.g. "49.953821" |
wallet_address | string | Да | |
status | "pending" | "confirmed" | "expired" | "review" | Да | |
created_at | string (date-time) | Нет | |
expires_at | string (date-time) | Нет | |
reserved_until | string (date-time) | Нет | |
description | string | Нет | |
tx_hash | string | null | Нет | TRON transaction hash of the matched USDT transfer (64 hex characters). |
mode | "live" | Да | Invoices are confirmed from verified TRON mainnet transfers. |
network | "tron-mainnet" | Нет | |
token | "USDT" | Нет | |
token_contract | "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t" | Нет | |
amount_reuse_review | boolean | Нет | |
checkout_url | string (uri) | Нет | |
checkout_token | string | Нет | Capability token. Treat checkout URLs as confidential invoice links. |
merchant_order_id | string | Да | |
wallet_id | string | Да | |
metadata | object | Да | |
CreateInvoice
| Поле | Тип | Обязательно | Описание |
|---|
merchant_order_id | string | Да | Unique per merchant. Reuse the original idempotency key for retries. — length 1–120 |
amount | string | Да | Base price in USDT; minimum 0.000001, maximum 1000000000. The server adds a disclosed identification adjustment. — pattern ^(0|[1-9][0-9]{0,9})(\.[0-9]{1,6})?$ · e.g. "49.95" |
wallet_id | string | Да | ID of a wallet registered to this merchant. — length 1–100 |
description | string | Нет | length 1–1000 |
metadata | object | Нет | JSON object, at most 16 KiB when serialized. Keep customer secrets out of metadata. |
expires_in_minutes | integer | Нет | range 1–1440 · default 20 |
InvoiceEnvelope
| Поле | Тип | Обязательно | Описание |
|---|
invoice | Invoice | Да | |
idempotent_replay | boolean | Нет | |
ApiKey
| Поле | Тип | Обязательно | Описание |
|---|
id | string | Да | |
name | string | Да | |
prefix | string | Да | First characters of the secret, for identification only. |
mode | "live" | Да | Invoices are confirmed from verified TRON mainnet transfers. |
scopes | "invoices:read" | "invoices:write" | "ledger:read"[] | Да | |
created_at | string (date-time) | Нет | |
last_used_at | string | null (date-time) | Нет | |
revoked_at | string | null (date-time) | Нет | |
expires_at | string | null (date-time) | Нет | Null when the key never expires. |
expired | boolean | Нет | |
Webhook
| Поле | Тип | Обязательно | Описание |
|---|
id | string | Да | |
url | string (uri) | Да | |
created_at | string (date-time) | Нет | |
active | boolean | Да | |
Delivery
| Поле | Тип | Обязательно | Описание |
|---|
id | string | Да | |
webhook_id | string | Да | |
event_id | string | Да | |
status | "pending" | "sending" | "delivered" | "failed" | "cancelled" | Да | |
attempts | integer | Да | |
next_attempt_at | string | null (date-time) | Нет | |
last_error | string | null | Нет | |
response_status | integer | null | Нет | |
created_at | string (date-time) | Нет | |
delivered_at | string | null (date-time) | Нет | |
Event
| Поле | Тип | Обязательно | Описание |
|---|
id | string | Да | |
type | "invoice.created" | "invoice.confirmed" | "invoice.expired" | "invoice.review" | "webhook.test" | Да | |
created_at | string (date-time) | Да | |
mode | "live" | Да | Invoices are confirmed from verified TRON mainnet transfers. |
data | object | Да | |
ConfirmedEvent
| Поле | Тип | Обязательно | Описание |
|---|
id | string | Да | |
type | "invoice.confirmed" | Да | |
created_at | string (date-time) | Да | |
mode | "live" | Да | Invoices are confirmed from verified TRON mainnet transfers. |
data | object | Да | |
Dashboard