Skip to main content
All paths are relative to https://mapi.zbx.boomfi.xyz/v1 (includes /v1). Send X-API-KEY on every request. Successful responses wrap payload in {"data": …}; failures use the error envelope. Amounts are decimal strings. Request and response schemas for Instruments, Quotes, and Orders are in the API reference.

Accounts and balances

GET /accounts/virtual

Returns your virtual account and per-chain sub-accounts. Each sub-account’s address is your funding address for that chain: deposit directly (for example from custody); credit lands after on-chain confirmation.

GET /accounts/virtual/balances

Returns every non-zero balance across the virtual account hierarchy: crypto per chain plus fiat ledgers. pending_amount covers value locked or in flight (for example mid-trade), so funds are never invisible during a conversion. amount_billing_currency and total_balance are USD-equivalent when present. Fiat settlement requires a registered fiat external account. Off-ramp proceeds in USD / EUR / GBP are delivered to the bank account you register for that currency.

Fiat external accounts

Register a bank account once per settlement currency via:
New registrations start Pending and are disabled while details are verified: settlement only uses enabled, verified accounts. Manage registrations with GET /bankAddressBook and GET / PATCH / DELETE /bankAddressBook/{id}. Once enabled, the account is used automatically for fiat settlement in its currency: or target it explicitly with settlement_account_id on a trade.

Getting an estimate (dry run)

Add "dry_run": true on Quick Trade or Sweep Trade to receive a priced quote without execution. Dry runs do not require sufficient balance, do not reserve funds, and do not create an order: use them to display prices to end users.
All-in pricing. The quoted receive amount is net: spread, network costs, and fees are already deducted. The fees object is an informational breakdown. Prefer the effective rate from the response (receive amount ÷ total sell amount). There is nothing to add on top.

Quick Trade: POST /trade/quicktrade

Quotes and executes in one atomic call, funded from a balance you already hold. Covers crypto → crypto across chains and crypto → fiat (off-ramp). Fiat-funded trades use the same shape when enabled for your organisation.

Rules worth knowing

  • If no settlement target is given, crypto proceeds settle back to your account on the buy chain; fiat buys go to your enabled fiat external account for that currency.
  • Selling and buying the exact same currency + chain is rejected: use a payout for plain transfers.
  • On Polygon (137), POL and MATIC are accepted as aliases.
  • Solana native SOL: a sell must either take the balance to exactly zero or leave at least 0.00089088 SOL (rent-exemption). Amounts that would strand dust below that minimum are rejected with an explanatory error.
  • Fiat-funded trades (currency as fiat, no chain_id) are enabled per organisation: ask your ZBX contact.

Example requests

Off-ramp: sell 25,000 USDC (Polygon) → USD
Off-ramp: sell 26,000 USDT (BNB Chain) → EUR
Cross-chain: USDC (Polygon) → USDC (Ethereum), delivered to custody

Sweep Trade: POST /trade/sweeptrade

Sweeps every eligible balance under your virtual account into a single target asset in one basket order (for example end-of-day consolidation into USDC on Ethereum, or into USD). Same shape as Quick Trade minus currency / amount (sell side is discovered from balances), plus thresholds:

Sweep behaviour

  • The target balance itself (same currency + chain) is never swept.
  • Native gas tokens worth under $10 are left alone so sub-accounts keep gas.
  • Native SOL sweeps automatically leave the rent-exempt minimum.
  • When the target is fiat, existing fiat balances are excluded (no fiat→fiat conversion).
  • The response is a single order whose sell currency / amount fields may be comma-separated lists: one entry per swept balance.
Example: consolidate everything ≥ $25 into USDC on Ethereum

Orders: GET /trade/order

Paginated list of orders, newest first. Filter with status and standard paging parameters. Polling, not webhooks. Trade orders do not emit webhook events: poll GET /trade/order (every 5–10 s while Open, backing off after a few minutes). Most balance-funded conversions complete within minutes; timing varies with networks and rails.

Discovery

GET /trade/currencies

Tradable currency universe: symbol, type (Fiat / Digital) and, for tokens, supported chain_ids with token contract addresses. Cached ~1 minute.

GET /trade/swap-targets

Every currency + chain reachable from a starting asset, filtered to chains your account can settle on: useful for destination pickers.

Errors

Standard envelope (Response Patterns):

Next