route.to set. Orchestra detects funding, creates the order, and delivers to recipientAddress without a separate confirm call.
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.
Flow
1
Estimate
Call
GET /v1/orchestration/estimate with the four route fields and amount as inputs change. Most estimates need no key. Authenticate for affiliate fees or shielded Zcash.2
Quote
Call Another pair uses the same request shape: 0.001 BTC on Spark into USDC on Solana.
POST /v1/orchestration/quote for deposit instructions. This example requests BTC on Spark for USDC on Base.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 /v2/orchestration/routes.3
Pay
Send
amountIn of the source asset to depositAddress before expiresAt. Include depositMemo when returned. Eligible late funding for variable quotes uses refreshed pricing; some expired submissions are rejected. Late funding for fixed-output quotes is held for review. See Pricing.4
Watch
Poll
GET /v1/orchestration/order?quoteId=QUOTE_ID with a server key until order is non-null, then follow the order on Status by webhook, SSE, or GET /v1/orchestration/status?id=ORDER_ID.Fixed-output quotes
Fixed-output quotes commit toestimatedOut when the full amountIn is funded before expiresAt.
Available to approved partners. Contact your Flashnet representative to request access.
Choose a destination in the source asset’s route.fixedTo set on /v2/orchestration/routes, using the same partner key as the quote.
Example: POST /v1/orchestration/quote for 50 USDC on Base into USDC on Arbitrum:
deliveryMode: "fixed" in the response. Send amountIn to depositAddress before expiresAt, then track Order status. Bitcoin funding must be observed by Flashnet before expiry; confirmation can follow later.
Underpayment can reduce the payout or require review; overpayment does not increase it. Late funding is held for review. See Pricing and Errors for funding rules and unsupported requests.
EVM funding transactions
SetincludeCalldata: true on /quote to receive an unsigned transaction alongside depositAddress. /offramp accepts the same flag. Omitting it or setting it to false leaves transaction out of the response.
chainId: numeric EVM chain ID for the source network.to: the token contract for ERC-20 funding, ordepositAddressfor native funding.data: encodedtransfer(depositAddress, amountIn)for ERC-20 funding, or"0x"for native funding.value: decimal string in native smallest units;"0"for ERC-20 funding or the quote’samountInfor native funding.
- ERC-20
- Native asset
This trimmed example transfers 50 USDC on Base to the illustrative deposit address The wallet calls the token’s
0x1111111111111111111111111111111111111111. Use the transaction from your own quote.transfer function and spends its own balance. No ERC-20 approval, allowance check, or transferFrom call is needed. Keep to set to the returned token contract; the deposit address is encoded in data.transaction.chainId, then send the returned to, data, and value. The wallet supplies the sender, nonce, and gas fees; ERC-20 transfers also require native gas. Convert value with BigInt for viem or ethers, or to a hex quantity for eth_sendTransaction. Never convert amounts through a JavaScript Number.
For exact-out quotes, the transaction encodes the finalized source amountIn. The request’s amount is the destination target and must not replace it. Send one funding transaction before expiresAt; Orchestra then detects, sweeps, and executes the deposit. A confirmed funding transaction does not mean the swap is complete. Follow Status, and use submit when you have the funding transaction hash or need recovery.
Only EVM sources with known native or ERC-20 metadata support the flag. Unsupported sources return 400 calldata_unsupported_source. A deposit instruction that needs a memo or cannot be encoded returns 502 calldata_unavailable; do not fund partial instructions. The flag is part of the idempotency body: use a new key when changing it, and reuse the same key and body after a timeout or 5xx.
Deposit address by source chain
- EVM
- Solana
- Spark
- Bitcoin
- Lightning
Send the quoted token or native asset on the source chain. If detection misses, submit the transaction:
sourceAddress is optional except on shared deposit addresses, where it identifies the sender.txHash, with sourceAddress when required for a shared address. For shielded Zcash, follow the verified receipts by quote ID.
When to call /submit
POST /v1/orchestration/submit reports funding when detection misses it or you have the transaction id already. Authenticate with the quote’s partner key and send the body for its source chain. Repeating the same deposit returns the existing order.
An order id is not guaranteed at broadcast. Bitcoin and TON paths can require observed deposit proof. After a definitive verification rejection, wait for evidence and use a new idempotency key for the next recovery attempt. Reuse the same key after a timeout or 5xx; see Idempotency. Keep polling and do not send another payment. On success, use the returned orderId and status, plus readToken for client keys.
Quote response
quoteId:q_...; use it for/orderand/submit.depositAddress: where the user sends the source asset. Use this quote’s instructions.depositMemo: memo or tag the deposit must carry; present only on provider routes that require one.transaction: unsigned EVM funding transaction, present only whenincludeCalldataistrue. See EVM funding transactions.amountIn: source amount the price is based on.estimatedOut: destination output; fixed-output quotes commit to it with timely, full funding. See Fixed-output quotes.deliveryMode:"fixed"when fixed delivery applies. Omitted for variable delivery.minimumAmountOut,lightningDeliveryFeeReserveSats: returned by some exact-in, variable quotes that deliver tolightning:BTC; treat both as optional. The reserve covers Lightning routing and is already deducted fromestimatedOut; it is a ceiling, not a charged fee.minimumAmountOutis the least the recipient receives after slippage. It is distinct fromminAmountOut, which applies to tokens named by address.feeAmount,feeBps: platform fee infeeAssetunits and its rate.totalFeeAmount: sum offeeAmount,roundingFeeAmount,appFeeAmount,sweepFeeAmount, andnetworkCostAmount.feeAsset: denomination of every fee field; see Fees.route: path labels, which may be symbols or asset ids. Do not use them as catalog keys.minAmountOut,fallback: present when the destination is a token named by address. See Any token.expiresAt: payment deadline, normally 2 minutes after creation. Shielded Zcash quotes allow 30 minutes to pay and carry a separatepriceValidUntil.priceLockMode,lockedMinAmountOut: optional price-lock policy and output floor. A price lock is separate from fixed delivery.- Shielded Zcash quotes add payment mode, funding, and delivery fields.
readToken: client keys only; bound to this quote and passed on status reads asreadTokenorX-Read-Token.tag: thetagyou sent, or null. See Tags.- Exact-out quotes add
amountMode,targetAmountOut,requiredAmountIn,maxAcceptedAmountIn, andinputBufferBps. - Lightning sources add
lightningReceiveRequestId, andflexibleAmount: truewhen the invoice has no amount.
Tags
Settag to your own reference, such as your order ID or an integrator ID, on /quote, /offramp, or /onramp. It is 1 to 64 letters, digits, ., _, :, or -. Other values return 400 validation_error; null is the same as omitting it. Every order the quote funds carries the tag. It appears on the create response, on /status, /order, and /history, and as data.tag on every order.* webhook, so you can match events to your records without storing Orchestra ids.
List a tag’s orders with GET /v1/orchestration/history?tag=order-8412.
Your account can block a tag or require a tag approved for that endpoint and route. An omitted or disallowed tag then returns 403 tag_not_allowed. See Errors.
A tag is not unique. A second deposit to a reused deposit address creates another order with the same tag, so key records on the order id. The tag is fixed once the quote exists: a replay with a different tag returns 409 idempotency_conflict. Whoever holds the key that creates the quote chooses the tag, so set it from your backend.
Rules
- Use each quote’s returned deposit instructions; do not reuse cached instructions.
- A quote is bound to the partner that created it. Only a key from the same partner can submit it.
affiliateIdandaffiliateIdsrequireAuthorization.- Send
sourceAddresson/quotewhen you know the sender. It is screened with the recipient and refund addresses, so a sender that is sanctioned, blocked, or already flagged fails at the quote, before the user funds. A sender Orchestra has not seen before is screened in full when the deposit arrives. Write an EVMsourceAddressin lowercase or EIP-55 checksum form. Do not rely on it as a refund address; sendrefundAddress. - A BOLT11 invoice sent as
recipientAddressneeds at least 20 seconds left when quoted. An expired invoice returns400 destination_bolt11_expired. One with less than 20 seconds left returns400 invoice_expiring_soon. A paid invoice returns409 invoice_already_paid. An invoice already in use for another payout can return409 invoice_in_flight.POST /v1/lightning/decodereads an invoice’s amount and expiry without paying it. - A Tron
refundAddressmust beTfollowed by 33 base58 characters, and not a known token contract or burn address. Anything else returns400 invalid_refund_address. The checksum is not verified, so validate the address yourself. - Send
refundAddresswhenever you can. It is required for exact-out, for Lightning destinations, for a source token named by address, and for deposits from BNB, native TON, Tron, XRP, Litecoin, and Zcash. Without it, Orchestra refunds to the detected source address only when that is safe, and never to an exchange’s shared sender address.