Skip to main content

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.
Parameters:
  • accountId (string): Account ID
Returns: Promise<Balances>

getOrders(accountId, filters)

Retrieve all orders for an account.
Parameters:
  • accountId (string): Account ID
  • filters (object, optional): Filter options including status (“open”, “filled”, “cancelled”)
Returns: Promise<Order[]>

getPositions(accountId)

Retrieve all positions for an account.
Parameters:
  • accountId (string): Account ID
Returns: 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

  1. Check balances before trading to avoid insufficient funds errors
  2. Monitor positions regularly to stay informed about P/L
  3. Use filters when querying orders to reduce data transfer
  4. Store account data appropriately to minimize API calls
  5. Handle errors gracefully especially for permission issues
  • 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 balances
  • GET /v2/accounts/{id}/orders - Get account orders
  • GET /v1/accounts/{id}/positions - Get account positions