Home / Crypto Payment API
Crypto Payment API
The E8 Pay crypto payment API is a JSON REST API at https://open.e8qianbao.com/partner/v1: create orders, generate player deposit addresses, query, refund and pay out in USDT on TRC20 and ERC20, with signed callbacks for every result.
It is for developers who add crypto payments to a website, app, Telegram bot or platform, alone or for several merchants through a developer account.
To integrate, get a collect merchant's API access (or a developer account), sign each request with HMAC-SHA256, test against the local mock server, then go live with a small real order.
- REST + JSON over HTTPS
- TRC20 · ERC20
- Python, Node.js, PHP, Go, Java samples
- OpenAPI 3
Coins and chains
| What | Coins and networks |
|---|---|
| Orders (buyers pay) | USDT on TRC20 or ERC20 in the web checkout and online; USDT or USDC balance in the Telegram wallet. You always receive USDT |
| Player deposit addresses | USDT on TRC20 (TRX is reported separately) and on ERC20 with "network": "ERC20" |
| Payouts to E8 wallets | USDT, TRX, EB |
| On-chain payouts | TRC20: USDT / TRX; ERC20: USDT / USDC |
The API does not take ETH (Ethereum's native coin), TON or USDT on TON. Which networks you can use right now: GET /partner/v1/assets/USDT/networks.
REST API and callbacks
- Every response has the same envelope with the data in
dataand arequest_idto quote to support; ignore JSON fields you do not know. - Requests are signed with HMAC-SHA256 over the method, full path with query string, timestamp, nonce and the SHA-256 of the raw body; an IP allowlist is required.
- Callbacks are POSTed JSON with
X-TE-Event,X-TE-Event-Id,X-TE-TimestampandX-TE-Signature; verify HMAC-SHA256(callback secret, timestamp + "." + raw body), deduplicate by event ID, return 2xx. Failed deliveries are retried for about 24 hours. - Money-moving requests (payouts, chain payouts, refunds) need an
Idempotency-Key; resend with the same key and body after a timeout. - Rate limits: 300 requests a minute per source IP, 60 a minute per client by default; above it 429
RATE_LIMITED.
// Node.js 18+ (built-in fetch and crypto). TE_KEY_ID and TE_SECRET come from the environment.
const crypto = require("node:crypto");
const API = process.env.TE_API || "https://open.e8qianbao.com";
const KEY_ID = process.env.TE_KEY_ID;
const SECRET = process.env.TE_SECRET;
async function call(method, path, payload, idempotencyKey) {
// path includes the query string exactly as sent, e.g. /partner/v1/collect/deposits?limit=50
method = method.toUpperCase();
const body = payload === undefined ? "" : JSON.stringify(payload);
const ts = Math.floor(Date.now() / 1000).toString();
const nonce = crypto.randomBytes(16).toString("hex");
const bodySha = crypto.createHash("sha256").update(body, "utf8").digest("hex");
const canonical = [method, path, ts, nonce, bodySha].join("\n");
const headers = {
"Content-Type": "application/json",
"X-TE-Key": KEY_ID,
"X-TE-Timestamp": ts,
"X-TE-Nonce": nonce,
"X-TE-Signature": crypto.createHmac("sha256", SECRET).update(canonical, "utf8").digest("hex"),
};
if (idempotencyKey) headers["Idempotency-Key"] = idempotencyKey;
const res = await fetch(API + path, { method, headers, body: body === "" ? undefined : body });
return { status: res.status, doc: await res.json().catch(() => ({ success: false })) };
}
call("POST", "/partner/v1/collect/orders", { external_ref: "ORDER-1001", amount: "75.24" }).then(({ status, doc }) =>
console.log(status, doc.success ? doc.data.checkout_url : doc)
);SDK and OpenAPI
- Developer kit: Python, Node.js, PHP, Go and Java samples for signing, orders, queries, refund requests and callback verification with de-duplication.
- The local mock server
e8_mock.pysimulates orders, payment, expiry, player deposits, refund requests and signed callbacks at127.0.0.1:8787, with the same signing algorithm and no real money. partner-openapi.jsondescribes only the public/partner/v1API in OpenAPI 3, for API tools and client generators; the four signature headers still have to be computed by your code.
Testing without a sandbox
- Run the developer kit against the local mock server.
- Self-test your signature with
GET /partner/v1/me. - Send test callbacks by event type with
POST /partner/v1/webhooks/test: they carrytest: trueand theX-TE-Test: 1header, use order numbers starting withE8TEST-, and must never be credited. - Pay a small real order end to end, then work through the go-live checklist.
Pricing
- Payments and player deposits are credited minus the collection fee at your merchant rate; callbacks carry the net amount in
net. - Collect merchants pay no bond.
- ERC20 on-chain payouts cost the platform fee plus Ethereum gas at the quote at request time (plus a cross-network service fee when the USDT came from TRC20 deposits), taken from the merchant balance with the amount.
More: Fees.
FAQ
Which languages are supported?
Any language that can compute HMAC-SHA256 and send HTTPS. The developer kit has Python, Node.js, PHP, Go and Java samples, and the docs show curl, Python, Node.js and PHP signing.
Is there a sandbox or test environment?
No. Use the local mock server, test callbacks (test: true) and a small real order.
Can one team integrate several merchants?
Yes, with a developer account: each merchant grants access with its payment PIN and gets its own keys (tdk_…); one key works for one merchant, and the merchant can revoke at any time.
Why do I get INVALID_SIGNATURE?
Check that the method is upper case, the path includes the query string exactly as sent, the body was not serialized again after signing, an empty body uses the hash e3b0c442…, and the Secret is complete; compare step by step with the test vector.
How do I know whether the platform is under maintenance?
See the service status page: the API, webhook delivery, TRON deposits, Ethereum deposits and the web checkout each show Operational, Delayed or Maintenance, updated every minute.