Skip to content

Overview of OpenFX APIs (v1.0.0)

OpenFX provides a robust and secure API suite engineered for high performance and reliability, enabling programmatic access to real-time market data, trade execution, and money movement functionalities. This guide will walk through the step-by-step process of deposits, quoting, trading, settlements and monitoring using OpenFX APIs.

Languages
Servers
OpenFX API Server

https://api.sandbox.openfx.com/

MarketData

This endpoint retrieves a complete list of all tradable fiat and stablecoin currency pairs on the OpenFX platform.

Operations

Balances

The Balance endpoints enable real-time tracking and management of currency holdings within an account.

Operations

Trade

The Trade APIs facilitate programmatic currency exchange through a quote-then-trade workflow, ensuring price transparency and guaranteed execution at quoted rates.

Operations

Request

Creates a new quote for a specific currency pair and amount, returning a quote ID and guaranteed rate valid for 3 seconds.

Use this endpoint to: - Get real-time exchange rates - Lock in rates for trading - Calculate exchange amounts - Review applicable fees and margins

Security
bearerAuth
Path
orgIdstringrequired
Bodyapplication/json
amountnumber> 0required
Example: 1000
buystringrequired
Example: "USDC"
sellstringrequired
Example: "USD"
referencedUnitstringrequired
Example: "USDC"
curl -i -X POST \
  'https://api.sandbox.openfx.com/v1/brokerage/{orgId}/generate_quote' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "amount": 1000,
    "buy": "USDC",
    "sell": "USD",
    "referencedUnit": "USDC"
  }'

Responses

success

Bodyapplication/json
statusstring
Enum"success""error"
Example: "success"
dataobject or null
data.​quoteobject
data.​quote.​idstring(uuid)

Unique identifier for the quote

Example: "123e4567-e89b-12d3-a456-426614174000"
data.​quote.​userIdstring(uuid)

Unique identifier of the user who generated the quote

Example: "123e4567-e89b-12d3-a456-426614174001"
data.​quote.​buystring

