curl --request POST \
--url https://whitebit.com/api/v4/sub-account/balances \
--header 'Content-Type: application/json' \
--header 'X-TXC-APIKEY: <api-key>' \
--header 'X-TXC-PAYLOAD: <api-key>' \
--header 'X-TXC-SIGNATURE: <api-key>' \
--data '
{
"id": "8e667b4a-0b71-4988-8af5-9474dbfaeb51",
"ticker": "USDC"
}
'import requests
url = "https://whitebit.com/api/v4/sub-account/balances"
payload = {
"id": "8e667b4a-0b71-4988-8af5-9474dbfaeb51",
"ticker": "USDC"
}
headers = {
"X-TXC-APIKEY": "<api-key>",
"X-TXC-PAYLOAD": "<api-key>",
"X-TXC-SIGNATURE": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-TXC-APIKEY': '<api-key>',
'X-TXC-PAYLOAD': '<api-key>',
'X-TXC-SIGNATURE': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({id: '8e667b4a-0b71-4988-8af5-9474dbfaeb51', ticker: 'USDC'})
};
fetch('https://whitebit.com/api/v4/sub-account/balances', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://whitebit.com/api/v4/sub-account/balances",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'id' => '8e667b4a-0b71-4988-8af5-9474dbfaeb51',
'ticker' => 'USDC'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-TXC-APIKEY: <api-key>",
"X-TXC-PAYLOAD: <api-key>",
"X-TXC-SIGNATURE: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://whitebit.com/api/v4/sub-account/balances"
payload := strings.NewReader("{\n \"id\": \"8e667b4a-0b71-4988-8af5-9474dbfaeb51\",\n \"ticker\": \"USDC\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-TXC-APIKEY", "<api-key>")
req.Header.Add("X-TXC-PAYLOAD", "<api-key>")
req.Header.Add("X-TXC-SIGNATURE", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://whitebit.com/api/v4/sub-account/balances")
.header("X-TXC-APIKEY", "<api-key>")
.header("X-TXC-PAYLOAD", "<api-key>")
.header("X-TXC-SIGNATURE", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"8e667b4a-0b71-4988-8af5-9474dbfaeb51\",\n \"ticker\": \"USDC\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://whitebit.com/api/v4/sub-account/balances")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-TXC-APIKEY"] = '<api-key>'
request["X-TXC-PAYLOAD"] = '<api-key>'
request["X-TXC-SIGNATURE"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"8e667b4a-0b71-4988-8af5-9474dbfaeb51\",\n \"ticker\": \"USDC\"\n}"
response = http.request(request)
puts response.read_body{
"USDC": [
{
"main": "42",
"spot": "10",
"collateral": "14"
}
]
}{
"code": 123,
"message": "<string>"
}Sub-Account Balances
The endpoint returns sub-account balances.
Called with the main-account key, the endpoint confirms that a
Sub-Account Transfer settled: a main_to_sub transfer raises the
sub-account’s main for the ticker by the amount, and a sub_to_main transfer lowers it. Compare the amount read
with the integration’s own record of the transfer.
The main amount includes deposits credited before the network fully confirms the deposits. The sub-account’s own API key
reads the part still held back as pending_deposit_amount from Get main balance,
once /api/v4/main-account/balance is switched on for that key. The held part cannot be transferred to the main
account until the network confirms the deposit.
Rate limit: 1000 requests/10 sec.
The API does not cache the response.
curl --request POST \
--url https://whitebit.com/api/v4/sub-account/balances \
--header 'Content-Type: application/json' \
--header 'X-TXC-APIKEY: <api-key>' \
--header 'X-TXC-PAYLOAD: <api-key>' \
--header 'X-TXC-SIGNATURE: <api-key>' \
--data '
{
"id": "8e667b4a-0b71-4988-8af5-9474dbfaeb51",
"ticker": "USDC"
}
'import requests
url = "https://whitebit.com/api/v4/sub-account/balances"
payload = {
"id": "8e667b4a-0b71-4988-8af5-9474dbfaeb51",
"ticker": "USDC"
}
headers = {
"X-TXC-APIKEY": "<api-key>",
"X-TXC-PAYLOAD": "<api-key>",
"X-TXC-SIGNATURE": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-TXC-APIKEY': '<api-key>',
'X-TXC-PAYLOAD': '<api-key>',
'X-TXC-SIGNATURE': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({id: '8e667b4a-0b71-4988-8af5-9474dbfaeb51', ticker: 'USDC'})
};
fetch('https://whitebit.com/api/v4/sub-account/balances', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://whitebit.com/api/v4/sub-account/balances",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'id' => '8e667b4a-0b71-4988-8af5-9474dbfaeb51',
'ticker' => 'USDC'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-TXC-APIKEY: <api-key>",
"X-TXC-PAYLOAD: <api-key>",
"X-TXC-SIGNATURE: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://whitebit.com/api/v4/sub-account/balances"
payload := strings.NewReader("{\n \"id\": \"8e667b4a-0b71-4988-8af5-9474dbfaeb51\",\n \"ticker\": \"USDC\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-TXC-APIKEY", "<api-key>")
req.Header.Add("X-TXC-PAYLOAD", "<api-key>")
req.Header.Add("X-TXC-SIGNATURE", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://whitebit.com/api/v4/sub-account/balances")
.header("X-TXC-APIKEY", "<api-key>")
.header("X-TXC-PAYLOAD", "<api-key>")
.header("X-TXC-SIGNATURE", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"8e667b4a-0b71-4988-8af5-9474dbfaeb51\",\n \"ticker\": \"USDC\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://whitebit.com/api/v4/sub-account/balances")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-TXC-APIKEY"] = '<api-key>'
request["X-TXC-PAYLOAD"] = '<api-key>'
request["X-TXC-SIGNATURE"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"8e667b4a-0b71-4988-8af5-9474dbfaeb51\",\n \"ticker\": \"USDC\"\n}"
response = http.request(request)
puts response.read_body{
"USDC": [
{
"main": "42",
"spot": "10",
"collateral": "14"
}
]
}{
"code": 123,
"message": "<string>"
}Used in these guides
- Embedded Trading sub-account integration — managed sub-accounts, fee-share, and partner onboarding.
- Wallet-as-a-Service integration — sub-accounts as end-user wallets: deposits, payouts, and per-user API keys.
- Yield-as-a-Service integration — Crypto Lending run in a sub-account per end user.
Authorizations
Body
Was this page helpful?