РАЗРАБОТЧИКАМ

Справочник 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_enabledtrueНет

Ответы

  • 200Success
  • 400Validation error
  • 401Authentication required
  • 403Insufficient scope or invalid origin
  • 404Resource not found
  • 409Conflict, exhausted amount pool or manual review required
  • 429Rate limit exceeded
  • 500Internal 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
ПолеТипОбязательноОписание
captchaobjectДа
googleobjectДа

Ответы

  • 200Success
  • 400Validation error
  • 401Authentication required
  • 403Insufficient scope or invalid origin
  • 404Resource not found
  • 409Conflict, exhausted amount pool or manual review required
  • 429Rate limit exceeded
  • 500Internal 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.

Тело запроса

ПолеТипОбязательноОписание
emailstring (email)Да
passwordstring (password)Даlength 12–128
captcha_tokenstringНетCloudflare Turnstile response token. Required when GET /config returns a captcha site key; each token is single use. — length 0–2048
namestringНетlength 0–100
locale"en" | "fa" | "ar" | "zh" | "es" | "fr" | "ru"НетLanguage of the email. — default "en"
Возвращает: 201 application/json
ПолеТипОбязательноОписание
verification_requiredtrueДа
emailstring (email)Да
email_sentbooleanДаFalse when the SMTP server rejected the message; signing in later sends a new link.

Ответы

  • 201Account created; confirmation email sent
  • 400Validation error
  • 401Authentication required
  • 403Insufficient scope or invalid origin
  • 404Resource not found
  • 409Conflict, exhausted amount pool or manual review required
  • 429Rate limit exceeded
  • 500Internal server error
  • 503Email 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.

Тело запроса

ПолеТипОбязательноОписание
emailstring (email)Да
passwordstring (password)Даlength 10–128
captcha_tokenstringНет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
ПолеТипОбязательноОписание
merchantMerchantНет

Ответы

  • 200Success
  • 400Validation error
  • 401Authentication required
  • 403Insufficient scope or invalid origin
  • 404Resource not found
  • 409Conflict, exhausted amount pool or manual review required
  • 429Rate limit exceeded
  • 500Internal server error
  • 503Captcha 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.

Тело запроса

ПолеТипОбязательноОписание
tokenstringДаSingle-use token from the emailed link. — pattern ^[A-Za-z0-9_-]{43}$
Возвращает: 200 application/json
ПолеТипОбязательноОписание
merchantMerchantНет

Ответы

  • 200Success
  • 400Validation error
  • 401Authentication required
  • 403Insufficient scope or invalid origin
  • 404Resource not found
  • 409Conflict, exhausted amount pool or manual review required
  • 429Rate limit exceeded
  • 500Internal 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.

Тело запроса

ПолеТипОбязательноОписание
emailstring (email)Да
captcha_tokenstringНет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
ПолеТипОбязательноОписание
successtrueДа

Ответы

  • 202Accepted
  • 400Validation error
  • 401Authentication required
  • 403Insufficient scope or invalid origin
  • 404Resource not found
  • 409Conflict, exhausted amount pool or manual review required
  • 429Rate limit exceeded
  • 500Internal server error
  • 503Email 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.

Тело запроса

ПолеТипОбязательноОписание
tokenstringДаSingle-use token from the emailed link. — pattern ^[A-Za-z0-9_-]{43}$
passwordstring (password)Даlength 12–128
Возвращает: 200 application/json
ПолеТипОбязательноОписание
merchantMerchantНет

Ответы

  • 200Success
  • 400Validation error
  • 401Authentication required
  • 403Insufficient scope or invalid origin
  • 404Resource not found
  • 409Conflict, exhausted amount pool or manual review required
  • 429Rate limit exceeded
  • 500Internal 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.

Тело запроса

ПолеТипОбязательноОписание
credentialstringДаGoogle ID token (JWT). — length 20–4096
Возвращает: 200 application/json
ПолеТипОбязательноОписание
merchantMerchantНет

Ответы

  • 200Signed in
  • 201Account created
  • 400Validation error
  • 401Authentication required
  • 403Insufficient scope or invalid origin
  • 404Resource not found
  • 409Conflict, exhausted amount pool or manual review required
  • 429Rate limit exceeded
  • 500Internal server error
  • 503Google 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_inbooleanДа

