Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/tiagosiebler/bitget-api/llms.txt

Use this file to discover all available pages before exploring further.

The RestClientV3 account methods cover the full lifecycle of a Unified Trading Account (UTA): reading balances and settings, adjusting leverage and account mode, moving funds between sub-accounts, depositing and withdrawing assets, and managing sub-account creation. Every method on this page requires a valid API key, secret, and passphrase passed to the client constructor.
import { RestClientV3 } from 'bitget-api';

const client = new RestClientV3({
  apiKey: 'YOUR_API_KEY',
  apiSecret: 'YOUR_API_SECRET',
  apiPass: 'YOUR_API_PASSPHRASE',
});

getBalances()

Returns the unified account asset snapshot, including equity, available balance, margin, and per-coin breakdowns. Endpoint: GET /api/v3/account/assets
const balances = await client.getBalances();
console.log('Account assets:', balances.data);

getFundingAssets(params)

Returns assets held in the funding account (separate from the UTA trading account). Optionally filter by coin. Endpoint: GET /api/v3/account/funding-assets
coin
string
Optional coin filter, e.g. USDT. Returns all coins if omitted.
const funding = await client.getFundingAssets({ coin: 'USDT' });
console.log('Funding assets:', funding.data);

getAccountInfo()

Returns account metadata: UID, parent account UID, inviter code, channel, IP whitelist, and API key permissions. Endpoint: GET /api/v3/account/info
const info = await client.getAccountInfo();
console.log('UID:', info.data.uid);

getAccountSettings()

Returns the current account configuration, including hold mode (one-way or hedge), margin mode, default leverage, and per-symbol/coin overrides. Endpoint: GET /api/v3/account/settings
const settings = await client.getAccountSettings();
console.log('Hold mode:', settings.data);

adjustAccountMode(params)

Switches the account level between basic, advanced, delta (delta-neutral), or isolated mode. Can also target a sub-account by passing targetUid. Endpoint: POST /api/v3/account/adjust-account-mode
mode
string
required
Target account mode: basic, advanced, delta, or isolated.
targetUid
string
Sub-account UID. Use when the master account switches mode on behalf of a sub-account.
await client.adjustAccountMode({ mode: 'advanced' });

setLeverage(params)

Sets the leverage for a specific symbol or coin in a futures or margin category. Endpoint: POST /api/v3/account/set-leverage
category
string
required
One of MARGIN, USDT-FUTURES, COIN-FUTURES, USDC-FUTURES.
leverage
string
required
Leverage multiplier as a string, e.g. "10".
symbol
string
Trading symbol, e.g. BTCUSDT. Required for symbol-level leverage.
coin
string
Base coin, e.g. BTC. Used for coin-level leverage in COIN-FUTURES.
posSide
string
Position side in hedge mode: long or short.
await client.setLeverage({
  category: 'USDT-FUTURES',
  symbol: 'BTCUSDT',
  leverage: '20',
});

getFinancialRecords(params)

Returns a paginated ledger of account financial events (deposits, withdrawals, fees, funding, PnL settlements). Endpoint: GET /api/v3/account/financial-records
category
string
required
One of SPOT, MARGIN, USDT-FUTURES, COIN-FUTURES, USDC-FUTURES.
coin
string
Filter by coin, e.g. USDT.
type
string
Event type filter string.
startTime
string
Start of the query window (Unix ms).
endTime
string
End of the query window (Unix ms).
limit
string
Max records per page.
cursor
string
Pagination cursor for the next page.
const records = await client.getFinancialRecords({
  category: 'USDT-FUTURES',
  coin: 'USDT',
  startTime: '1700000000000',
  endTime: '1710000000000',
  limit: '50',
});
console.log('Records:', records.data.list.length);

submitTransfer(params)

Transfers funds between account sub-types (spot, UTA, P2P, futures, margin) for the current user. Endpoint: POST /api/v3/account/transfer
fromType
string
required
Source account type: spot, p2p, coin-futures, usdt-futures, usdc-futures, crossed-margin, isolated-margin, or uta.
toType
string
required
Destination account type. Same valid values as fromType.
coin
string
required
Coin to transfer, e.g. USDT.
amount
string
required
Amount to transfer as a decimal string, e.g. "100".
symbol
string
Required for isolated-margin transfers to specify the margin symbol.
allowBorrow
string
Whether to allow automatic margin borrowing if the balance is insufficient. yes or no.
const transfer = await client.submitTransfer({
  fromType: 'spot',
  toType: 'usdt-futures',
  coin: 'USDT',
  amount: '500',
});
console.log('Transfer ID:', transfer.data.transferId);

getTransferableCoins(params)

Returns the list of coins that can currently be transferred between two specified account types. Endpoint: GET /api/v3/account/transferable-coins
fromType
string
required
Source account type.
toType
string
required
Destination account type.
const coins = await client.getTransferableCoins({
  fromType: 'spot',
  toType: 'usdt-futures',
});
console.log('Transferable coins:', coins.data);

submitWithdraw(params)

