المطورون
مرجع API
كل نقاط نهاية SMetaGateway REST، مولّدة من عقد OpenAPI 3.1. استخدم مفاتيح API من نوع Bearer من خادمك؛ المبالغ نصوص عشرية.
- عنوان URL الأساسي
https://smg.sabco24.com/api/v1- الإصدار
0.2.0 · OpenAPI 3.1
نقاط النهاية
جميع العمليات مجمّعة حسب المورد.
النظام
فحص سلامة الخدمة ووضع البوابة.
يعيد: 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"
قراءة إعدادات العميل العامة، بما فيها مفتاح موقع captcha.
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
الاستجابات
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
عامةتأكيد عنوان البريد الإلكتروني من الرابط المُرسل وبدء جلسة المالك.
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
الاستجابات
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
عامةإرسال رابط إعادة تعيين كلمة المرور بالبريد الإلكتروني.
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
الاستجابات
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
الاستجابات
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 '{}'
الحساب
جلب حساب التاجر والمحافظ والفواتير والمفاتيح وWebhooks والإحصاءات.
تتطلب ملف تعريف ارتباط جلسة مالك لوحة التحكم؛ تُرفض مفاتيح 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
جلسة المالكتحديث الاسم المعروض للتاجر.
تتطلب ملف تعريف ارتباط جلسة مالك لوحة التحكم؛ تُرفض مفاتيح 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
الاستجابات
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 صالح المجموع الاختباري (الملكية غير متحقق منها).
تتطلب ملف تعريف ارتباط جلسة مالك لوحة التحكم؛ تُرفض مفاتيح 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
الاستجابات
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 بمدة صلاحية اختيارية؛ يُعرض السر مرة واحدة.
تتطلب ملف تعريف ارتباط جلسة مالك لوحة التحكم؛ تُرفض مفاتيح 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.
تتطلب ملف تعريف ارتباط جلسة مالك لوحة التحكم؛ تُرفض مفاتيح 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 فورًا.
تتطلب ملف تعريف ارتباط جلسة مالك لوحة التحكم؛ تُرفض مفاتيح 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"
Webhooks
POST/api/v1/webhooks
جلسة المالكتسجيل نقطة Webhook عامة عبر 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.
تتطلب ملف تعريف ارتباط جلسة مالك لوحة التحكم؛ تُرفض مفاتيح 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}
جلسة المالكتعطيل نقطة نهاية وإلغاء عمليات التسليم المعلقة.
تتطلب ملف تعريف ارتباط جلسة مالك لوحة التحكم؛ تُرفض مفاتيح 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 موقّع.
تتطلب ملف تعريف ارتباط جلسة مالك لوحة التحكم؛ تُرفض مفاتيح 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
جلسة المالكإعادة محاولة تسليم Webhook فاشل أو معلق.
تتطلب ملف تعريف ارتباط جلسة مالك لوحة التحكم؛ تُرفض مفاتيح API لهذه العملية.
معاملات المسار
| الحقل | النوع | مطلوب | الوصف |
|---|
id | string | نعم | Delivery 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/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
عامةبدء محادثة على الموقع بالاسم والبريد الإلكتروني وأول رسالة؛ يعيد رمز محادثة خاصًا.
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
جلسة المالكعرض تذاكر الدعم الخاصة بك.
تتطلب ملف تعريف ارتباط جلسة مالك لوحة التحكم؛ تُرفض مفاتيح 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
جلسة المالكفتح تذكرة دعم.
تتطلب ملف تعريف ارتباط جلسة مالك لوحة التحكم؛ تُرفض مفاتيح 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}
جلسة المالكقراءة إحدى تذاكرك مع رسائلها.
تتطلب ملف تعريف ارتباط جلسة مالك لوحة التحكم؛ تُرفض مفاتيح 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
جلسة المالكالرد على تذكرتك؛ تُعاد التذكرة المغلقة إلى الفتح.
تتطلب ملف تعريف ارتباط جلسة مالك لوحة التحكم؛ تُرفض مفاتيح 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
جلسة المالكإغلاق تذكرتك.
تتطلب ملف تعريف ارتباط جلسة مالك لوحة التحكم؛ تُرفض مفاتيح 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.
تتطلب ملف تعريف ارتباط جلسة مالك لوحة التحكم؛ تُرفض مفاتيح 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}
جلسة المالكفريق الدعم: قراءة تذكرة مع بيانات التواصل.
تتطلب ملف تعريف ارتباط جلسة مالك لوحة التحكم؛ تُرفض مفاتيح 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.
تتطلب ملف تعريف ارتباط جلسة مالك لوحة التحكم؛ تُرفض مفاتيح 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
جلسة المالكفريق الدعم: تعيين حالة التذكرة.
تتطلب ملف تعريف ارتباط جلسة مالك لوحة التحكم؛ تُرفض مفاتيح 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"}'
المخططات
الكائنات التي تعيدها الواجهة وتقبلها.
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