Overview
The Accounts API provides access to account-level data including balances, buying power, positions, and order history for specific trading accounts.Class Reference
Methods
getBalances(accountId)
Retrieve account balances and buying power.accountId(string): Account ID
Promise<Balances>
getOrders(accountId, filters)
Retrieve all orders for an account.accountId(string): Account IDfilters(object, optional): Filter options including status (“open”, “filled”, “cancelled”)
Promise<Order[]>
getPositions(accountId)
Retrieve all positions for an account.accountId(string): Account ID
Promise<Position[]>
TypeScript Types
Examples
Check Account Balance Before Trading
Monitor Account Positions
Review Order History
Calculate Account Performance
Find Winning and Losing Positions
Error Handling
Best Practices
- Check balances before trading to avoid insufficient funds errors
- Monitor positions regularly to stay informed about P/L
- Use filters when querying orders to reduce data transfer
- Cache account data appropriately to minimize API calls
- Handle errors gracefully especially for permission issues
Related APIs
- Orders - Place and manage orders
- Users - Get list of user accounts
- Market Data - Get current prices for positions
API Endpoints
This SDK wraps the following REST API endpoints:GET /v1/accounts/{id}/balances- Get account balancesGET /v1/accounts/{id}/orders- Get account ordersGET /v1/accounts/{id}/positions- Get account positions