Skip to main content
Use staging while building automation. Keep 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:
Use staging keys against staging URLs. Production API access requires completed KYB and an explicit invitation from Stabyl; staging access does not grant production access. After invitation, use production credentials only against the production URL. Treat cross-environment authentication failures as configuration errors, not transient failures.

1. Subscribe to webhooks

Create your HTTPS receiver before initiating asynchronous activity:
Store the returned whsec_... secret immediately; it is shown only once. See Webhooks for signature verification and durable deduplication.

2. List supported chains

This route is public. Use it to decide which chain options to show before you request a crypto deposit address.

3. Request a Tron deposit address

Addresses are created only when requested for a chain. Store the returned chain, optional slug, address, and memo exactly as returned.

4. Read balances

Use available for actions that require spendable balance. Use locked to explain funds committed to pending activity.

5. Create an order

Order creation is asynchronous. A successful response means the request was accepted for processing, not that the order is filled.

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

Store the returned cursor and continue paging until 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 from withdrawal.success or withdrawal.failed; use the transaction detail route only for targeted recovery and reconciliation.