Check resource compatibility
Before quoting, confirm that:- The capability is ready, belongs to the customer, and matches the intended direction and method.
- A stablecoin source is an active issued wallet that supports the input currency.
- Wallet-to-wallet resources use the same currency and network.
- A fiat payout account or destination is ready and supports the output currency and method.
Choose the exact amount
Create a quote withPOST /v3/quotes. Send one amount side, both currencies, and response-derived resource IDs with these headers:
- Exact in
- Exact out
Set
in.amount and omit out.amount. The response calculates what the destination receives.data.id, data.status, data.expiresAt, returned legs, rate, and fees. Use the returned decimal strings; do not recalculate executable amounts with floating-point arithmetic.
After a stablecoin-funded exact-out quote, read GET /v3/customers/{customerId}/accounts/{accountId}. Compare the current source balances[].available for the input currency with the returned data.in.amount. If funds are insufficient, change or fund the source and create a new quote. Fiat-funded exact-out quotes do not use this source-wallet balance gate.
Execute once and recover safely
Read the current quote withGET /v3/quotes/{quoteId}. Execute only while its status and expiresAt permit it.
Create the transfer with POST /v3/transfers:
Idempotency-Key for this intended transfer and persist it before sending the request. If the response is lost, retry the identical method, path, body, and key. Do not create a second execution key to recover an uncertain result.
If the API returns quote_already_executed, use its transferId to continue with the existing transfer. An idempotent replay can also return Idempotency-Replayed: true.
Follow the current transfer
ReadGET /v3/transfers/{transferId} after creation and after each webhook. Store the latest data.state, data.stateDetail, and data.openTaskIds.
When task IDs are open, fetch GET /v3/transfers/{transferId}/tasks and complete each task using its current revision and requirements.
For an inbound movement, GET /v3/transfers/{transferId}/instructions can return transfer-specific funding details. Render only the returned instruction variant and exact reference.
Next, implement Webhooks so every asynchronous transfer update enters the same current-state handling path.