Get balances
const url = 'https://api.openfx.com/v1/brokerage/{orgId}/balances';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));import requests
url = "https://api.openfx.com/v1/brokerage/{orgId}/balances"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)HttpResponse<String> response = Unirest.get("https://api.openfx.com/v1/brokerage/{orgId}/balances")
.header("Authorization", "Bearer <token>")
.asString();CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_WRITEDATA, stdout);
curl_easy_setopt(hnd, CURLOPT_URL, "https://api.openfx.com/v1/brokerage/{orgId}/balances");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Authorization: Bearer <token>");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.openfx.com/v1/brokerage/{orgId}/balances"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}curl --request GET \
--url https://api.openfx.com/v1/brokerage/{orgId}/balances \
--header 'Authorization: Bearer <token>'{
"status": "success",
"message": "Fetched settlement balances successfully",
"data": [
{
"id": "7b12aea1-3a8f-42bb-b789-7502b80e705e",
"amount": -595164.919935321,
"currency": "USD",
"createdAt": "2024-02-07T03:30:21.045Z",
"updatedAt": "2025-02-07T18:08:08.509Z",
"totalBalanceInUSD": 10000,
"withdrawableBalanceInUSD": 8000,
"withdrawableBalance": 5000
},
{
"id": "1fcebbe0-f6f6-4a93-89d3-8ccd99d75c17",
"amount": -9893164.59296976,
"currency": "USDC",
"createdAt": "2024-02-07T03:30:21.045Z",
"updatedAt": "2025-02-07T18:08:08.509Z",
"totalBalanceInUSD": 2000,
"withdrawableBalanceInUSD": 1500,
"withdrawableBalance": 1000
}
],
"netPositiveBalanceInUSD": 12000,
"netNegativeBalanceInUSD": -5000,
"netBalanceInUSD": 7000
}{
"status": "error",
"message": "Query validation failed"
}{
"status": "error",
"message": "The authorization key provided is either invalid or expired, please try again"
}{
"status": "error",
"message": "Request with this idempotency key is currently processing",
"error": {
"code": "IDEMPOTENCY_IN_FLIGHT",
"details": "Please wait for the original request to complete"
}
}{
"status": "error",
"message": "Idempotency key reused with different parameters",
"error": {
"code": "IDEMPOTENCY_MISMATCH",
"details": "This idempotency key was already used with different request parameters"
}
}{
"status": "error",
"message": "An internal error has occurred"
}Get balances
Returns current balances for the organization across all currencies, including USD-equivalent totals.
GET
/
v1
/
brokerage
/
{orgId}
/
balances
Get balances
const url = 'https://api.openfx.com/v1/brokerage/{orgId}/balances';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));import requests
url = "https://api.openfx.com/v1/brokerage/{orgId}/balances"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)HttpResponse<String> response = Unirest.get("https://api.openfx.com/v1/brokerage/{orgId}/balances")
.header("Authorization", "Bearer <token>")
.asString();CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_WRITEDATA, stdout);
curl_easy_setopt(hnd, CURLOPT_URL, "https://api.openfx.com/v1/brokerage/{orgId}/balances");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Authorization: Bearer <token>");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.openfx.com/v1/brokerage/{orgId}/balances"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}curl --request GET \
--url https://api.openfx.com/v1/brokerage/{orgId}/balances \
--header 'Authorization: Bearer <token>'{
"status": "success",
"message": "Fetched settlement balances successfully",
"data": [
{
"id": "7b12aea1-3a8f-42bb-b789-7502b80e705e",
"amount": -595164.919935321,
"currency": "USD",
"createdAt": "2024-02-07T03:30:21.045Z",
"updatedAt": "2025-02-07T18:08:08.509Z",
"totalBalanceInUSD": 10000,
"withdrawableBalanceInUSD": 8000,
"withdrawableBalance": 5000
},
{
"id": "1fcebbe0-f6f6-4a93-89d3-8ccd99d75c17",
"amount": -9893164.59296976,
"currency": "USDC",
"createdAt": "2024-02-07T03:30:21.045Z",
"updatedAt": "2025-02-07T18:08:08.509Z",
"totalBalanceInUSD": 2000,
"withdrawableBalanceInUSD": 1500,
"withdrawableBalance": 1000
}
],
"netPositiveBalanceInUSD": 12000,
"netNegativeBalanceInUSD": -5000,
"netBalanceInUSD": 7000
}{
"status": "error",
"message": "Query validation failed"
}{
"status": "error",
"message": "The authorization key provided is either invalid or expired, please try again"
}{
"status": "error",
"message": "Request with this idempotency key is currently processing",
"error": {
"code": "IDEMPOTENCY_IN_FLIGHT",
"details": "Please wait for the original request to complete"
}
}{
"status": "error",
"message": "Idempotency key reused with different parameters",
"error": {
"code": "IDEMPOTENCY_MISMATCH",
"details": "This idempotency key was already used with different request parameters"
}
}{
"status": "error",
"message": "An internal error has occurred"
}v1 sunsets December 31, 2026. Migrate to v2 — see the migration guide.
- View real-time balances
- Track multi-currency holdings
- Monitor available trading funds
- Reconcile account positions
Errors
| Status | Message | Notes |
|---|---|---|
| 400 | Query validation failed | Request didn’t match schema |
| 401 | The authorization key provided is either invalid or expired, please try again | Mint a fresh JWT — see Authentication |
| 500 | An internal error has occurred | Server fault; retry with backoff |
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Response
success
Sum of all positive balances in USD
Example:
12000
Sum of all negative balances in USD
Example:
-5000
Net balance in USD
Example:
7000
Available options:
success, error Example:
"success"
Show child attributes
Show child attributes
Example:
"Data fetched successfully"
⌘I