Skip to main content
This flow converts 50 USDC on Base into BTC on Spark: discover the route, quote it, fund it, and follow the order.

Prerequisites

  • An Orchestra account. Create one in the dashboard. Flashnet reviews new accounts before enabling API access.
  • A server key (fn_...) from API keys in the dashboard. Keep it on your backend. For browsers and apps, use a scoped client key (fnp_...); see Authentication.
1

Read routes and limits

Both endpoints are public. /routes lists assets and their destinations; /limits gives amount bounds. Filter it to the pair:
Read capability from the route.to set on the source asset, not from the symbol. Details in Routes and limits.
2

Estimate

/estimate is public and stateless. Use it to preview the price as inputs change:
3

Quote

A quote returns deposit instructions and pricing valid for 2 minutes, subject to slippage. Amounts are integer strings in smallest units: "50000000" is 50 Base USDC.
Replace SERVER_KEY with your fn_... key. Use a new X-Idempotency-Key for each operation and reuse it when retrying that same request. Amounts are integer strings in the asset’s smallest unit: "100000" is 0.001 BTC; "50000000" is 50 USDC on Base. Read each asset’s decimals from /routes.
Illustrative response, trimmed; use the values from your own quote:
4

Pay the deposit address

Send the returned amountIn of USDC to depositAddress on Base before expiresAt. Orchestra detects the deposit and creates the order without a confirm call. Eligible late funding uses refreshed pricing without the original price guarantee; acceptance is not assured.
5

Watch it settle

Poll the quote with a server key until order is non-null, then read the order by id:
A successful order reaches completed; intermediate stages vary by route. Handle failures and refunds too. Status covers polling, webhooks, and SSE. If detection misses the deposit, submit its transaction; order creation may require deposit verification.

Next

  • Quotes for deposit rules and the /submit body.
  • Pricing for estimate versus quote and amount modes; Fees for who pays what.
  • Fiat onramp for USD in over Lightning through one call.