https://orchestration.flashnet.xyz
The Minimal Flow
Create a webhook endpoint
Register a webhook endpoint and store the returned secret.Verify inbound webhooks using
X-Flashnet-Signature and the raw request body. See Webhooks.Request a quote
Quotes expire 30 minutes after creation.Quote requests that you intend to submit must include
Authorization and X-Idempotency-Key.Example (exact-in, default mode): buy BTC on Spark with USDC on Base.Send the deposit
Send the source asset to
depositAddress.The deposit instruction depends on the route:- Base/Solana source (
sourceChain = base|solana):depositAddressis a chain address that receives the source asset. - Spark source (
sourceChain = spark):depositAddressis a Spark address. - Bitcoin source (
sourceChain = bitcoin):depositAddressis a Bitcoin L1 address. - Lightning source (
sourceChain = lightning):depositAddressis a BOLT11 invoice.
amountIn.Submit the deposit
Submitting creates an order. Processing is async.Submit shape depends on the quote See API Reference for the full request shapes and optional fields.
submit requires:Authorization: Bearer fn_...X-Idempotency-Key
sourceChain. Examples:Picking a Route
- Swaps: start with Stablecoin to BTC or BTC to Stablecoin.
- Reusable deposit addresses: use Accumulation Addresses or Liquidation Addresses when you do not want to call
/quoteand/submitper deposit.
Advanced Workflows
Exact-out payments (Bitcoin -> USDC)
Exact-out payments (Bitcoin -> USDC)
Exact-out mode (For exact-out quotes, the response adds:
amountMode=exact_out) is currently supported only for bitcoin:BTC -> (base|solana):USDC.Quote request:targetAmountOutrequiredAmountInmaxAcceptedAmountIninputBufferBps
- Use
requiredAmountInas the primary send amount. - Stay at or below
maxAcceptedAmountInfor auto-acceptance. - If actual input is below
requiredAmountIn, abovemaxAcceptedAmountIn, or if latest expected output cannot satisfy the target, the order moves toawaiting_approval.
Affiliate fees (appFees / affiliateId)
Affiliate fees (appFees / affiliateId)
Affiliate fees let you allocate an app fee to one or more recipients on supported routes.Two models:Optional registry setup:Current app-fee constraints:
- Inline recipients:
appFees: [{ recipient: string, fee: number }] - Registry by id:
affiliateId: stringwith profiles managed byPUT|GET|DELETE /v1/affiliates/*
spark:BTC -> solana:USDC):amountModemust beexact_in.sourceChainordestinationChainmust bebaseorsolana.- Use either
appFeesoraffiliateId, not both. affiliateIdrequires authenticated quote requests.appFeesrecipient addresses must match the fee-settlement chain (sourceChainwhen it isbase|solana, otherwisedestinationChain).- For
affiliateId, the stored profile must have a recipient address for the quote settlement chain.
Repricing and refunds (awaiting_approval)
Repricing and refunds (awaiting_approval)
If the order status is Reject and fail:Reject and refund BTC (Bitcoin source orders):
awaiting_approval, inspect:order.repriceorder.priceLockorder.paymentIntent
reprice/refund returns status=refunding. Final status is refunded (or failed if refund execution fails).Recommended Data Model
Persist these identifiers:quoteIdorderId- the source transaction identifier you submitted (
txHash,bitcoinTxid+bitcoinVout, Spark transfer id, or Lightning receive request id)
order.statusorder.repriceorder.paymentIntentorder.refund