---
name: flashnet-orchestra
description: Integrate Flashnet Orchestra swaps, Lightning payments, and standing deposit addresses. Use when building quote-to-delivery flows, choosing an integration, or handling order updates.
---

# Flashnet Orchestra

Orchestra converts deposited assets and delivers the output to a recipient. The API base URL is `https://orchestration.flashnet.xyz`.

## Read the contract

Start with [Quickstart](https://docs.flashnet.xyz/orchestra/quickstart.md) and [Authentication](https://docs.flashnet.xyz/api/authentication.md). Fetch only the guides relevant to the task; [llms.txt](https://docs.flashnet.xyz/llms.txt) lists the rest.

Use the [official OpenAPI document](https://orchestration.flashnet.xyz/openapi.json) for request and response shapes. Use the guides for execution behavior. Read live routes and limits for availability and amounts; do not infer support from a network logo or token symbol. If the contract and a guide disagree, identify the discrepancy before implementing that part.

## Choose the flow

- [Quotes](https://docs.flashnet.xyz/orchestra/quotes.md): a swap with per-payment pricing and deposit instructions. Approved partners can request [fixed-output quotes](https://docs.flashnet.xyz/orchestra/quotes.md#fixed-output-quotes) on eligible exact-in routes; follow the funding rules in that section.
- [Lightning onramp](https://docs.flashnet.xyz/orchestra/onramp.md): create a Lightning-funded order in one call.
- [Offramp](https://docs.flashnet.xyz/orchestra/offramp.md): pay a Cash App username or Lightning address from a deposited asset. Cash App dollars require "Receive Lightning as dollars" in the Bitcoin section.
- [Pay links](https://docs.flashnet.xyz/orchestra/pay-links.md): reusable Lightning checkout.
- [Standing deposit addresses](https://docs.flashnet.xyz/orchestra/deposit-addresses.md): repeated deposits into one configured destination. Prefer these over legacy accumulation and liquidation addresses for new integrations.
- [Fees](https://docs.flashnet.xyz/orchestra/fees.md): affiliate fees, reporting, and claims.

## Build a swap

1. Discover the pair and its amount bounds using [Routes and limits](https://docs.flashnet.xyz/orchestra/routes-and-limits.md). Use the source asset's `route.to` destinations and returned decimals. A token outside the catalog is named by contract address or mint on chains in `tokenSupport`; see [Any token](https://docs.flashnet.xyz/orchestra/any-token.md).
2. Use an estimate for previews. Create an authenticated quote when the user commits; persist the quote ID, expiry, and returned funding instructions. See [Pricing](https://docs.flashnet.xyz/orchestra/pricing.md) for exact-in and exact-out.
3. Present the returned `amountIn`, source chain, asset, deposit address, and memo when present. The user funds those instructions. Do not send another payment to recover from a timeout.
4. Orchestra detects funding and creates the order. A server can poll `/v1/orchestration/order?quoteId=QUOTE_ID` until `order` is non-null. `/submit` reports a deposit when detection misses it or transaction proof is available; it is not a mandatory confirmation step.
5. Follow [Order status](https://docs.flashnet.xyz/orchestra/status.md) through delivery or recovery. The status response is `{ order, stages }`; read `order.status`. Do not assume a fixed sequence of intermediate states or guaranteed automatic refunds.

## Preserve these constraints

- Keep server keys (`fn_...`) on the backend. Client keys (`fnp_...`) need appropriate scopes and matching read tokens. Client quote tracking uses `/status?quoteId=QUOTE_ID`, not the server-only `/order` endpoint. Read-token binding differs for status and SSE; follow the authentication guide.
- Send amounts as integer strings in the asset's smallest unit. Do not use floating-point arithmetic for amounts.
- Persist one idempotency key per mutation. After a timeout or 5xx, retry the same endpoint with the same key and body. After a definitive rejection, a corrected request or new deposit-verification attempt needs a new key. Client replay scope also depends on the issuing key and caller IP. Follow [API conventions](https://docs.flashnet.xyz/api/overview.md) and [Errors](https://docs.flashnet.xyz/api/errors.md).
- Use each quote's funding instructions and expiry. Late funding is not guaranteed acceptance or the original price. Supply a refund address and handle recovery.
- For webhooks, verify the timestamp and HMAC over the raw body before parsing. Persist events before acknowledging; handle duplicates and out-of-order delivery using the status guide's example and [event catalog](https://docs.flashnet.xyz/api/webhook-events.md).
- Standing instructions are immutable. Keep a stable customer reference, persist the instruction, and create a new reference for a different destination. Pausing does not refund deposits. Read the standing-address guide before implementing recovery.

## Verify the integration

Use mocked responses to test a quote with no order yet, a timed-out mutation retried without duplication, and failed or refunded orders. Test webhook tampering, stale signatures, duplicate events, and out-of-order delivery when using webhooks. For standing addresses, test an instruction conflict and deposits held rather than converted.

Building an integration does not authorize moving funds. Use placeholders and fixtures unless the user explicitly authorizes a live operation. Report what was tested and any contract ambiguity that remains.
