A step-by-step walk from creating your account to receiving your first payment webhook.
Open @XthonPayBot and press Start. Your unique HD wallet is derived immediately.
Inside the bot, open API Keys. Scope the key to read or withdraw. Add an IP whitelist for production.
Call POST /v1/invoices. Show the returned deposit_address to your customer.
On payment, we POST invoice.paid to your callback_url. Credit the order and respond 200.
All API requests require your API key in the X-API-Key header.
import requests API_KEY = "xpay_live_your_key_id" BASE = "https://xthonpay.com/v1" HEADERS = { "X-API-Key": API_KEY, "Content-Type": "application/json", } def api_get(path): return requests.get(BASE + path, headers=HEADERS).json() def api_post(path, body): return requests.post(BASE + path, json=body, headers=HEADERS).json()
The invoice response includes a unique deposit_address. Show it to your customer — when they send USDT to it, we detect the payment automatically.
# Create a 50 USDT invoice resp = api_post("/invoices", { "amount": "50.00", "external_id": "order_12345", "callback_url": "https://yourapp.com/webhooks/pay", }) deposit_address = resp["data"]["deposit_address"] print(f"Customer should send to: {deposit_address}")
On payment we POST to your callback_url. Respond HTTP 200 to acknowledge. If we don't receive 200, we retry up to 3 times with escalating delay (5s, 10s, 15s).
from flask import Flask, request app = Flask(__name__) @app.route("/webhooks/pay", methods=["POST"]) def handle_webhook(): event = request.json if event["event"] == "invoice.paid": order_id = event["data"]["external_id"] amount = event["data"]["amount_received"] fulfill_order(order_id, amount) return "OK", 200
invoice_id to deduplicate.
Send USDT from your wallet to any BSC address. No service fees — you only pay on-chain gas.
resp = api_post("/withdraw", { "amount": "100.00", "to_address": "0x71C765…62b", }) print(f"Withdrawal {resp['id']}: {resp['status']}")
invoice_id.GET /v1/invoices/{id} is authoritative.Open the bot, get your API key, make your first request.