Splitting quote and trade forces deterministic execution: the rate you saw is
the rate that executes, or the trade fails; execution never silently
re-prices. After QUOTE_EXPIRED, request a fresh
quote and submit the trade with a new
Idempotency-Key. After
TRADE_EXECUTION_FAILED, call
GET /v3/fx/trades/{id} with error.details.resourceId first. If the
trade exists, continue tracking it. If the lookup returns 404
TRADE_NOT_FOUND, request a fresh quote and
submit the trade with a new key. See Trade
recovery.The trading flow
Endpoints
Quote lifecycle
Quotes are short-lived: 3 seconds by default. You can extend via thequoteForSeconds request parameter.
quoteForSeconds accepts a closed set of standard durations: 3, 15,
30, 45, 60 seconds.Longer holds are priced higher. Quote holds longer than 15 seconds are priced higher than shorter holds, because the quoted rate reflects the market volatility OpenFX is exposed to while the quote remains open. The rate in the quote response is the rate you can execute at for the full hold.
POST /v3/fx/trades/{id}/reverse-quote) defaults quoteForSeconds to 15 seconds. It can return TRADE_NOT_FOUND or TRADE_NOT_REVERSIBLE; POST /v3/fx/trades/{id}/reverse can also return QUOTE_NOT_FOUND, QUOTE_EXPIRED, QUOTE_ALREADY_CONSUMED, and TRADE_INSUFFICIENT_BALANCE.
The quote is binding only if you execute POST /v3/fx/trades before expiresAt. Once expired, executing returns 409 QUOTE_EXPIRED; request a new quote and execute against the new id.
Retrieving a quote
You can fetch a previously-created quote by ID for 2 days from itscreatedAt. The endpoint reads from durable storage, not the create-call’s idempotency cache, so the quote stays retrievable long after the 30-minute idempotency TTL has expired. After 2 days, GET /v3/fx/quotes/{id} returns 404 QUOTE_NOT_FOUND, the same as an unknown ID.
Quote status
GET /v3/fx/quotes/{id} includes a status field not present on the POST /v3/fx/quotes create response:
After execution
The execute response returns theTrade. IMMEDIATE trades are already EXECUTED. A T0 trade is EXECUTED on an AUTO account and READY_TO_SETTLE on a MANUAL account. A T1 or T2 trade waits for its settlement window. The statuses, the settle and reverse actions, and the webhooks for each are on Trades.
Common mistakes
- The requested amount cannot be quoted. For
422QUOTE_REJECTED, review the currencies and amount. Adjust the request and submit it with a new idempotency key. - Expired quote (QUOTE_EXPIRED). Quotes default to 3 seconds. Recover by re-quoting and retrying with a NEW idempotency key.
- Execution failed mid-flight (TRADE_EXECUTION_FAILED). Call
GET /v3/fx/trades/{id}first to check state before retrying. - Idempotency key replay (IDEMPOTENCY_MISMATCH). Reusing a key with a different request body returns
422IDEMPOTENCY_MISMATCH.
What’s next
Trades
Trade statuses, settlement windows, and the settle and reverse actions.
Settlement models
Netted vs Per-Trade settlement models, plus deposits and withdrawals.
Trade webhooks
Push notifications for ready-to-settle, settled, and reversed trades.
Quickstart
Worked end-to-end: quote → trade → balance.
Idempotency
Why both /quotes and /trades require keys.