You need a Bitnob Enterprise API key with permission to manage wallets, transactions, gas stations, and policies. All requests go to
https://api.platform.bitnob.com/v1 with the X-API-Key header, and every write takes an Idempotency-Key header. See Authentication and Making requests.Step 1: Find your pool vault
Customer deposit wallets live in a pool vault, which holds an unlimited number of wallets. Vaults are created in the Bitnob dashboard. Find yours with List vaults, filtered by type:id. Get vault reads one back. List chains returns the chains you can create wallets on.
Step 2: Onboard customers
For each customer and chain, create a wallet in the pool vault. Setcustomer_ref_id to your internal customer ID. The chain’s primary address is created with the wallet, so there’s no second call.
primary_address as their deposit address, and store the wallet id against their account. On account-based chains (EVM chains, Solana, Tron, TON) a wallet has exactly one address, and it receives every token on that chain. Only Bitcoin wallets can derive more addresses.
Don’t send network. It is deprecated: your API key decides it, with live keys on mainnet and sandbox keys on testnets.
Step 3: Detect deposits
Subscribe to each deposit address with Create subscription, so Bitnob posts on-chain events to your endpoint as they happen:event_type empty to receive every on-chain event type, or set one, such as incoming_token_tx or confirmation_threshold_met, to receive only that. Webhooks covers verifying deliveries.
As a fallback, and for reconciliation, poll List transactions:
completed. Reconcile on amount and asset, and use id or tx_hash to make sure each deposit is credited once.
Step 4: Set up gas stations
Customer wallets hold tokens, not the native asset for gas. Create a gas station for each chain, so withdrawals can be sponsored:threshold and refill_amount are in the native asset, ETH here. Read a station with Get gas station and alert when health_status is low, or subscribe to the gas_station.low_balance and gas_station.critical_balance events. Top up by hand with Refill gas station.
Set up a gas station covers sizing the threshold and refill amount.
Step 5: Process withdrawals
When a customer requests a withdrawal, create a transaction from their wallet withsponsor: true, so the gas station pays the network fee. Use your withdrawal ID as the Idempotency-Key.
201 Created: the policy allowed it. It is signed and submitted, andsponsoredistrue.202 Acceptedwithstatuspending_authorization: your policy requires approval. It executes once approvers approve.202 Acceptedwithstatusdelayed: a policy time lock holds it untilexecute_at.
completed, by webhook or with Get transaction, before you finalize the customer’s ledger entry. Handle held and rejected transactions covers the 202 cases.
Step 6: Configure your policy
Your organization enforces one policy at a time: an ordered list of rules, where the first rule that matches decides the outcome. Build it from the most restrictive rule down. First, set up the quorum. Configure your organization’s quorum in the Bitnob dashboard, with at least two approvers. The quorum approves every policy activation, so no single API key or person can weaken your controls. Without it, Activate policy returns422.
Then draft the policy. This one blocks anything from a treasury wallet to an address you don’t list, blocks withdrawals over $50,000, and holds withdrawals over $10,000 for one approval:
policy_id. Then call Activate policy, which sends it to your quorum. It becomes enforced once approved.
Write and activate your first policy walks through every call, and Require approval for high-value transfers shows tiered approvals.
Step 7: Monitor and reconcile
Run daily reconciliation against your internal ledger:- Transactions. Page through List transactions for the day with
created_at[gte]andcreated_at[lte]. Match each one to your withdrawal records by the transactionidyou stored from Create transaction, and checkamountandasset. - Stuck withdrawals. Alert on any transaction in
pending_authorizationordelayedbeyond your SLA, and confirm its state with Get transaction. - Gas stations. Check
health_statuswith List gas stations, and refill before it reacheslow. - Notification health. Review List subscription delivery events for failures, and retry them with Retry subscription delivery.