Zepharion Pay is an API-first crypto payment gateway. Create a payment, send your customer to the hosted checkout, and receive a signed webhook when the money lands. This page is the complete integration guide.
Create an API key in your dashboard (API keys → Create key). You get a public key (API key) and a secret key (YOUR_SECRET_KEY). The secret is shown once — store it in your server environment.
Authenticate every API call with the secret key:
Authorization: Bearer YOUR_SECRET_KEY
Use test-mode secret … keys to create test payments that never touch your balance.
POST /api/v1/payment
Content-Type: application/json
Authorization: Bearer YOUR_SECRET_KEY
{
"amount_usd": 49.99, // required, USD
"asset": "USDT_TRC20", // required, see assets table
"order_id": "INV-1042", // your reference (optional)
"description": "Pro plan", // shown at checkout
"callback_url": "https://yourstore.com/cb", // optional per-payment webhook
"metadata": {"user_id": 7} // optional, echoed back
}
Response:
{
"ok": true,
"payment": {
"id": "9f0c…-…", // payment uuid
"status": "pending",
"amount_usd": 49.99,
"asset": "USDT_TRC20",
"crypto_amount": 49.507655, // send exactly this
"pay_address": "TQrY8bkbpXvFEU8uWK2F…", // receiving address
"checkout_url": "https://zepharionlabs.com/pay/?id=9f0c…",
"expires_at": "2026-10-10 18:30:00"
}
}
Then redirect your customer to checkout_url or embed the pay_address + crypto_amount in your own UI.
GET /api/v1/payment/{uuid} → single payment
GET /api/v1/payments?status=paid → list (limit, offset)
GET /api/v1/balance → balance + lifetime summary
GET /api/v1/rates → current USD rates
Add an endpoint in Dashboard → Webhooks. Each delivery is a JSON POST with these headers:
X-Zepharion-Event: payment.paid X-Zepharion-Delivery: 1234 X-Zepharion-Timestamp: 1791647621 X-Zepharion-Signature: HMAC-SHA256 hex of timestamp + "." + rawBody with your endpoint secret
Events: payment.paid, payment.expired, payment.underpaid, payment.overpaid, payment.cancelled. Failed deliveries are retried with backoff (1m, 5m, 30m, 2h, 12h, 24h; max attempts configurable).
$raw = file_get_contents('php://input');
$ts = $_SERVER['HTTP_X_ZEPHARION_TIMESTAMP'];
$expected = hash_hmac('sha256', $ts . '.' . $raw, $MY_ENDPOINT_SECRET);
if (!hash_equals($expected, $_SERVER['HTTP_X_ZEPHARION_SIGNATURE'])) {
http_response_code(401); exit('bad signature');
}
$event = json_decode($raw, true);
if ($event['event'] === 'payment.paid') {
// order_id: $event['data']['payment']['order_id']
// amount: $event['data']['payment']['amount_usd']
markOrderPaid($event['data']['payment']['order_id']);
}
echo '{"ok":true}';
const crypto = require('crypto');
const expected = crypto.createHmac('sha256', process.env.ZP_WEBHOOK_SECRET)
.update(req.headers['x-zepharion-timestamp'] + '.' + rawBody)
.digest('hex');
if (!crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(req.headers['x-zepharion-signature']))) {
return res.status(401).end();
}
| Status | Meaning |
|---|---|
pending | Waiting for the customer to send funds. |
confirming | Funds detected, waiting for network confirmations. |
paid | Confirmed and credited. Webhook fired. Fulfil the order. |
underpaid | Customer sent less than required. Support will resolve. |
overpaid | Customer sent more. The order is credited at the original amount. |
expired | Payment window closed before funds arrived. |
cancelled / failed | Cancelled by you or unrecoverable provider error. |
| Code | Network | Notes |
|---|---|---|
USDT_TRC20 | Tron | Recommended — low fees, fast. |
USDT_ERC20 | Ethereum | High gas fees. |
USDT_BEP20 | BNB Chain | Low fees. |
BTC | Bitcoin | On-chain confirmations required. |
ETH | Ethereum | — |
USDT | Exchange (Binance/OKX/Bybit/BingX) | Internal transfer, instant. |
The available list is returned by GET /api/v1/assets — it reflects which providers the operator has enabled.
| HTTP | Meaning |
|---|---|
| 400 | Validation error — see error in the JSON body. |
| 401 | Missing/invalid API key. |
| 402 | No active subscription on the merchant account. |
| 404 | Payment not found (or not yours). |
| 429 | Rate limited — slow down. |
Five steps, any platform (custom store, WordPress, DHRU, anything):
POST /api/v1/payment with the amount and asset (section 2 above).checkout_url (hosted page with QR, address, live status).payment.paid arrives at your endpoint. Verify the signature (section 3), then mark your order paid.Your dashboard ships ready-to-use code so you never start from a blank page:
create-payment.php / .py / .sh, webhook-php.php, webhook-node.js.DHRU uses its own Gateway Development Kit format (two files, renamed from customgateway.php / customgatewaycallback.php). Ready-made files and step-by-step instructions live in examples/dhru/ in the repository. Flow: DHRU invoice → module calls our API and redirects to the checkout → customer pays → payment.paid webhook marks the DHRU invoice paid.
Ready-made modules ship in examples/woocommerce/ and examples/whmcs/ — also downloadable from the dashboard → Developers. The module creates the payment, redirects the customer to the hosted checkout, and a signed webhook marks the order or invoice paid automatically.
Use the REST API + signed webhooks described in sections 2–4. Full developer guide: docs/INTEGRATION.md in the repository.
Questions: support@zepharionlabs.com. Status page and changelog coming soon.