X-Api-Key in a backend service, job runner, or secure internal tool. Never expose it in browser, mobile, desktop, or user-controlled code.
0. Configure Your Environment
Create a staging API key in the Stabyl staging app, then configure your server-side environment:1. Subscribe to webhooks
Create your HTTPS receiver before initiating asynchronous activity:whsec_... secret immediately; it is shown only once. See
Webhooks for signature verification and durable deduplication.
2. List supported chains
3. Request a Tron deposit address
chain, optional slug, address, and memo exactly as returned.
4. Read balances
available for actions that require spendable balance. Use locked to explain funds committed to pending activity.
5. Create an order
6. Receive order status changes
Use exchange webhooks for durable lifecycle events. Use private WebSocket topics when your application also needs low-latency order and fill streams. REST order detail remains available for startup recovery, missed-event repair, and operator lookups:7. Reconcile wallet activity
next_cursor is null.
Run this as periodic reconciliation and after webhook downtime rather than as a
per-transaction polling loop. Reconciliation jobs should be restartable and
should tolerate records arriving after confirmation or settlement updates.
8. Submit a withdrawal
Follow Withdrawal examples to quote, sign, and submit NGN or stablecoin withdrawals. Persist the returned transaction ID and complete the workflow fromwithdrawal.success or withdrawal.failed; use the
transaction detail route only for targeted recovery and reconciliation.