Ответы

  • 200Success
  • 400Validation error
  • 401Authentication required
  • 403Insufficient scope or invalid origin
  • 404Resource not found
  • 409Conflict, exhausted amount pool or manual review required
  • 429Rate limit exceeded
  • 500Internal server error
Пример запроса
curl -X GET "https://smg.sabco24.com/api/v1/auth/session"

POST/api/v1/auth/logout

Публичный

Завершить текущую сессию владельца.

Возвращает: 200 application/json
ПолеТипОбязательноОписание
successtrueДа

Ответы

  • 200Success
  • 400Validation error
  • 401Authentication required
  • 403Insufficient scope or invalid origin
  • 404Resource not found
  • 409Conflict, exhausted amount pool or manual review required
  • 429Rate limit exceeded
  • 500Internal 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
ПолеТипОбязательноОписание
merchantMerchantДа
walletsWallet[]Да
invoicesInvoice[]Да
eventsEvent[]Да
api_keysApiKey[]Да
webhooksWebhook[]Да
deliveriesDelivery[]Да
statsobjectДа

Ответы

  • 200Success
  • 400Validation error
  • 401Authentication required
  • 403Insufficient scope or invalid origin
  • 404Resource not found
  • 409Conflict, exhausted amount pool or manual review required
  • 429Rate limit exceeded
  • 500Internal 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 для этой операции не принимаются.

Тело запроса

ПолеТипОбязательноОписание
namestringДаlength 1–100
Возвращает: 200 Dashboard
ПолеТипОбязательноОписание
merchantMerchantДа
walletsWallet[]Да
invoicesInvoice[]Да
eventsEvent[]Да
api_keysApiKey[]Да
webhooksWebhook[]Да
deliveriesDelivery[]Да
statsobjectДа

Ответы

  • 200Success
  • 400Validation error
  • 401Authentication required
  • 403Insufficient scope or invalid origin
  • 404Resource not found
  • 409Conflict, exhausted amount pool or manual review required
  • 429Rate limit exceeded
  • 500Internal 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
ПолеТипОбязательноОписание
walletsWallet[]Нет

Ответы

  • 200Success
  • 400Validation error
  • 401Authentication required
  • 403Insufficient scope or invalid origin
  • 404Resource not found
  • 409Conflict, exhausted amount pool or manual review required
  • 429Rate limit exceeded
  • 500Internal 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 для этой операции не принимаются.

Тело запроса

ПолеТипОбязательноОписание
labelstringДаlength 1–80
addressstringДаpattern ^T[1-9A-HJ-NP-Za-km-z]{33}$
Возвращает: 200 application/json
ПолеТипОбязательноОписание
walletWalletНет

Ответы

  • 200Existing address
  • 201Registered
  • 400Validation error
  • 401Authentication required
  • 403Insufficient scope or invalid origin
  • 404Resource not found
  • 409Conflict, exhausted amount pool or manual review required
  • 429Rate limit exceeded
  • 500Internal 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
ПолеТипОбязательноОписание
invoicesInvoice[]Нет

Ответы

  • 200Success
  • 400Validation error
  • 401Authentication required
  • 403Insufficient scope or invalid origin
  • 404Resource not found
  • 409Conflict, exhausted amount pool or manual review required
  • 429Rate limit exceeded
  • 500Internal 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-KeystringДаУникальный ключ для каждой попытки создания счёта; используйте его повторно при ретраях.

Тело запроса CreateInvoice

ПолеТипОбязательноОписание
merchant_order_idstringДаUnique per merchant. Reuse the original idempotency key for retries. — length 1–120
amountstringДа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_idstringДаID of a wallet registered to this merchant. — length 1–100
descriptionstringНетlength 1–1000
metadataobjectНетJSON object, at most 16 KiB when serialized. Keep customer secrets out of metadata.
expires_in_minutesintegerНетrange 1–1440 · default 20
Возвращает: 200 InvoiceEnvelope
ПолеТипОбязательноОписание
invoiceInvoiceДа
idempotent_replaybooleanНет

Ответы

  • 200Identical idempotent replay
  • 201Invoice allocated
  • 400Validation error
  • 401Authentication required
  • 403Insufficient scope or invalid origin
  • 404Resource not found
  • 409Conflict, exhausted amount pool or manual review required
  • 429Rate limit exceeded
  • 500Internal 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 или сессия

Получить счёт этого продавца.

Параметры пути

ПолеТипОбязательноОписание
idstringДаInvoice ID
Возвращает: 200 application/json
ПолеТипОбязательноОписание
invoiceInvoiceНет

