Get Subaccount Balance
Returns the wallet balance for a specific child subaccount.
| Method | GET |
| Path | /dma/api/v1/master/subaccount/balance |
| Auth | Authenticated (master account API key). |
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
subaccount_id | integer (int64) | Yes | The subaccount_id whose balance to fetch. |
Request
- Python
- Java
- Go
- Node.js
from reference_client import sign_request, BASE_URL
import requests
headers, path = sign_request("GET", "/dma/api/v1/master/subaccount/balance?subaccount_id=1001")
r = requests.get(BASE_URL + path, headers=headers)
print(r.json())
Map<String, String> query = Map.of("subaccount_id", "1001");
HttpResponse<String> resp = client.send(
"GET", "/dma/api/v1/master/subaccount/balance", query, null);
System.out.println(resp.body());
headers, p, err := SignRequest("GET", "/dma/api/v1/master/subaccount/balance?subaccount_id=1001", nil)
if err != nil { panic(err) }
req, _ := http.NewRequest("GET", BaseURL+p, nil)
for k, v := range headers { req.Header.Set(k, v) }
resp, err := http.DefaultClient.Do(req)
if err != nil { panic(err) }
defer resp.Body.Close()
out, _ := io.ReadAll(resp.Body)
fmt.Println(string(out))
const {signRequest, BASE_URL} = require('./reference-client');
const {headers, path} = signRequest('GET', '/dma/api/v1/master/subaccount/balance?subaccount_id=1001');
const r = await fetch(BASE_URL + path, { headers });
console.log(await r.json());
Response
{
"message": "success",
"data": {
"subaccount_id": 1001,
"account_type": "UNIFIED",
"usdt_inr_rate": "84.50",
"balance_detail": {
"totalEquity": "5000.00",
"totalEquityINR": "422500.00",
"coin": [
{
"coin": "USDT",
"equity": "5000.00",
"equityINR": "422500.00",
"walletBalance": "5000.00",
"walletBalanceINR": "422500.00"
}
]
},
"is_active": true
}
}
| Field | Type | Description |
|---|---|---|
data.subaccount_id | integer | The subaccount queried. |
data.is_active | boolean | Whether the subaccount is active. |
data.balance_detail | object | Dynamic balance structure from the exchange. |
Errors
| Status | Message | Cause |
|---|---|---|
400 | subaccount_id query parameter is required | Missing query parameter. |
403 | subaccount does not belong to master account | Subaccount belongs to another master. |
404 | subaccount not found | Invalid subaccount_id. |