Transfer Funds (Master ↔ Subaccount)
Transfers funds between your master account and one of its child subaccounts.
| Method | POST |
| Path | /dma/api/v1/master/transfer |
| Auth | Authenticated (master account API key). |
Body parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
subaccount_id | string | Yes | The subaccount_id of the child subaccount (as a string). |
transfer_type | string | Yes | TRANSFER_IN (master → subaccount) or TRANSFER_OUT (subaccount → master). |
amount | number (double) | Yes | Amount to transfer. Must be > 0. |
coin | string | No | Coin to transfer. Defaults to USDT. Only USDT is supported. |
Request
- Python
- Java
- Go
- Node.js
from reference_client import sign_request, BASE_URL
import requests, json
payload = {
"subaccount_id": "1001",
"transfer_type": "TRANSFER_IN",
"amount": 100.50,
"coin": "USDT"
}
headers, path = sign_request("POST", "/dma/api/v1/master/transfer")
r = requests.post(BASE_URL + path, headers=headers, data=json.dumps(payload))
print(r.json())
Map<String, Object> body = new HashMap<>();
body.put("subaccount_id", "1001");
body.put("transfer_type", "TRANSFER_IN");
body.put("amount", 100.50);
body.put("coin", "USDT");
HttpResponse<String> resp = client.send(
"POST", "/dma/api/v1/master/transfer", null, body);
System.out.println(resp.body());
body := map[string]any{
"subaccount_id": "1001",
"transfer_type": "TRANSFER_IN",
"amount": 100.50,
"coin": "USDT",
}
bodyJSON, _ := json.Marshal(body)
headers, p, err := SignRequest("POST", "/dma/api/v1/master/transfer", nil)
if err != nil { panic(err) }
req, _ := http.NewRequest("POST", BaseURL+p, bytes.NewReader(bodyJSON))
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 body = {
"subaccount_id": "1001",
"transfer_type": "TRANSFER_IN",
"amount": 100.50,
"coin": "USDT"
};
const {headers, path} = signRequest('POST', '/dma/api/v1/master/transfer');
const r = await fetch(BASE_URL + path, {
method: 'POST',
headers,
body: JSON.stringify(body),
});
console.log(await r.json());
Response
{
"message": "transfer successful",
"data": {
"txn_id": "txn_abc123",
"subaccount_id": "1001",
"transfer_type": "TRANSFER_IN",
"amount": 100.50,
"coin": "USDT"
}
}
| Field | Type | Description |
|---|---|---|
data.txn_id | string | Exchange transaction ID (receipt). |
data.subaccount_id | string | The subaccount involved in the transfer. |
data.transfer_type | string | The transfer direction executed. |
data.amount | number | Amount transferred. |
data.coin | string | Coin transferred. |
Errors
| Status | Message | Cause |
|---|---|---|
400 | amount must be greater than zero | Amount is zero or negative. |
400 | unsupported coin "BTC": only USDT is supported... | Non-USDT coin specified. |
400 | subaccount is disabled, inbound transfers not allowed | TRANSFER_IN to a disabled subaccount. |
400 | invalid subaccount_id "abc": must be a valid numeric identifier | Non-numeric subaccount_id. |
400 | invalid transfer_type: must be TRANSFER_IN or TRANSFER_OUT | Invalid transfer_type value. |
403 | subaccount does not belong to your master account | Subaccount belongs to another master. |
404 | subaccount not found for subaccount_id: ... | Subaccount does not exist. |
500 | transfer failed. Please check your balance and try again | Insufficient balance or unexpected failure. |