Ответы

  • 200Success
  • 400Validation error
  • 401Authentication required
  • 403Insufficient scope or invalid origin
  • 404Resource not found
  • 409Conflict, exhausted amount pool or manual review required
  • 429Rate limit exceeded
  • 500Internal server error
Пример запроса
curl -X GET "https://smg.sabco24.com/api/v1/invoices/ID" \
  -H "Authorization: Bearer $SMETA_API_KEY"

Оплата

GET/api/v1/checkout/{token}

Публичный

Получить безопасные для плательщика данные оплаты по токену.

Параметры пути

ПолеТипОбязательноОписание
tokenstringДаCheckout capability token from checkout_url
Возвращает: 200 application/json
ПолеТипОбязательноОписание
invoiceCheckoutInvoiceНет

Ответы

  • 200Success
  • 400Validation error
  • 401Authentication required
  • 403Insufficient scope or invalid origin
  • 404Resource not found
  • 409Conflict, exhausted amount pool or manual review required
  • 429Rate limit exceeded
  • 500Internal server error
Пример запроса
curl -X GET "https://smg.sabco24.com/api/v1/checkout/TOKEN"

Ключи API

POST/api/v1/api-keys

Сессия владельца

Создать API-ключ с необязательным сроком действия; секрет показывается один раз.

Требуется cookie сессии владельца панели; ключи API для этой операции не принимаются.

Тело запроса

ПолеТипОбязательноОписание
namestringДаlength 1–80
expires_in_daysinteger | 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_keyApiKey & objectНет
secretstringНет
warningstringНет

Ответы

  • 201Success
  • 400Validation error
  • 401Authentication required
  • 403Insufficient scope or invalid origin
  • 404Resource not found
  • 409Conflict, exhausted amount pool or manual review required
  • 429Rate limit exceeded
  • 500Internal 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 для этой операции не принимаются.

Параметры пути

ПолеТипОбязательноОписание
idstringДаAPI key ID
Возвращает: 201 application/json
ПолеТипОбязательноОписание
api_keyApiKey & objectНет
secretstringНет
warningstringНет
replaced_key_idstringНет

Ответы

  • 201Success
  • 400Validation error
  • 401Authentication required
  • 403Insufficient scope or invalid origin
  • 404Resource not found
  • 409Conflict, exhausted amount pool or manual review required
  • 429Rate limit exceeded
  • 500Internal 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 для этой операции не принимаются.

Параметры пути

ПолеТипОбязательноОписание
idstringДаAPI key ID
Возвращает: 200 application/json
ПолеТипОбязательноОписание
successtrueДа

Ответы

  • 200Success
  • 400Validation error
  • 401Authentication required
  • 403Insufficient scope or invalid origin
  • 404Resource not found
  • 409Conflict, exhausted amount pool or manual review required
  • 429Rate limit exceeded
  • 500Internal 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 error
  • 401Authentication required
  • 403Insufficient scope or invalid origin
  • 404Resource not found
  • 409Conflict, exhausted amount pool or manual review required
  • 429Rate limit exceeded
  • 500Internal 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 для этой операции не принимаются.

Тело запроса

ПолеТипОбязательноОписание
urlstring (uri)Даlength 0–2048
Возвращает: 201 application/json
ПолеТипОбязательноОписание
webhookWebhook & objectНет
secretstringНет

Ответы

  • 201Success
  • 400Validation error
  • 401Authentication required
  • 403Insufficient scope or invalid origin
  • 404Resource not found
  • 409Conflict, exhausted amount pool or manual review required
  • 429Rate limit exceeded
  • 500Internal 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 для этой операции не принимаются.

Параметры пути

ПолеТипОбязательноОписание
idstringДаWebhook ID
Возвращает: 200 application/json
ПолеТипОбязательноОписание
successtrueДа

Ответы

  • 200Success
  • 400Validation error
  • 401Authentication required
  • 403Insufficient scope or invalid origin
  • 404Resource not found
  • 409Conflict, exhausted amount pool or manual review required
  • 429Rate limit exceeded
  • 500Internal 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 для этой операции не принимаются.

Параметры пути

ПолеТипОбязательноОписание
idstringДаWebhook ID
Возвращает: 200 application/json
ПолеТипОбязательноОписание
eventEventНет
deliveriesDelivery[]Нет

