attachFlowSource
Attaches a payment source to a flow. Supports three source types: wallet, exchange, and deposit_address. Returns the updated flow and a session token that authenticates all subsequent calls for this flow.
When to call
Call attachFlowSource only when executionState is initiated, source_attached, quoted, or signing. Re-attaching before broadcast lets the user change the source and rotates the flow session token.
Before restoring or retrying a flow, call getFlow and check its current state.
Do not call attachFlowSource after broadcasted or source_confirmed.
Poll the existing flow instead. If the flow is cancelled, expired, or
failed, create a new flow for another attempt. Reusing a confirmed flow
returns 409 because source_confirmed → source_attached is not a valid
execution-state transition.
Usage
Parameters
This is a discriminated union on sourceType. The required and optional fields differ per source type.
Wallet source (sourceType: 'wallet')
User pays from a connected wallet. The source address is screened for sanctions.
Exchange source (sourceType: 'exchange')
User pays from a CEX balance (e.g. Coinbase). The response includes an exchange buy URL to redirect the user to. No sanctions screening — the exchange KYCs the funder.
Deposit address source (sourceType: 'deposit_address')
A unique deposit address is generated for the flow. The user sends funds directly to it — no wallet connection required. Works for BTC, SOL, and EVM. Call getFlowQuote after attaching to get the depositAddress, which you can display as a QR code or copy string.
Do not pass fromAddress with sourceType: 'deposit_address' — the API returns 400.
Returns
Promise<FlowSourceResponse>:
Examples
Wallet source (EVM)
Wallet source (Solana)
Exchange source (Coinbase)
Deposit address source
No wallet connection or signing required. After attaching the source, call getFlowQuote to get the deposit address to show the user.
React