Initiates a withdrawal — either on-chain or an internal transfer to another Bitget UID. Endpoint: POST /api/v3/account/withdraw
coin
string
required
Coin to withdraw, e.g. USDT.
transferType
string
required
on_chain for a blockchain withdrawal or internal_transfer for a Bitget-to-Bitget transfer.
address
string
required
Destination address (on-chain) or UID/email/phone (internal transfer).
size
string
required
Amount to withdraw as a decimal string.
chain
string
Blockchain network, e.g. TRC20, ERC20. Required for on-chain withdrawals.
tag
string
Memo or tag field for networks that require it (e.g. XRP).
clientOid
string
Client-assigned order ID for idempotency.
const withdrawal = await client.submitWithdraw({
  coin: 'USDT',
  transferType: 'on_chain',
  address: '0xYourWalletAddress',
  chain: 'ERC20',
  size: '100',
  clientOid: `withdraw-${Date.now()}`,
});
console.log('Withdrawal ID:', withdrawal.data.orderId);

getDepositAddress(params)

Returns the deposit address (and optionally additional addresses) for a given coin and blockchain network. Endpoint: GET /api/v3/account/deposit-address
coin
string
required
Coin to generate or retrieve the deposit address for, e.g. BTC, USDT.
chain
string
Blockchain network filter, e.g. ERC20, TRC20.
size
string
Number of addresses to return.
const addressInfo = await client.getDepositAddress({
  coin: 'USDT',
  chain: 'TRC20',
});
console.log('Deposit address:', addressInfo.data.address);

getDepositRecords(params)

Returns paginated deposit history for the account within a specified time range. Endpoint: GET /api/v3/account/deposit-records
startTime
string
required
Start of the query window (Unix ms).
endTime
string
required
End of the query window (Unix ms).
coin
string
Filter by coin.
orderId
string
Filter by Bitget deposit order ID.
const deposits = await client.getDepositRecords({
  startTime: '1700000000000',
  endTime: '1710000000000',
  coin: 'USDT',
});

getWithdrawRecords(params)

Returns paginated withdrawal history within the specified time range. Endpoint: GET /api/v3/account/withdrawal-records
startTime
string
required
Start of the query window (Unix ms).
endTime
string
required
End of the query window (Unix ms).
coin
string
Filter by coin.
orderId
string
Filter by Bitget withdrawal order ID.
clientOid
string
Filter by client-assigned order ID.
const withdrawals = await client.getWithdrawRecords({
  startTime: '1700000000000',
  endTime: '1710000000000',
});

createSubAccount(params)

Creates a new sub-account under the master account. Endpoint: POST /api/v3/user/create-sub
username
string
required
Username for the new sub-account.
accountMode
string
Initial account mode for the sub-account: classic or unified.
note
string
An optional label or note for identifying the sub-account.
const sub = await client.createSubAccount({
  username: 'trading-bot-1',
  accountMode: 'unified',
  note: 'Automated strategy sub-account',
});
console.log('Sub UID:', sub.data.uid);

getSubAccountList(params)

Returns a paginated list of all sub-accounts belonging to the master account. Endpoint: GET /api/v3/user/sub-list
limit
string
Max results per page.
cursor
string
Pagination cursor.
const subs = await client.getSubAccountList({ limit: '20' });
console.log('Sub-accounts:', subs.data.list.length);

submitRepay(params)

Repays outstanding margin debt using a specified set of repayable and payment coins. Endpoint: POST /api/v3/account/repay
repayableCoinList
string[]
required
Array of coin symbols to repay, e.g. ["USDT", "BTC"].
paymentCoinList
string[]
required
Array of coin symbols to use as payment, e.g. ["USDT"].
const repay = await client.submitRepay({
  repayableCoinList: ['USDT'],
  paymentCoinList: ['USDT'],
});

Complete Account Workflow Example

import { RestClientV3 } from 'bitget-api';

const client = new RestClientV3({
  apiKey: process.env.BITGET_API_KEY!,
  apiSecret: process.env.BITGET_API_SECRET!,
  apiPass: process.env.BITGET_API_PASS!,
});

async function accountWorkflow() {
  // 1. Check balances
  const balances = await client.getBalances();
  console.log('Account assets:', balances.data);

  // 2. Get account settings
  const settings = await client.getAccountSettings();
  console.log('Settings:', settings.data);

  // 3. Transfer USDT from spot to futures
  const transfer = await client.submitTransfer({
    fromType: 'spot',
    toType: 'usdt-futures',
    coin: 'USDT',
    amount: '1000',
  });
  console.log('Transfer ID:', transfer.data.transferId);

  // 4. Set leverage for BTC futures
  await client.setLeverage({
    category: 'USDT-FUTURES',
    symbol: 'BTCUSDT',
    leverage: '10',
  });

  // 5. Check deposit address
  const deposit = await client.getDepositAddress({
    coin: 'USDT',
    chain: 'TRC20',
  });
  console.log('Deposit address:', deposit.data.address);
}

accountWorkflow().catch(console.error);

Build docs developers (and LLMs) love