Ответы

  • 200Success
  • 400Validation error
  • 401Authentication required
  • 403Insufficient scope or invalid origin
  • 404Resource not found
  • 409Conflict, exhausted amount pool or manual review required
  • 429Rate limit exceeded
  • 500Internal 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 для этой операции не принимаются.

Параметры пути

ПолеТипОбязательноОписание
idstringДаDelivery ID
Возвращает: 200 application/json
ПолеТипОбязательноОписание
deliveryDeliveryНет

Ответы

  • 200Success
  • 400Validation error
  • 401Authentication required
  • 403Insufficient scope or invalid origin
  • 404Resource not found
  • 409Conflict, exhausted amount pool or manual review required
  • 429Rate limit exceeded
  • 500Internal 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 event
  • 401Invalid or stale signature
  • 503Temporary 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.

Тело запроса

ПолеТипОбязательноОписание
messagestringДаlength 1–5000
namestringДаlength 1–100
emailstring (email)Даlength 0–254
captcha_tokenstringНет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_tokenstringДаPrivate bearer token for this conversation.
ticketobjectДа
namestringДа
messagesSupportMessage[]Да

Ответы

  • 201Success
  • 400Validation error
  • 401Authentication required
  • 403Insufficient scope or invalid origin
  • 404Resource not found
  • 409Conflict, exhausted amount pool or manual review required
  • 429Rate limit exceeded
  • 500Internal server error
  • 503Captcha 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-TokenstringДаchat_token returned when the chat was started. Keep it private; it is the only key to this conversation.
Возвращает: 200 application/json
ПолеТипОбязательноОписание
ticketobjectДа
namestringДа
messagesSupportMessage[]Да

Ответы

  • 200Success
  • 400Validation error
  • 401Authentication required
  • 403Insufficient scope or invalid origin
  • 404Resource not found
  • 409Conflict, exhausted amount pool or manual review required
  • 429Rate limit exceeded
  • 500Internal 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-TokenstringДаchat_token returned when the chat was started. Keep it private; it is the only key to this conversation.

Тело запроса

ПолеТипОбязательноОписание
messagestringДаlength 1–5000
Возвращает: 201 application/json
ПолеТипОбязательноОписание
ticketobjectДа
namestringДа
messagesSupportMessage[]Да

Ответы

  • 201Success
  • 400Validation error
  • 401Authentication required
  • 403Insufficient scope or invalid origin
  • 404Resource not found
  • 409Conflict, exhausted amount pool or manual review required
  • 429Rate limit exceeded
  • 500Internal 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."}'

POST/api/v1/support/contact

Публичный

Написать в поддержку без аккаунта.

Creates a ticket that the support team answers by email. Only the reference is returned.

Тело запроса

ПолеТипОбязательноОписание
namestringДаlength 1–100
emailstring (email)Даlength 0–254
subjectstringДаlength 1–150
category"general" | "payments" | "technical" | "account" | "other"Нетdefault "general"
messagestringДаlength 1–5000
captcha_tokenstringНетCloudflare Turnstile response token. Required when GET /config returns a captcha site key; each token is single use. — length 0–2048
Возвращает: 201 application/json
ПолеТипОбязательноОписание
ticketobjectНет

Ответы

  • 201Success
  • 400Validation error
  • 401Authentication required
  • 403Insufficient scope or invalid origin
  • 404Resource not found
  • 409Conflict, exhausted amount pool or manual review required
  • 429Rate limit exceeded
  • 500Internal server error
  • 503Captcha 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
ПолеТипОбязательноОписание
ticketsSupportTicket[]Нет

Ответы

  • 200Success
  • 400Validation error
  • 401Authentication required
  • 403Insufficient scope or invalid origin
  • 404Resource not found
  • 409Conflict, exhausted amount pool or manual review required
  • 429Rate limit exceeded
  • 500Internal 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 для этой операции не принимаются.

Тело запроса

ПолеТипОбязательноОписание
subjectstringДаlength 1–150
category"general" | "payments" | "technical" | "account" | "other"Нетdefault "general"
messagestringДаlength 1–5000
Возвращает: 201 SupportThread
ПолеТипОбязательноОписание
ticketSupportTicketДа
messagesSupportMessage[]Да

Ответы

  • 201Success
  • 400Validation error
  • 401Authentication required
  • 403Insufficient scope or invalid origin
  • 404Resource not found
  • 409Conflict, exhausted amount pool or manual review required
  • 429Rate limit exceeded
  • 500Internal 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 для этой операции не принимаются.

