Skip to main content
POST

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

X-Request-Signature
string
header
required

ES256 signature over the canonical request, paired with the bearer JWT nonce.

Headers

Idempotency-Key
string
required

Unique client-generated key for one FX operation. Within the idempotency window, sending the same request with the same key returns the stored response, including a stored failure. See Idempotency. Client-generated key for one logical FX operation.

Pattern: ^[a-zA-Z0-9_-]{1,255}$
Example:

"3fa85f64-5717-4562-b3fc-2c963f66afa6"

X-App-Mode
string

Selects the environment on api.openfx.com. Omit this header or send SANDBOX to use Sandbox. Send LIVE for Live requests. Use an API key for the selected environment. See Environments.

Example:

"SANDBOX"

X-Request-Id
string

Your own correlation id for this request, returned on the response exactly as you sent it.

Optional. Where you send none the response omits it, and the X-Trace-Id response header is the handle to correlate on instead.

Example:

"9f2c1b7e-4d3a-4f81-9c2e-6b0a5d7e1f34"

Body

application/json

Locks a rate for a currency pair against one anchored side of the trade. The client supplies exactly one of buyAmount (the exact amount they want to receive) or sellAmount (the exact amount they want to spend); the server computes the unspecified side at the quoted rate. Unknown fields are rejected with 400 VALIDATION_BODY_FAILED.

buyAmount
string
required

Amount to buy, denominated in buyCurrency. Mutually exclusive with sellAmount.

Pattern: ^(?=.*[1-9])\d+(\.\d+)?$
Example:

"1000"

buyCurrency
string
required

Currency to buy. Must be uppercase (e.g. USDC).

Minimum string length: 1
Pattern: ^[A-Z0-9]{2,15}$
Example:

"USDC"

sellCurrency
string
required

Currency to sell. Must be uppercase (e.g. USD).

Minimum string length: 1
Pattern: ^[A-Z0-9]{2,15}$
Example:

"USD"

sellAmount
string

Amount to sell, denominated in sellCurrency. Mutually exclusive with buyAmount.

Pattern: ^(?=.*[1-9])\d+(\.\d+)?$
Example:

"1000"

quoteForSeconds
enum<number>
default:3

Requested quote expiry validity in seconds.

Available options:
3,
15,
30,
45,
60
Example:

3

settlementWindow
enum<string>

Settlement window for the resulting trade. Defaults to T0 when omitted.

Available options:
IMMEDIATE,
T0,
T1,
T2
Example:

"T0"

Response

success

data
object
required

The requested resource, collection, or aggregate.