Get account balances
Retrieves current balances for a specific account, identified by its UUID. Balances include cost basis, market value, and realized and unrealized gains per cryptocurrency.
Endpoint
http
GET /v1/api/account/{accountId}/balancesAuthentication: Bearer token.
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| accountId | path | string (uuid) | Yes | Unique identifier of the account. |
| forceRefresh | query | boolean | No | Force a refresh from the source instead of cached data. Applies only when the cached data is older than 30 minutes. Defaults to false. |
Example request
bash
curl -X GET 'https://api.turnqey.xyz/v1/api/account/98765432-e89b-12d3-a456-426614174000/balances?forceRefresh=false' \
-H 'accept: application/json' \
-H 'Authorization: Bearer <token>'Example response
json
{
"isError": false,
"message": "Success",
"result": {
"balances": [
{
"symbol": "BTC",
"balance": "0.5",
"costBasis": "24500.00",
"marketValue": "25000.00",
"realizedGainLoss": "500.00",
"unrealizedGainLoss": "500.00"
}
],
"lastUpdatedOn": "2023-01-15T14:30:00Z",
"marketValue": "25000.00",
"realizedGainLoss": "500.00",
"unrealizedGainLoss": "500.00"
},
"statusCode": 200
}Errors
| Status | Meaning |
|---|---|
| 401 | Bearer token missing, expired, or invalid. |
| 404 | Account not found. |
| 422 | Request understood but cannot be processed. |
See Data Freshness for caching and refresh behavior, and Errors and Retries for error handling.