Параметры пути

ПолеТипОбязательноОписание
idstringДаTicket ID
Возвращает: 200 SupportThread
ПолеТипОбязательноОписание
ticketSupportTicketДа
messagesSupportMessage[]Да

Ответы

  • 200Success
  • 400Validation error
  • 401Authentication required
  • 403Insufficient scope or invalid origin
  • 404Resource not found
  • 409Conflict, exhausted amount pool or manual review required
  • 429Rate limit exceeded
  • 500Internal 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 для этой операции не принимаются.

Параметры пути

ПолеТипОбязательноОписание
idstringДаTicket ID

Тело запроса

ПолеТипОбязательноОписание
messagestringДаlength 1–5000
Возвращает: 201 SupportThread
ПолеТипОбязательноОписание
ticketSupportTicketДа
messagesSupportMessage[]Да

Ответы

  • 201Success
  • 400Validation error
  • 401Authentication required
  • 403Insufficient scope or invalid origin
  • 404Resource not found
  • 409Conflict, exhausted amount pool or manual review required
  • 429Rate limit exceeded
  • 500Internal 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 для этой операции не принимаются.

Параметры пути

ПолеТипОбязательноОписание
idstringДаTicket ID
Возвращает: 200 SupportThread
ПолеТипОбязательноОписание
ticketSupportTicketДа
messagesSupportMessage[]Да

Ответы

  • 200Success
  • 400Validation error
  • 401Authentication required
  • 403Insufficient scope or invalid origin
  • 404Resource not found
  • 409Conflict, exhausted amount pool or manual review required
  • 429Rate limit exceeded
  • 500Internal 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
ПолеТипОбязательноОписание
ticketsSupportTicket[]Нет

Ответы

  • 200Success
  • 400Validation error
  • 401Authentication required
  • 403Insufficient scope or invalid origin
  • 404Resource not found
  • 409Conflict, exhausted amount pool or manual review required
  • 429Rate limit exceeded
  • 500Internal 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 для этой операции не принимаются.

Параметры пути

ПолеТипОбязательноОписание
idstringДаTicket ID
Возвращает: 200 SupportThread
ПолеТипОбязательноОписание
ticketSupportTicketДа
messagesSupportMessage[]Да

Ответы

  • 200Success
  • 400Validation error
  • 401Authentication required
  • 403Insufficient scope or invalid origin
  • 404Resource not found
  • 409Conflict, exhausted amount pool or manual review required
  • 429Rate limit exceeded
  • 500Internal 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 для этой операции не принимаются.

Параметры пути

ПолеТипОбязательноОписание
idstringДаTicket ID

Тело запроса

ПолеТипОбязательноОписание
messagestringДаlength 1–5000
Возвращает: 201 SupportThread
ПолеТипОбязательноОписание
ticketSupportTicketДа
messagesSupportMessage[]Да

Ответы

  • 201Success
  • 400Validation error
  • 401Authentication required
  • 403Insufficient scope or invalid origin
  • 404Resource not found
  • 409Conflict, exhausted amount pool or manual review required
  • 429Rate limit exceeded
  • 500Internal 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 для этой операции не принимаются.

Параметры пути

ПолеТипОбязательноОписание
idstringДаTicket ID

Тело запроса

ПолеТипОбязательноОписание
status"open" | "answered" | "closed"Да
Возвращает: 200 SupportThread
ПолеТипОбязательноОписание
ticketSupportTicketДа
messagesSupportMessage[]Да

Ответы

  • 200Success
  • 400Validation error
  • 401Authentication required
  • 403Insufficient scope or invalid origin
  • 404Resource not found
  • 409Conflict, exhausted amount pool or manual review required
  • 429Rate limit exceeded
  • 500Internal 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
