Add USDT payments to any website or app. Base URL: http://x.smboostzone.shop · Networks: TRC20, BEP20
Your server creates an invoice, sends the customer to the hosted pay page, and receives a signed webhook when the payment is confirmed (or fails). Everything is server-to-server and signed with HMAC-SHA256.
| Step | Who | What |
|---|---|---|
| 1 | Your server | POST /api/create.php → get pay_url |
| 2 | Customer | Opens pay_url, sends the exact USDT amount |
| 3 | Gateway | Detects payment on-chain, page turns Successful |
| 4 | Gateway → you | POST signed invoice.paid / invoice.failed to your callback_url |
| 5 | Customer | Returns to your return_url → you show status from your DB |
pay_url.callback_url endpoint that verifies the signature and updates your order/wallet.Each merchant has an api_key (public id) and api_secret (private — server only). Requests are signed with HMAC-SHA256 (hex) using the secret.
| Endpoint | Message to sign |
|---|---|
POST /api/create.php | api_key|order_id|amount |
GET /api/status.php | invoice_id |
| Webhook (incoming) | timestamp.raw_body |
"10.50" and "10.5" produce different signatures).POST http://x.smboostzone.shop/api/create.php · application/x-www-form-urlencoded
| Field | Req. | Description |
|---|---|---|
| api_key | ✅ | Your merchant key |
| order_id | ✅ | Your unique order id (≤100 chars) |
| amount | ✅ | String, max 2 decimals, e.g. 10.50 (min 1) |
| sign | ✅ | HMAC as above |
| network | TRC20 | BEP20 — empty = customer chooses on the pay page | |
| callback_url | Webhook URL (public http/https) | |
| return_url | Customer is redirected here after payment (?invoice_id=…&order_id=… appended) | |
| page | checkout = modern dark checkout (currency → network sheet → QR page). Default = classic pay page |
<?php
require 'UsdtGateway.php'; // Integration Kit से
$gw = new UsdtGateway('http://x.smboostzone.shop', 'YOUR_API_KEY', 'YOUR_API_SECRET');
$inv = $gw->createInvoice('ORDER-1001', '10.50', [
'callback_url' => 'https://yourshop.com/callback.php',
'return_url' => 'https://yourshop.com/return.php',
// 'network' => 'TRC20', // optional: TRC20 | BEP20
]);
header('Location: ' . $inv['pay_url']); // customer को payment page पर भेजें{
"success": true,
"invoice_id": "INV37227043E4BC58",
"order_id": "ORDER-1001",
"status": "pending",
"network": "TRC20",
"amount": "10.50",
"pay_amount": "10.5021",
"pay_address": "T...",
"expires_at": "2026-10-29T04:00:25Z",
"pay_url": "http://x.smboostzone.shop/pay.php?id=INV37227043E4BC58"
}
Calling again with the same order_id + amount while an invoice is pending returns the same invoice (idempotent).
GET http://x.smboostzone.shop/api/status.php?api_key=KEY&invoice_id=INV…&sign=HMAC(invoice_id)
{ "success": true, "invoice_id": "INV…", "order_id": "ORDER-1001", "status": "paid",
"network": "TRC20", "amount": "10.50", "pay_amount": "10.5021", "txid": "…", "paid_at": "2026-10-29T03:30:25Z" }
Use it to reconcile if a webhook was missed. status is pending, paid or expired.
Sent as POST JSON to your callback_url with headers X-Gateway-Timestamp and X-Gateway-Signature.
| event | When |
|---|---|
| invoice.paid | Payment confirmed on-chain |
| invoice.failed | Invoice expired without payment |
{ "event": "invoice.paid", "invoice_id": "INV…", "order_id": "ORDER-1001", "network": "TRC20",
"amount": "10.50", "pay_amount": "10.5021", "status": "paid", "txid": "…", "paid_at": "2026-10-29T03:30:25Z" }
{ "event": "invoice.failed", "invoice_id": "INV…", "order_id": "ORDER-1001", "network": "TRC20",
"amount": "10.50", "pay_amount": "10.5021", "status": "expired",
"reason": "payment_not_received", "expired_at": "2026-10-29T04:00:25Z" }
Retries: if you don't return HTTP 2xx, it retries after 1 min, 5 min, 30 min, 2 h and 6 h. You can also press Resend callback in the admin panel.
HMAC_SHA256(timestamp + "." + RAW_BODY, api_secret) and compare with X-Gateway-Signature (constant-time).200 OK.<?php // callback.php
require 'UsdtGateway.php';
$gw = new UsdtGateway('http://x.smboostzone.shop', 'YOUR_API_KEY', 'YOUR_API_SECRET');
try { $d = $gw->verifyWebhook(); } catch (Throwable $e) { http_response_code(403); exit; } // signature + time check
if ($d['event'] === 'invoice.paid') { /* order paid / wallet credit (idempotent!) */ }
if ($d['event'] === 'invoice.failed') { /* order failed / cancel */ }
echo 'OK'; // 2xx वापस करें, वरना retry होगाreturn_url. Only the signed webhook (or signed status API) is proof.| Status | Meaning |
|---|---|
| pending | Waiting for payment |
| paid | Matching payment found on-chain |
| expired | Time ran out → pay page shows Failed, invoice.failed sent |
| HTTP | error | Cause |
|---|---|---|
| 401 | invalid_api_key / invalid_signature | Wrong key, secret or message |
| 422 | invalid_amount, invalid_order_id, amount_too_small | Validation |
| 422 | network_not_supported | Network is disabled |
| 422 | invalid_callback_url, callback_url_not_public | Bad or private URL |
| 503 | no_free_amount_slot_try_again | Too many open invoices for that amount |
invoice.failed.Copy-paste ready files — checkout, signed webhook receiver, return page and a one-file SDK.
| File | |
|---|---|
UsdtGateway.phpSDK (createInvoice, getInvoice, verifyWebhook) | Download |
checkout.phpMobile + amount → order → pay page | Download |
callback.phpSigned webhook receiver (credit / fail) | Download |
return.phpResult page | Download |
schema.sqlorders table | Download |
config.sample.phpConfig | Download |
node_example.jsNode.js example | Download |
python_example.pyPython example | Download |
curl_examples.shcURL | Download |
Mobile + amount + method form → modern dark checkout with network picker, QR and exact amount → balance credited by signed webhook.
⬇ Download Add-Funds kit (.zip) See the checkout in the demo
No. Payments go directly to the merchant's wallet address. Only public addresses are stored.
The transfer appears under Unmatched in the admin panel where it can be assigned to the invoice manually.
TRC20: usually within a minute or two. BEP20: after ~5 block confirmations (≈ 15-30 s) plus the polling interval.
USDT on TRON (TRC20) and BNB Smart Chain (BEP20).