### User Summary API Response Example Source: https://docs.flashnet.xyz/rewards/integrators/api Example JSON response for the Get User Summary endpoint, detailing a user's financial and rewards status. ```json { "pubkey": "02abc...def", "usdbBalance": { "raw": "10000000000", "display": "10000" }, "volumeUtcToday": { "swapSats": 5000000, "swapCount": 12 }, "rewardsBracket": 3, "rewardsPercent": 5.0, "estimatedSatsToday": 1370 } ``` -------------------------------- ### End-to-End Client Key Orchestration Example Source: https://docs.flashnet.xyz/products/orchestration/api/client-keys This example demonstrates the complete flow of using client keys to quote, submit, and poll the status of an order. It requires generating idempotency keys and using a bearer token for authorization. The read token obtained after submission is crucial for polling status. ```bash # 1. Quote curl -sS -X POST "https://orchestration.flashnet.xyz/v1/orchestration/quote" \ -H "Authorization: Bearer fnp_..." \ -H "X-Idempotency-Key: quote:$(uuidgen)" \ -H "Content-Type: application/json" \ -d '{ "sourceChain": "base", "sourceAsset": "USDC", "destinationChain": "spark", "destinationAsset": "BTC", "amount": "100000000", "recipientAddress": "spark1...", "slippageBps": 50 }' ``` ```bash # 2. Submit — response includes readToken curl -sS -X POST "https://orchestration.flashnet.xyz/v1/orchestration/submit" \ -H "Authorization: Bearer fnp_..." \ -H "X-Idempotency-Key: submit:$(uuidgen)" \ -H "Content-Type: application/json" \ -d '{ "quoteId": "quote_...", "depositTransactionId": "0x..." }' # -> { "orderId": "op_...", "readToken": "eyJ..." } ``` ```bash # 3. Poll status — read-token required (pass as ?readToken= or X-Read-Token header) curl -sS "https://orchestration.flashnet.xyz/v1/orchestration/status?id=op_..." \ -H "Authorization: Bearer fnp_..." \ -H "X-Read-Token: eyJ..." ``` -------------------------------- ### Example Pay Link URL Source: https://docs.flashnet.xyz/products/orchestration/pay-links This is an example of a Pay Link URL. The `shortId` at the end is unique to the link's configuration. ```text https://orchestration.flashnet.xyz/pay/DNHKySOZ ``` -------------------------------- ### Get Endorsements API Response Example Source: https://docs.flashnet.xyz/rewards/integrators/api Example JSON response for the Get Endorsements endpoint, showing the endorser's public key and a list of recipients with their allocated ratio in basis points. ```json { "endorser": "02abc...def", "endorsements": [ { "to": "03fed...cba", "ratioBps": 3000 }, { "to": "02012...999", "ratioBps": 2000 } ] } ``` -------------------------------- ### Payout History API Response Example Source: https://docs.flashnet.xyz/rewards/integrators/api Example JSON response for the Get Payout History endpoint, detailing past rewards and endorsement payouts for a user. ```json { "pubkey": "02abc...def", "payouts": [ { "day": "2026-02-09", "usdbBalance": { "raw": 10000000000, "display": 10000 }, "volume": { "swapSats": 5000000 }, "rewardsBracket": 3, "annualRewardsBps": 500, "rewardsPayoutSats": 1020, "endorsementsPayoutSats": 350, "payoutSats": 1370, "status": "paid", "txId": "abc123...", "createdAt": "2026-02-09T00:05:00Z", "paidAt": "2026-02-10T00:05:00Z" } ], "pagination": { "total": 45, "limit": 30, "offset": 0 } } ``` -------------------------------- ### Rewards Leaderboard API Response Example Source: https://docs.flashnet.xyz/rewards/integrators/api Example JSON response for the Get Rewards Leaderboard endpoint, showing user rewards data including balance, today's volume, rewards bracket, and percentage. ```json { "rewards": [ { "pubkey": "02abc...def", "usdbBalance": { "raw": "10000000000", "display": "10000" }, "volumeUtcToday": { "swapSats": 5000000, "swapCount": 12 }, "rewardsBracket": 3, "rewardsPercent": 5.0, "estimatedSatsToday": 1370 } ], "meta": { "total": 830, "limit": 100, "offset": 0 } } ``` -------------------------------- ### Response for Creating a Liquidation Address Source: https://docs.flashnet.xyz/products/orchestration/api/resources Example response when a liquidation address is successfully created. ```json { "liquidationAddressId": "liq_...", "sparkAddress": "spark1...", "l1DepositAddress": "bc1...", "destination": { "chain": "ethereum", "asset": "USDC", "address": "0x..." }, "feeBps": 5, "slippageBps": 50, "enabled": true, "createdAt": "2026-02-04T01:00:00.000Z", "appFees": [ { "affiliateId": "platform-fee", "recipient": "So1PlatformPayoutAddress...", "feeBps": 25 } ] } ``` -------------------------------- ### Create Liquidation Address with Registered Affiliates Source: https://docs.flashnet.xyz/products/orchestration/api/resources Example of creating a liquidation address with registered affiliates and per-address fee overrides. ```json { "label": "optional", "destinationChain": "ethereum", "destinationAsset": "USDC", "destinationAddress": "0x...", "slippageBps": 50, "feeBps": 5, "affiliateIds": [ "referrer-alice", { "affiliateId": "platform-fee", "feeBps": 25 } ] } ``` -------------------------------- ### Example Completed Order Webhook Payload (lightning:BTC -> spark:USDB) Source: https://docs.flashnet.xyz/products/orchestration/onramp A detailed example of a webhook payload for a completed order on the lightning:BTC to spark:USDB route. This route skips bridging and delivery steps. ```json { "event": "order.completed", "timestamp": "2026-01-15T12:05:12.000Z", "data": { "id": "ord_abc123", "type": "order", "status": "completed", "quoteId": "q_xyz789", "amountIn": "100000", "amountOut": "96543210", "feeBps": 20, "feeAmount": "19308", "slippageBps": 50, "source": { "chain": "lightning", "asset": "BTC", "address": null, "txHash": null, "sweepTxHash": null }, "destination": { "chain": "spark", "asset": "USDB", "address": "spark1RecipientAddress...", "txHash": null }, "depositAddress": "lnbc1000n1pj...", "recipientAddress": "spark1RecipientAddress...", "flashnetRequestId": null, "sparkTxHash": "a1b2c3d4...", "refund": { "asset": null, "amount": null, "txHash": null }, "error": null, "createdAt": "2026-01-15T12:04:00.000Z", "updatedAt": "2026-01-15T12:05:12.000Z", "completedAt": "2026-01-15T12:05:12.000Z", "swap": { "version": 1, "legs": { "full": { "provider": "flashnet", "poolId": "pool_btc_usdb", "assetInAddress": "BTC", "assetOutAddress": "USDB", "amountIn": "100000", "expectedAmountOut": "96543210", "minAmountOut": "96060493", "amountOut": "96543210", "slippageBpsRequested": 50, "slippageBpsUsed": 50, "simulation": { "executionPrice": "96543.21", "priceImpactPct": "0.01", "feePaidAssetIn": null, "warningMessage": null }, "execution": { "executionPrice": "96543.21", "feeAmount": null, "requestId": "req_...", "outboundTransferId": null }, "recordedAt": "2026-01-15T12:05:10.000Z" } } } } } ``` -------------------------------- ### Order History Response Example Source: https://docs.flashnet.xyz/products/orchestration/api/quotes-and-orders This is an example of the JSON response structure for order history entries. ```json { "orders": [{ "id": "ord_...", "status": "completed" }] } ``` -------------------------------- ### Create Liquidation Address with Inline App Fees Source: https://docs.flashnet.xyz/products/orchestration/api/resources Example of creating a liquidation address with inline app fee recipients. ```json { "label": "optional", "destinationChain": "ethereum", "destinationAsset": "USDC", "destinationAddress": "0x...", "slippageBps": 50, "feeBps": 5, "appFees": [ { "recipient": "So1FeeRecipient...", "fee": 50 } ] } ``` -------------------------------- ### Get Supported Routes Source: https://docs.flashnet.xyz/products/orchestration/overview Retrieve a list of all available trading pairs and supported chain/asset combinations. ```APIDOC ## GET /v1/orchestration/routes ### Description Fetches a list of all available trading routes, detailing supported source and destination assets across various chains. ### Method GET ### Endpoint /v1/orchestration/routes ### Response #### Success Response (200) - **routes** (array) - A list of available trading routes. - **sourceChain** (string) - The chain of the source asset. - **sourceAsset** (string) - The source asset symbol. - **destinationChain** (string) - The chain of the destination asset. - **destinationAsset** (string) - The destination asset symbol. #### Response Example { "routes": [ { "sourceChain": "ethereum", "sourceAsset": "USDC", "destinationChain": "spark", "destinationAsset": "BTC" }, { "sourceChain": "lightning", "sourceAsset": "BTC", "destinationChain": "base", "destinationAsset": "USDC" } ] } ``` -------------------------------- ### BTC to USDT (Tron) with Slippage Source: https://docs.flashnet.xyz/products/orchestration/btc-to-stablecoin This example illustrates a BTC to USDT conversion to the Tron network, specifying a slippage tolerance. ```json { "sourceChain": "spark", "sourceAsset": "BTC", "destinationChain": "tron", "destinationAsset": "USDT", "amount": "100000", "recipientAddress": "TYourTronAddress...", "slippageBps": 50 } ``` -------------------------------- ### Submit Deposit for Spark Source: https://docs.flashnet.xyz/products/orchestration/integration Example JSON payload for submitting a deposit when the source chain is Spark. ```json { "quoteId": "q_...", "sparkTxHash": "spark_transfer_id_or_token_tx_hash" } ``` -------------------------------- ### Affiliate Claim Response Source: https://docs.flashnet.xyz/products/orchestration/api/resources Example response when creating an affiliate claim. The status indicates the claim is processing. ```json { "claimId": "acl_...", "affiliateId": "flashpartner", "amount": "5000000", "status": "processing", "createdAt": "2026-02-27T12:00:00.000Z" } ``` -------------------------------- ### Get User Points Source: https://docs.flashnet.xyz/rewards/integrators/api Fetches the Flashpoints balance, rank, and projected daily earnings for a specific user identified by their public key. ```bash GET /v1/points/:pubkey ``` ```json { "pubkey": "02abc...def", "currentPoints": 1250000, "lifetimePoints": 1500000, "rank": 42, "projectedDailyPoints": 1236, "volumeUtcToday": { "swapSats": 5000000, "liquiditySats": 0 } } ``` -------------------------------- ### Accept ZeroConf Offer for Instant Credit Source: https://docs.flashnet.xyz/products/orchestration/zeroconf Use this endpoint to accept a ZeroConf offer, which provides instant credit for a Bitcoin deposit. Ensure you include the correct order ID and idempotency key. ```bash curl -sS -X POST "https://orchestration.flashnet.xyz/v1/orchestration/zeroconf/accept" \ -H "Authorization: Bearer fn_..." \ -H "X-Idempotency-Key: zeroconf:accept:YOUR_KEY" \ -H "Content-Type: application/json" \ -d '{"orderId": "ord_..."}' ``` -------------------------------- ### Create Quote with Source-Side Affiliate Fees Source: https://docs.flashnet.xyz/products/orchestration/api/quotes-and-orders This example demonstrates including affiliate fees when the source chain is Solana and the destination is Spark. Fees are specified with recipient and fee basis points. ```json { "sourceChain": "solana", "sourceAsset": "SOL", "destinationChain": "spark", "destinationAsset": "BTC", "amount": "100000000", "recipientAddress": "spark1...", "appFees": [ { "recipient": "Dtkxt55zEUDj6NTXGRtH8uQsACsTjoSVkXfYBEF8xkkT", "fee": 100 } ] } ``` -------------------------------- ### BTC to USDC with Affiliate Fees Source: https://docs.flashnet.xyz/products/orchestration/btc-to-stablecoin This example demonstrates how to include affiliate fees in a BTC to USDC conversion. Fees are settled in USDC on the destination chain. ```json { "sourceChain": "spark", "sourceAsset": "BTC", "destinationChain": "solana", "destinationAsset": "USDC", "amount": "100000", "recipientAddress": "So1RecipientAddress...", "appFees": [ { "recipient": "So1AffiliateOne...", "fee": 100 }, { "recipient": "So1AffiliateTwo...", "fee": 50 } ] } ``` -------------------------------- ### GET /v1/liquidation-addresses/:id Source: https://docs.flashnet.xyz/products/orchestration/api/resources Get a single liquidation address, whether enabled or disabled. ```APIDOC ## GET /v1/liquidation-addresses/:id ### Description Get a single liquidation address (enabled or disabled). ### Method GET ### Endpoint /v1/liquidation-addresses/:id #### Path Parameters - **id** (string) - Required - The ID of the liquidation address ``` -------------------------------- ### GET /v1/accumulation-addresses/:id Source: https://docs.flashnet.xyz/products/orchestration/api/resources Get a single accumulation address, including its subscription status. ```APIDOC ## GET /v1/accumulation-addresses/:id ### Description Get a single accumulation address, including subscription status. ### Method GET ### Endpoint /v1/accumulation-addresses/:id #### Path Parameters - **id** (string) - Required - The ID of the accumulation address ``` -------------------------------- ### Verify Attestation in JavaScript Source: https://docs.flashnet.xyz/products/orchestration/tee-attestation This JavaScript example demonstrates how to decode the attestation document, verify the nonce, extract PCR0, and check certificate chain depth. Ensure you have the 'cborg' library and use crypto.randomUUID() for nonce generation. ```javascript import { decode } from "cborg"; const nonce = crypto.randomUUID(); const resp = await fetch( `https://orchestration.flashnet.xyz/v1/attestation?nonce=${nonce}` ); const { document } = await resp.json(); // Decode base64 -> COSE_Sign1 -> payload const raw = Uint8Array.from(atob(document), (c) => c.charCodeAt(0)); const cose = decode(raw, { useMaps: true }); const payload = decode(cose[2], { useMaps: true }); // Convert to object const doc = Object.fromEntries( [...payload.entries()].map(([k, v]) => [String(k), v]) ); // Verify nonce matches const returnedNonce = new TextDecoder().decode(doc.nonce); console.assert(returnedNonce === nonce, "Nonce mismatch"); // Read PCR0 (enclave image hash) const pcr0 = Array.from(doc.pcrs.get(0)) .map((b) => b.toString(16).padStart(2, "0")) .join(""); console.log("PCR0:", pcr0); // Certificate chain depth console.log("Cert chain:", doc.cabundle.length, "certificates"); ``` -------------------------------- ### Create Quote and Submit BTC Deposit Source: https://docs.flashnet.xyz/products/orchestration/btc-to-stablecoin This snippet demonstrates how to create a quote for converting BTC to USDC on the Base chain and then submit the BTC deposit transaction. It includes fetching the quote, sending the BTC, and submitting the transaction details to Flashnet. ```typescript const BASE_URL = 'https://orchestration.flashnet.xyz'; const quote = await fetch(`${BASE_URL}/v1/orchestration/quote`, { method: 'POST', headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${process.env.FLASHNET_API_API_KEY}`, 'X-Idempotency-Key': `quote:${Date.now()}`, }, body: JSON.stringify({ sourceChain: 'spark', sourceAsset: 'BTC', destinationChain: 'base', destinationAsset: 'USDC', amount: '1000000', recipientAddress: '0xYourBaseUsdcAddress', slippageBps: 50, }), }).then((r) => r.json()); // Send BTC on Spark to quote.depositAddress for quote.amountIn. // Capture the Spark transfer id. const sparkTransferId = await sendSparkBtc({ toSparkAddress: quote.depositAddress, amountSats: quote.amountIn, }); const submit = await fetch(`${BASE_URL}/v1/orchestration/submit`, { method: 'POST', headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${process.env.FLASHNET_API_API_KEY}`, 'X-Idempotency-Key': `submit:${quote.quoteId}:${sparkTransferId}`, }, body: JSON.stringify({ quoteId: quote.quoteId, sparkTxHash: sparkTransferId, // Optional but recommended. When present, the deposit verifier checks the sender Spark address. sourceSparkAddress: 'spark1YourSenderAddress', }), }).then((r) => r.json()); const status = await fetch( `${BASE_URL}/v1/orchestration/status?id=${encodeURIComponent(submit.orderId)}`, ).then((r) => r.json()); console.log(status.order.status); ``` -------------------------------- ### GET /v1/rewards/:pubkey - Error Responses Source: https://docs.flashnet.xyz/rewards/integrators/api Details the specific error responses for the GET /v1/rewards/:pubkey endpoint, including validation errors and responses for excluded pubkeys. ```APIDOC ## GET /v1/rewards/:pubkey ### Description Retrieves rewards information for a given public key. Handles validation errors and responses for excluded addresses. ### Method GET ### Endpoint /v1/rewards/:pubkey ### Parameters #### Path Parameters - **pubkey** (string) - Required - The public key to query rewards for. ### Response #### Error Responses - **400 Bad Request**: Returned for validation errors (e.g., invalid pubkey format) or if the address is excluded. - **Validation Error Example**: ```json { "error": "Invalid pubkey format. Expected 66 character hex string." } ``` - **Excluded Pubkey Example**: ```json { "reason": "This address is excluded and does not earn rewards" } ``` - **404 Not Found**: Returned if the requested resource is not found. - **500 Internal Server Error**: Returned for server-side errors. - **Server-Side Error Example**: ```json { "error": "INTERNAL_SERVER_ERROR", "message": "..." } ``` ``` -------------------------------- ### Create Reusable Address with App Fees and Affiliates Source: https://docs.flashnet.xyz/products/orchestration/reusable-addresses Example of creating a reusable address, demonstrating the use of both inline appFees and affiliateIds. The platform fee is deducted first, followed by individual app or affiliate fees. ```typescript body: JSON.stringify({ // accumulation example; liquidation uses destinationChain/destinationAsset/destinationAddress sourceChain: 'solana', sourceAsset: 'USDC', destinationAsset: 'BTC', recipientSparkAddress: 'spark1UserRecipient...', feeBps: 5, slippageBps: 50, affiliateIds: [ 'referrer-alice', { affiliateId: 'platform-fee', feeBps: 25 }, ], }), ``` -------------------------------- ### Order Refunding Webhook Payload Example Source: https://docs.flashnet.xyz/products/orchestration/webhooks This is an example of the JSON payload received for an 'order.refunding' webhook event. It includes comprehensive details about the order, payment intent, fee structure, and any associated errors. ```json { "event": "order.refunding", "timestamp": "2026-02-04T01:30:47.000Z", "data": { "id": "ord_...", "type": "order", "status": "refunding", "quoteId": "q_...", "amountIn": "250000", "amountOut": null, "feeBps": 5, "feeAmount": "100000", "slippageBps": 50, "source": { "chain": "bitcoin", "asset": "BTC", "address": null, "txHash": "", "sweepTxHash": null }, "destination": { "chain": "base", "asset": "USDC", "address": "0x...", "txHash": null }, "depositAddress": "bc1q...", "recipientAddress": "0x...", "payLinkId": "pl_abc123", "payLinkLabel": "October invoice #42", "flashnetRequestId": null, "sparkTxHash": null, "refund": { "asset": null, "amount": null, "txHash": null }, "error": { "code": "slippage_exceeded", "message": "Pool moved past slippage tolerance between deposit and execution" }, "paymentIntent": { "version": 1, "amountMode": "exact_out", "targetAmountOut": "100000000", "requiredAmountIn": "250000", "maxAcceptedAmountIn": "250050", "inputBufferBps": 2, "actualAmountIn": "249900", "refundAddress": "bc1q...", "exactOutExecution": "strict" }, "feePlan": { "version": 1, "settlementChain": "solana", "settlementAsset": "USDC", "appFees": [ { "affiliateId": "flashpartner", "recipient": "So1AffiliateOne...", "feeBps": 50 }, { "recipient": "So1AffiliateTwo...", "feeBps": 50 } ] }, "feePayouts": { "version": 1, "entries": [ { "idempotencyKey": "order:ord_...:full:appfee:0", "leg": "full", "chain": "solana", "role": "app_fee", "affiliateId": "flashpartner", "recipient": "So1AffiliateOne...", "feeBps": 50, "amount": "24750", "platformCutAmount": "4950", "recipientAmount": "19800", "txHash": "5kW...", "recordedAt": "2026-02-04T01:35:00.000Z" }, { "idempotencyKey": "order:ord_...:full:payout", "leg": "full", "chain": "solana", "role": "recipient_payout", "recipient": "So1RecipientAddress...", "feeBps": null, "amount": "2475000", "platformCutAmount": null, "recipientAmount": null, "txHash": "3hN...", "recordedAt": "2026-02-04T01:35:02.000Z" } ] }, "createdAt": "2026-02-04T01:30:00.000Z", "updatedAt": "2026-02-04T01:30:47.000Z", "completedAt": null } } ``` -------------------------------- ### Get Order Status (Deprecated/Alternative) Source: https://docs.flashnet.xyz/products/orchestration/order-lifecycle Retrieves the status of an order using a quote ID. Note: This endpoint returns a 404 for quotes that have not yet been submitted. For polling before order existence, `GET /v1/orchestration/order` should be used instead. ```APIDOC ## GET /v1/orchestration/status ### Description Retrieves the status of an order using a quote ID. Returns 404 if the quote has not been submitted. ### Method GET ### Endpoint /v1/orchestration/status ### Parameters #### Query Parameters - **quoteId** (string) - Required - The ID of the quote to query for status. ### Request Example (No specific request example provided in the source) ### Response #### Success Response (200) (No specific response details provided in the source) #### Response Example (No specific response example provided in the source) ``` -------------------------------- ### Create Quote with Mixed Affiliate IDs and Fee Overrides Source: https://docs.flashnet.xyz/products/orchestration/api/quotes-and-orders This example shows how to mix plain affiliate IDs with specific fee overrides for certain affiliates. Fee overrides apply only to the current quote. ```json { "sourceChain": "spark", "sourceAsset": "BTC", "destinationChain": "solana", "destinationAsset": "USDC", "amount": "100000", "recipientAddress": "So1RecipientAddress...", "affiliateIds": [ "referrer-alice", { "affiliateId": "platform-fee", "feeBps": 25 } ] } ``` -------------------------------- ### Accept ZeroConf Offer Request Headers Source: https://docs.flashnet.xyz/products/orchestration/api/approval-flows Headers required to accept a pending ZeroConf offer. Ensure to use a valid Authorization token and a unique Idempotency-Key. ```bash Authorization: Bearer fn_... X-Idempotency-Key: ``` -------------------------------- ### Create Pay Link with Affiliate Source: https://docs.flashnet.xyz/products/orchestration/pay-links Example of creating a pay link for the Solana chain using USDC, specifying the amount out and an affiliate ID. ```json { "destinationChain": "solana", "destinationAsset": "USDC", "recipientAddress": "So1...", "amountOut": "50000000", "affiliateId": "my-partner" } ``` -------------------------------- ### GET /v1/affiliates/:affiliateId/claims Source: https://docs.flashnet.xyz/products/orchestration/api/resources Lists all claims for a specific affiliate, with support for pagination. ```APIDOC ## GET /v1/affiliates/:affiliateId/claims ### Description List claims for an affiliate. ### Method GET ### Endpoint /v1/affiliates/:affiliateId/claims ### Headers - **Authorization** (string) - Required - Bearer token ### Query Parameters - **limit** (integer) - Optional - The maximum number of claims to return (default: 50, max: 200). - **offset** (integer) - Optional - The number of claims to skip (default: 0). ``` -------------------------------- ### POST /v1/orchestration/zeroconf/accept Source: https://docs.flashnet.xyz/products/orchestration/api/approval-flows Accepts a pending ZeroConf offer, allowing the order to resume execution with instant credit. This operation is used when a Bitcoin L1 deposit with zeroconfEnabled=true receives an instant-credit offer and the partner wishes to proceed immediately. ```APIDOC ## POST /v1/orchestration/zeroconf/accept ### Description Accept a pending ZeroConf offer and resume execution with instant credit. ### Method POST ### Endpoint /v1/orchestration/zeroconf/accept ### Headers - **Authorization** (string) - Required - Bearer token for authentication. - **X-Idempotency-Key** (string) - Required - A unique key to ensure idempotency. ### Request Body - **orderId** (string) - Required - The ID of the order to accept. ### Request Example ```json { "orderId": "ord_..." } ``` ### Response #### Success Response (200) - **orderId** (string) - The ID of the order. - **status** (string) - The updated status of the order, expected to be "processing". #### Response Example ```json { "orderId": "ord_...", "status": "processing" } ``` ### Rules - Order must be in `awaiting_approval` with a pending `zeroconfOffer`. - The offer must not be expired. - The API key must belong to the same partner as the order. ``` -------------------------------- ### GET /v1/pay-links/:id Source: https://docs.flashnet.xyz/products/orchestration/pay-links Retrieves a single pay link by its unique identifier. ```APIDOC ## GET /v1/pay-links/:id ### Description Get a single pay link by ID. ### Method GET ### Endpoint /v1/pay-links/:id ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the pay link. ### Request Example *No example provided in source* ### Response #### Success Response (200) *Details about the specific pay link (specific fields not provided in source)* #### Response Example *No example provided in source* ``` -------------------------------- ### Get Points History Source: https://docs.flashnet.xyz/rewards/integrators/api Retrieves a paginated list of point earning events for a specific user. ```APIDOC ## GET /v1/points/:pubkey/history ### Description Returns paginated list of point earning events. ### Method GET ### Endpoint /v1/points/:pubkey/history ### Parameters #### Path Parameters - **pubkey** (string) - Required - The public key of the user. #### Query Parameters - **limit** (integer) - Optional - Maximum number of results to return (default 30). - **offset** (integer) - Optional - Pagination offset. ### Response #### Success Response (200) - **pubkey** (string) - The user's public key. - **events** (array) - A list of point earning events. - **type** (string) - The type of event. - **points** (integer) - The points earned. - **day** (string) - The day the points were earned. - **metadata** (object) - Additional metadata about the event. - **createdAt** (string) - The timestamp when the event was created. - **pagination** (object) - Pagination information. - **total** (integer) - Total number of events. - **limit** (integer) - The limit used for pagination. - **offset** (integer) - The offset used for pagination. #### Response Example ```json { "pubkey": "02abc...def", "events": [ { "type": "daily_award", "points": 1236, "day": "2026-02-09", "metadata": {}, "createdAt": "2026-02-10T00:05:00Z" } ], "pagination": { "total": 45, "limit": 30, "offset": 0 } } ``` ``` -------------------------------- ### Get Payout History Source: https://docs.flashnet.xyz/rewards/integrators/api Retrieves a paginated list of historical rewards payouts for a specific user. ```APIDOC ## GET /v1/rewards/:pubkey/payouts ### Description Returns paginated list of rewards payouts for a user. ### Method GET ### Endpoint /v1/rewards/:pubkey/payouts ### Parameters #### Path Parameters - **pubkey** (string) - Required - The public key of the user. #### Query Parameters - **limit** (integer) - Optional - Max results (default 30) - **offset** (integer) - Optional - Pagination offset ### Response #### Success Response (200) - **pubkey** (string) - The user's public key. - **payouts** (array) - List of payout objects. - **day** (string) - The date of the payout. - **usdbBalance** (object) - The USDB balance on the payout day. - **raw** (string) - The raw USDB balance. - **display** (string) - The displayable USDB balance. - **volume** (object) - Trading volume on the payout day. - **swapSats** (integer) - Total swap volume in sats. - **rewardsBracket** (integer) - The rewards bracket for that day. - **annualRewardsBps** (integer) - Annual rewards basis points. - **rewardsPayoutSats** (integer) - Sats from rewards payout. - **endorsementsPayoutSats** (integer) - Sats from endorsements payout. - **payoutSats** (integer) - Total payout in sats. - **status** (string) - Status of the payout (e.g., "paid"). - **txId** (string) - Transaction ID for the payout. - **createdAt** (string) - Timestamp when the payout record was created. - **paidAt** (string) - Timestamp when the payout was processed. - **pagination** (object) - Pagination details. - **total** (integer) - Total number of payouts. - **limit** (integer) - The limit used for the current request. - **offset** (integer) - The offset used for the current request. ### Response Example { "pubkey": "02abc...def", "payouts": [ { "day": "2026-02-09", "usdbBalance": { "raw": 10000000000, "display": 10000 }, "volume": { "swapSats": 5000000 }, "rewardsBracket": 3, "annualRewardsBps": 500, "rewardsPayoutSats": 1020, "endorsementsPayoutSats": 350, "payoutSats": 1370, "status": "paid", "txId": "abc123...", "createdAt": "2026-02-09T00:05:00Z", "paidAt": "2026-02-10T00:05:00Z" } ], "pagination": { "total": 45, "limit": 30, "offset": 0 } } ``` -------------------------------- ### ZeroConf Offer Object Structure Source: https://docs.flashnet.xyz/products/orchestration/api/approval-flows Example structure of the zeroconfOffer object included in an order when a ZeroConf quote is received. This object contains details about the offer. ```json { "zeroconfOffer": { "version": 1, "status": "pending", "quoteId": "zc_...", "sparkAddress": "spark1...", "txid": "", "vout": 0, "depositSats": "250000", "instantSats": "237500", "holdbackSats": "12500", "feeSats": "125", "confirmationProbability": 0.998, "expiresAt": "2026-02-04T01:35:00.000Z", "offeredAt": "2026-02-04T01:30:00.000Z", "resolvedAt": null } } ``` -------------------------------- ### Liquidation Address Creation Response Example Source: https://docs.flashnet.xyz/products/orchestration/reusable-addresses This JSON object shows the structure of the response when creating a liquidation address. It includes the generated Bitcoin deposit address and payout destination details. ```json { "liquidationAddressId": "liq_...", "sparkAddress": "spark1...", "l1DepositAddress": "bc1...", "destination": { "chain": "ethereum", "asset": "USDC", "address": "0x..." }, "feeBps": 5, "slippageBps": 50, "enabled": true, "createdAt": "2026-02-04T01:00:00.000Z", "appFees": [ { "recipient": "So1FeeRecipient...", "feeBps": 50 } ] } ``` -------------------------------- ### GET /v1/affiliates Source: https://docs.flashnet.xyz/products/orchestration/api/resources List all affiliate profiles associated with your partner account. Supports filtering and pagination. ```APIDOC ## GET /v1/affiliates ### Description List all affiliate profiles associated with your partner account. Supports filtering and pagination. ### Method GET ### Endpoint /v1/affiliates ### Parameters #### Query Parameters - **includeDisabled** (boolean) - Optional - Whether to include disabled affiliate profiles. Defaults to `false`. - **limit** (integer) - Optional - The maximum number of results to return. Defaults to `200`, max `1000`. - **offset** (integer) - Optional - The number of results to skip. Defaults to `0`. #### Headers - **Authorization** (string) - Required - Bearer token for authentication. ``` -------------------------------- ### Quote, Submit, and Track USDC to BTC Order Source: https://docs.flashnet.xyz/products/orchestration/stablecoin-to-btc This snippet demonstrates the full lifecycle of an order: obtaining a quote, sending funds, submitting the transaction, and checking its status. Ensure you have your FLASHNET_API_KEY set in your environment variables and replace 'spark1...' with a valid recipient address. ```typescript const BASE_URL = 'https://orchestration.flashnet.xyz'; const quote = await fetch(`${BASE_URL}/v1/orchestration/quote`, { method: 'POST', headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${process.env.FLASHNET_API_KEY}`, // Required for authenticated quotes. 'X-Idempotency-Key': `quote:${Date.now()}`, }, body: JSON.stringify({ sourceChain: 'base', sourceAsset: 'USDC', destinationChain: 'spark', destinationAsset: 'BTC', amount: '100000000', recipientAddress: 'spark1...', slippageBps: 50, }), }).then((r) => r.json()); // Send USDC to quote.depositAddress for quote.amountIn. // Capture the deposit transaction hash. const txHash = await sendUsdcOnBase({ to: quote.depositAddress, amountUsdcSmallest: quote.amountIn, }); const submit = await fetch(`${BASE_URL}/v1/orchestration/submit`, { method: 'POST', headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${process.env.FLASHNET_API_KEY}`, 'X-Idempotency-Key': `submit:${quote.quoteId}:${txHash}`, }, body: JSON.stringify({ quoteId: quote.quoteId, txHash, // Optional but recommended. When present, the deposit verifier checks the sender address. sourceAddress: '0xYourSenderAddress', }), }).then((r) => r.json()); const status = await fetch( `${BASE_URL}/v1/orchestration/status?id=${encodeURIComponent(submit.orderId)}`, ).then((r) => r.json()); console.log(status.order.status); ``` -------------------------------- ### List Affiliates Request Headers Source: https://docs.flashnet.xyz/products/orchestration/api/resources Headers required for listing affiliate profiles. Only authorization is needed. ```bash Authorization: Bearer fn_... ``` -------------------------------- ### Get Endorsements Source: https://docs.flashnet.xyz/usdb/delegation Retrieves the list of current reward delegations (endorsements) for a given public key. ```APIDOC ## GET /v1/rewards/:pubkey/endorsements ### Description Retrieves the list of current reward delegations (endorsements) for a given public key. ### Method GET ### Endpoint /v1/rewards/:pubkey/endorsements ### Parameters #### Path Parameters - **pubkey** (string) - Required - The public key of the endorser whose delegations are being retrieved. ```