Currency the user wants to buy (quote's target currency)

Example: "USD"
data.​quote.​sellstring

Currency the user wants to sell (quote's base currency)

Example: "USDC"
data.​quote.​referencedUnitstring

Currency symbol used to reference the input amount

Example: "USD"
data.​quote.​referencedAmountnumber

Input amount in the referenced unit provided by the user

Example: 1000
data.​quote.​quoteAmountnumber

Calculated amount the user will receive or pay, based on the reference amount

Example: 999.800000007998
data.​quote.​createdAtstring

UTC Timestamp when the quote was generated

Example: "2024-11-25T15:05:34.945Z"
data.​quote.​expiryTimeinSecondsnumber

Number of seconds until the quote expires

Example: 15
messagestring
Example: "Data fetched successfully"
Response
application/json
{ "status": "success", "data": { "quote": { "id": "123e4567-e89b-12d3-a456-426614174000", "userId": "123e4567-e89b-12d3-a456-426614174001", "buy": "USD", "sell": "USDC", "referencedUnit": "USD", "referencedAmount": 1000, "quoteAmount": 999.800000007998, "createdAt": "2024-11-25T15:05:34.945Z", "expiryTimeinSeconds": 15 } } }

Request

Returns a comprehensive list of all orders, including both completed and pending transactions.

Use this endpoint to:

  • Track trading activity
  • Monitor order statuses
  • Generate trading reports
  • Reconcile transactions
Security
bearerAuth
Path
orgIdstringrequired
Query
pagenumber(number)>= 1
Default 1
Example: page=1
limitnumber(number)[ 1 .. 50 ]
Default 10
Example: limit=10
curl -i -X GET \
  'https://api.sandbox.openfx.com/v1/brokerage/{orgId}/trades?page=1&limit=10' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>'

Responses

success

Bodyapplication/json
statusstring
Enum"success""error"
Example: "success"
dataArray of objects or null
data[].​idstring(uuid)

Unique identifier for the trade

Example: "24753ee0-c3e9-4268-a48f-0cef3559f17f"
data[].​tradingPairstring

Currency pair involved in the trade, in the format QUOTE/BASE

Example: "USD/USDC"
data[].​referencedUnitstring

Currency symbol used to define the trade input amount

Example: "USD"
data[].​tradeDirectionstring

Direction of the trade relative to the user

data[].​amountnumber

Amount specified by the user in the referenced currency

Example: 3333
data[].​computedAmountnumber

Final calculated amount of the counter currency

Example: 3306.38229166667
data[].​createdAtUtcstring

UTC Timestamp when the trade was created

Example: "2025-01-21T17:37:33.074Z"
data[].​updatedAtUtcstring

UTC Timestamp when the trade was last updated

Example: "2025-01-21T17:37:33.074Z"
data[].​orderTypestring

Type of trade order

Example: "MARKET"
data[].​statusstring

Current status of the trade

Example: "EXECUTED"
data[].​sourcestring

Origin of the trade request

Enum"API""GUI""OTC"
Example: "API"
messagestring
Example: "Data fetched successfully"
metaobject
meta.​paginationobject
meta.​pagination.​totalnumber
Example: 10
meta.​pagination.​startnumber
Example: 1
meta.​pagination.​endnumber
Example: 2
meta.​pagination.​pagenumber
Example: 1
meta.​pagination.​limitnumber
Example: 2
Response
application/json
{ "status": "success", "data": [ { "id": "b6e537a3-e673-4cd4-832a-cb67b66eb425", "tradingPair": "USDC/USD", "referencedUnit": "USDC", "tradeDirection": "BUY", "amount": 3333, "computedAmount": 3359.4960168, "createdAtUtc": "2025-01-21T17:36:33.310Z", "updatedAtUtc": "2025-01-21T17:36:33.310Z", "orderType": "MARKET", "status": "EXECUTED", "source": "GUI" }, { "id": "93f7189a-0c14-4bf4-8004-1266bd14fbbf", "tradingPair": "USDC/USD", "referencedUnit": "USD", "tradeDirection": "SELL", "amount": 30507.8873260065, "computedAmount": 18914.8854134015, "createdAtUtc": "2025-01-16T04:52:18.167Z", "updatedAtUtc": "2025-01-16T04:52:18.167Z", "orderType": "MARKET", "status": "EXECUTED", "source": "API" } ], "meta": { "pagination": { "total": 2, "start": 1, "end": 2, "page": 1, "limit": 2 } } }

Request

Provides detailed information on a specific trade using its unique identifier.

Use this endpoint to:

  • Verify order execution details
  • View settlement status
  • Access transaction timestamps
  • Review trade parameters
Security
bearerAuth
Path
orgIdstringrequired
idstringrequired
curl -i -X GET \
  'https://api.sandbox.openfx.com/v1/brokerage/{orgId}/trade/{id}' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>'

Responses

success

Bodyapplication/json
statusstring
Enum"success""error"
Example: "success"
dataobject or null
data.​idstring(uuid)

Unique identifier for the trade

Example: "24753ee0-c3e9-4268-a48f-0cef3559f17f"
data.​tradingPairstring

Currency pair involved in the trade, in the format QUOTE/BASE

Example: "USD/USDC"
data.​referencedUnitstring

Currency symbol used to define the trade input amount

Example: "USD"
data.​tradeDirectionstring

Direction of the trade relative to the user

data.​amountnumber

Amount specified by the user in the referenced currency

Example: 3333
data.​computedAmountnumber

Final calculated amount of the counter currency

Example: 3306.38229166667
data.​createdAtUtcstring

UTC Timestamp when the trade was created

Example: "2025-01-21T17:37:33.074Z"
data.​updatedAtUtcstring

UTC Timestamp when the trade was last updated

Example: "2025-01-21T17:37:33.074Z"
data.​orderTypestring

Type of trade order

Example: "MARKET"
data.​statusstring

Current status of the trade

Example: "EXECUTED"
data.​sourcestring

Origin of the trade request

Enum"API""GUI""OTC"
Example: "API"
messagestring
Example: "Data fetched successfully"
Response
application/json
{ "status": "success", "data": { "id": "b6e537a3-e673-4cd4-832a-cb67b66eb425", "tradingPair": "USDC/USD", "referencedUnit": "USDC", "tradeDirection": "BUY", "amount": 3333, "computedAmount": 3359.4960168, "createdAtUtc": "2025-01-21T17:36:33.310Z", "updatedAtUtc": "2025-01-21T17:36:33.310Z", "orderType": "MARKET", "status": "EXECUTED", "source": "GUI" } }

Request

Executes a currency exchange trade using a valid quote ID. Must be called within 3 seconds of quote generation.

Use this endpoint to:

  • Execute currency exchanges
  • Lock in quoted rates
  • Convert between currencies
  • Initiate settlement process
Security
bearerAuth
Path
orgIdstringrequired
Bodyapplication/json
quoteIdstring(uuid)required
Example: "d8bc9618-2830-1822-9ae2-414aaf2b2de3"
curl -i -X POST \
  'https://api.sandbox.openfx.com/v1/brokerage/{orgId}/trade' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "quoteId": "d8bc9618-2830-1822-9ae2-414aaf2b2de3"
  }'

Responses

success

Bodyapplication/json
balancesobject

Updated user balances after the trade, keyed by currency symbol

Example: {"USD":5000,"USDC":100}
balances.​property name*numberadditional property
tradeobject
trade.​idstring(uuid)

Unique identifier of the executed trade

Example: "24753ee0-c3e9-4268-a48f-0cef3559f17f"
trade.​buystring

Currency symbol that user is buying

Example: "USDC"
trade.​sellstring

Currency symbol that user is selling

Example: "USD"
trade.​referencedUnitstring

Currency symbol used to specify the original trade input amount

Example: "USD"
trade.​referenceAmountnumber

The amount the trade was based on, in the referenced currency

Example: 123
trade.​amountnumber

The final amount transacted after fees or rounding

Example: 122
trade.​statusstring

Status of the trade execution

Example: "EXECUTED"
trade.​transactedAtstring

UTC Timestamp when the trade was executed

Example: "2025-01-21T17:37:33.074Z"
trade.​quoteIdstring(uuid)

Unique identifier of the quote associated with this trade

Example: "75324ee0-a48f-c3e9-4268-0cef3559f17f"
userCreditLimitnumber

Total credit limit available to the user

Example: 10000000
userCreditUsednumber

Amount of credit used by the user after this trade

Example: 8844000.51844473
Response
application/json
{ "status": "success", "data": { "balances": { "USD": -596064.969940321, "USDC": -9893214.59296976, "USDT": 8654884.42360652 }, "trade": { "id": "2c011d8b-1822-4d1c-9b16-414aaf2b2de4", "buy": "USD", "sell": "USDC", "referencedUnit": "USD", "referenceAmount": 100, "amount": 101, "status": "EXECUTED", "transactedAt": "2025-02-10T07:40:21.300Z", "quoteId": "d8bc9618-2830-1822-9ae2-414aaf2b2de3" }, "userCreditLimit": 10000000, "userCreditUsed": 8844000.51844473 } }

Deposits

Deposit endpoints enable secure funding of trading accounts across multiple supported currencies and methods.

Operations

Withdrawals

The Withdrawal API facilitates secure fund withdrawals for both fiat and stablecoins.

Operations