curl --request POST \
--url https://whitebit.com/api/v4/sub-account/transfer \
--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",
"direction": "main_to_sub",
"amount": "0.5",
"ticker": "ETH"
}
'import requests
url = "https://whitebit.com/api/v4/sub-account/transfer"
payload = {
"id": "8e667b4a-0b71-4988-8af5-9474dbfaeb51",
"direction": "main_to_sub",
"amount": "0.5",
"ticker": "ETH"
}
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',
direction: 'main_to_sub',
amount: '0.5',
ticker: 'ETH'
})
};
fetch('https://whitebit.com/api/v4/sub-account/transfer', 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/transfer",
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',
'direction' => 'main_to_sub',
'amount' => '0.5',
'ticker' => 'ETH'
]),
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/transfer"
payload := strings.NewReader("{\n \"id\": \"8e667b4a-0b71-4988-8af5-9474dbfaeb51\",\n \"direction\": \"main_to_sub\",\n \"amount\": \"0.5\",\n \"ticker\": \"ETH\"\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/transfer")
.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 \"direction\": \"main_to_sub\",\n \"amount\": \"0.5\",\n \"ticker\": \"ETH\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://whitebit.com/api/v4/sub-account/transfer")
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 \"direction\": \"main_to_sub\",\n \"amount\": \"0.5\",\n \"ticker\": \"ETH\"\n}"
response = http.request(request)
puts response.read_body{
"transaction_id": "<string>"
}{
"code": 123,
"message": "<string>",
"errors": {}
}{
"code": 123,
"message": "<string>",
"errors": {}
}Sub-Account Transfer
The endpoint creates transfer from main account to sub-account or vice versa.
Transfers between the main account and any sub-account are fee-free in both directions.
A main_to_sub transfer credits the sub-account’s Main balance, not its Trade balance. A sub_to_main transfer
draws from the sub-account’s Main balance only, never from its Trade balance. A sub_to_main transfer can move only
the part of that balance not held back for a deposit credited before full network confirmation
(pending_deposit_amount). An amount that reaches into the held part is refused with 422 and code 20.
Rate limit: 1000 requests/10 sec.
The API does not cache the response.
The request takes no idempotency key, and two identical requests move the funds twice. A 200 response means
WhiteBIT received the request, and the transfer can still fail after the response. After a timeout or a 5xx
response, the transfer can still complete. A record in
Get Sub-Account Transfer History shows that the
request was received, not that the funds moved, so the history does not confirm a transfer and is not a duplicate
check.
Confirm the transfer on the sub-account side: read main for the ticker with
Sub-Account Balances (main-account key, sub-account id). A
main_to_sub transfer raises it by the amount, and a sub_to_main transfer lowers it. The main account’s own
balance changes with transfers to and from every sub-account and does not confirm a single transfer. After a 200, a timeout or a
5xx, read the sub-account’s main until it shows the transfer, and do not resend the transfer while
waiting. A transfer that does not show is a manual check, not an automatic resend.
The caller cannot attach its own reference to a transfer, so an integration stores its own record of each transfer
before the call. Other movements on the sub-account, such as deposits and withdrawals, also change main, so the
integration compares the amount read with the main amount its own records expect. To keep the comparison
unambiguous, send the next transfer for the same sub-account and ticker only after the previous one shows on the
balance.
curl --request POST \
--url https://whitebit.com/api/v4/sub-account/transfer \
--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",
"direction": "main_to_sub",
"amount": "0.5",
"ticker": "ETH"
}
'import requests
url = "https://whitebit.com/api/v4/sub-account/transfer"
payload = {
"id": "8e667b4a-0b71-4988-8af5-9474dbfaeb51",
"direction": "main_to_sub",
"amount": "0.5",
"ticker": "ETH"
}
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',
direction: 'main_to_sub',
amount: '0.5',
ticker: 'ETH'
})
};
fetch('https://whitebit.com/api/v4/sub-account/transfer', 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/transfer",
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',
'direction' => 'main_to_sub',
'amount' => '0.5',
'ticker' => 'ETH'
]),
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/transfer"
payload := strings.NewReader("{\n \"id\": \"8e667b4a-0b71-4988-8af5-9474dbfaeb51\",\n \"direction\": \"main_to_sub\",\n \"amount\": \"0.5\",\n \"ticker\": \"ETH\"\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/transfer")
.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 \"direction\": \"main_to_sub\",\n \"amount\": \"0.5\",\n \"ticker\": \"ETH\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://whitebit.com/api/v4/sub-account/transfer")
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 \"direction\": \"main_to_sub\",\n \"amount\": \"0.5\",\n \"ticker\": \"ETH\"\n}"
response = http.request(request)
puts response.read_body{
"transaction_id": "<string>"
}{
"code": 123,
"message": "<string>",
"errors": {}
}{
"code": 123,
"message": "<string>",
"errors": {}
}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
Currency's ticker
"ETH"
Response
Transfer request accepted. The transfer can still fail after the response, so confirm it on the sub-account's main balance with Sub-Account Balances.
Was this page helpful?