ПолеТипОбязательноОписание
errorobjectДа
mode"live"ДаInvoices are confirmed from verified TRON mainnet transfers.
Merchant
ПолеТипОбязательноОписание
idstringДа
namestringДа
emailstring (email)Да
mode"live"ДаInvoices are confirmed from verified TRON mainnet transfers.
support_staffbooleanНетTrue when this account is listed in SUPPORT_STAFF_EMAILS and may use the support inbox.
SupportTicket
ПолеТипОбязательноОписание
idstringДа
referencestringДаHuman-friendly reference such as SMG-1A2B3C4D5E.
subjectstringДа
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_atstring (date-time)Да
updated_atstring (date-time)Да
namestringНетSupport inbox only.
emailstring (email)НетSupport inbox only.
merchant_idstring | nullНетSupport inbox only. Null for contact-form and website-chat tickets.
merchant_namestring | nullНетSupport inbox only.
SupportMessage
ПолеТипОбязательноОписание
idstringДа
author"customer" | "staff"Да
bodystringДа
created_atstring (date-time)Да
SupportThread
ПолеТипОбязательноОписание
ticketSupportTicketДа
messagesSupportMessage[]Да
Wallet
ПолеТипОбязательноОписание
idstringДа
labelstringДа
addressstringДа
network"tron-mainnet"Да
verifiedfalseДа
verification_status"unverified"Да
created_atstring (date-time)Да
CheckoutInvoice
ПолеТипОбязательноОписание
idstringДа
base_amountstringДаExact USDT decimal string, six fractional digits in responses. Never a floating point number. — pattern ^[0-9]+\.[0-9]{6}$ · e.g. "49.953821"
adjustmentstringДа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_amountstringДа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_addressstringДа
status"pending" | "confirmed" | "expired" | "review"Да
created_atstring (date-time)Нет
expires_atstring (date-time)Нет
reserved_untilstring (date-time)Нет
descriptionstringНет
tx_hashstring | 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_reviewbooleanНет
merchant_namestringДаMerchant business display name.
Invoice
ПолеТипОбязательноОписание
idstringДа
base_amountstringДаExact USDT decimal string, six fractional digits in responses. Never a floating point number. — pattern ^[0-9]+\.[0-9]{6}$ · e.g. "49.953821"
adjustmentstringДа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_amountstringДа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_addressstringДа
status"pending" | "confirmed" | "expired" | "review"Да
created_atstring (date-time)Нет
expires_atstring (date-time)Нет
reserved_untilstring (date-time)Нет
descriptionstringНет
tx_hashstring | 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_reviewbooleanНет
checkout_urlstring (uri)Нет
checkout_tokenstringНетCapability token. Treat checkout URLs as confidential invoice links.
merchant_order_idstringДа
wallet_idstringДа
metadataobjectДа
CreateInvoice
ПолеТипОбязательноОписание
merchant_order_idstringДаUnique per merchant. Reuse the original idempotency key for retries. — length 1–120
amountstringДа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_idstringДаID of a wallet registered to this merchant. — length 1–100
descriptionstringНетlength 1–1000
metadataobjectНетJSON object, at most 16 KiB when serialized. Keep customer secrets out of metadata.
expires_in_minutesintegerНетrange 1–1440 · default 20
InvoiceEnvelope
ПолеТипОбязательноОписание
invoiceInvoiceДа
idempotent_replaybooleanНет
ApiKey
ПолеТипОбязательноОписание
idstringДа
namestringДа
prefixstringДа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_atstring (date-time)Нет
last_used_atstring | null (date-time)Нет
revoked_atstring | null (date-time)Нет
expires_atstring | null (date-time)НетNull when the key never expires.
expiredbooleanНет
Webhook
ПолеТипОбязательноОписание
idstringДа
urlstring (uri)Да
created_atstring (date-time)Нет
activebooleanДа
Delivery
ПолеТипОбязательноОписание
idstringДа
webhook_idstringДа
event_idstringДа
status"pending" | "sending" | "delivered" | "failed" | "cancelled"Да
attemptsintegerДа
next_attempt_atstring | null (date-time)Нет
last_errorstring | nullНет
response_statusinteger | nullНет
created_atstring (date-time)Нет
delivered_atstring | null (date-time)Нет
Event
ПолеТипОбязательноОписание
idstringДа
type"invoice.created" | "invoice.confirmed" | "invoice.expired" | "invoice.review" | "webhook.test"Да
created_atstring (date-time)Да
mode"live"ДаInvoices are confirmed from verified TRON mainnet transfers.
dataobjectДа
ConfirmedEvent
ПолеТипОбязательноОписание
idstringДа
type"invoice.confirmed"Да
created_atstring (date-time)Да
mode"live"ДаInvoices are confirmed from verified TRON mainnet transfers.
dataobjectДа
Dashboard
ПолеТипОбязательноОписание
merchantMerchantДа
walletsWallet[]Да
invoicesInvoice[]Да
eventsEvent[]Да
api_keysApiKey[]Да
webhooksWebhook[]Да
deliveriesDelivery[]Да
statsobjectДа