Skip to content
Get started

Accounts

Manage trading accounts, balances, and portfolio history.

Get Accounts
client.V1.Accounts.GetAccounts(ctx, query) (*V1AccountGetAccountsResponse, error)
GET/v1/accounts
Get Account By ID
client.V1.Accounts.GetAccountByID(ctx, accountID) (*V1AccountGetAccountByIDResponse, error)
GET/v1/accounts/{account_id}
Patch Account By ID
client.V1.Accounts.PatchAccountByID(ctx, accountID, body) (*V1AccountPatchAccountByIDResponse, error)
PATCH/v1/accounts/{account_id}
Get Account Balances
client.V1.Accounts.GetAccountBalances(ctx, accountID, query) (*V1AccountGetAccountBalancesResponse, error)
GET/v1/accounts/{account_id}/balances
Get Portfolio History
client.V1.Accounts.GetPortfolioHistory(ctx, accountID, query) (*V1AccountGetPortfolioHistoryResponse, error)
GET/v1/accounts/{account_id}/portfolio-history
ModelsExpand Collapse
type Account struct{…}

Represents a trading account

ID int64

The unique identifier for the account

formatint64
AccountHolderEntityID int64

The account holder entity identifier

formatint64
FullName string

The full legal name of the account

OpenDate Time

The date the account was opened

formatdate
OptionsLevel int64

The options level of the account

formatint64
ShortName string

The short name of the account

The current status of the account

One of the following:
const AccountStatusActive AccountStatus = "ACTIVE"
const AccountStatusInactive AccountStatus = "INACTIVE"
const AccountStatusClosed AccountStatus = "CLOSED"

The sub-type of account

One of the following:
const AccountSubtypeCash AccountSubtype = "CASH"
const AccountSubtypeMargin AccountSubtype = "MARGIN"
const AccountSubtypeOther AccountSubtype = "OTHER"

The type of account

One of the following:
const AccountTypeCustomer AccountType = "CUSTOMER"
const AccountTypeOther AccountType = "OTHER"
CloseDate TimeOptional

The date the account was closed, if applicable

formatdate
type AccountBalances struct{…}

Represents the balance details for a trading account

AccountID int64

The unique identifier for the account

formatint64
BuyingPower string

The total buying power available in the account.

Currency string

Currency identifier for all monetary values.

DailyRealizedPnl string

Realized profit or loss since start of day.

DailyTotalPnl string

Total profit or loss since start of day.

DailyUnrealizedPnl string

Total unrealized profit or loss across all positions relative to prior close.

Equity string

The total equity in the account.

LongMarketValue string

The total market value of all long positions.

MarginType MarginType

The applicable margin model for the account

One of the following:
const MarginTypeOther MarginType = "OTHER"
const MarginTypeNone MarginType = "NONE"
const MarginTypePortfolioMargin MarginType = "PORTFOLIO_MARGIN"
const MarginTypeRiskBasedHaircutBrokerDealer MarginType = "RISK_BASED_HAIRCUT_BROKER_DEALER"
const MarginTypeRegT MarginType = "REG_T"
const MarginTypeRiskBasedHaircutMarketMaker MarginType = "RISK_BASED_HAIRCUT_MARKET_MAKER"
const MarginTypeCiro MarginType = "CIRO"
const MarginTypeFuturesNlv MarginType = "FUTURES_NLV"
const MarginTypeFuturesTotEq MarginType = "FUTURES_TOT_EQ"
OpenOrderAdjustment string

Signed buying-power correction from open orders.

SettledCash string

The amount of cash that is settled and available for withdrawal or trading.

Start-of-day snapshot balances.

BuyingPower string

Start-of-day buying power.

Equity string

Start-of-day equity.

LongMarketValue string

Start-of-day long market value.

ShortMarketValue string

Start-of-day short market value.

Asof TimeOptional

Timestamp for the start-of-day values.

formatdate
DayTradeBuyingPower stringOptional

Start-of-day day-trade buying power.

MaintenanceMarginExcess stringOptional

Start-of-day maintenance margin excess.

MaintenanceMarginRequirement stringOptional

Start-of-day maintenance margin requirement.

TradeCash stringOptional

Start-of-day trade cash.

TradeCash string

Trade-date effective cash.

UnsettledCredits string

Trade-date unsettled cash credits.

UnsettledDebits string

Trade-date unsettled cash debits.

WithdrawableCash string

The amount of cash currently available to withdraw.

MarginDetails MarginDetailsOptional

Margin-account-only details.

DayTradeCount int64

The number of day trades executed over the 5 most recent trading days.

formatint32
minimum0
InitialMarginExcess string

Initial margin excess for trade-date balances.

InitialMarginRequirement string

Initial margin requirement for trade-date balances.

MaintenanceMarginExcess string

Maintenance margin excess for trade-date balances.

MaintenanceMarginRequirement string

Maintenance margin requirement for trade-date balances.

PatternDayTrader bool

true if the account is currently flagged as a PDT, otherwise false.

DayTradeBuyingPowerUsage stringOptional

The amount of day-trade buying power used during the current trading day.

TopContributors []MarginTopContributorOptional

Optional top margin contributors, returned only when explicitly requested.

DayTradeBuyingPowerUsage string

Day-trade buying power consumed by fills against this underlying on the current trade date. Populated only for pattern day trader accounts.

InitialMarginRequirement string

Initial margin requirement attributable to this underlying.

MaintenanceMarginRequirement string

Maintenance margin requirement attributable to this underlying.

MarketValue string

Net market value attributable to this underlying.

UnderlyingInstrumentID string

UUID of the underlying security contributing to margin requirement.

formatuuid
Usage MarginDetailsUsageOptional

Current usage totals.

Total string

The total margin available in the current model.

Used string

The amount of margin that is currently being utilized.

Multiplier stringOptional

Applied multiplier for margin calculations.

ShortMarketValue stringOptional

The total market value of all short positions.

type AccountBalancesSod struct{…}
BuyingPower string

Start-of-day buying power.

Equity string

Start-of-day equity.

LongMarketValue string

Start-of-day long market value.

ShortMarketValue string

Start-of-day short market value.

Asof TimeOptional

Timestamp for the start-of-day values.

formatdate
DayTradeBuyingPower stringOptional

Start-of-day day-trade buying power.

MaintenanceMarginExcess stringOptional

Start-of-day maintenance margin excess.

MaintenanceMarginRequirement stringOptional

Start-of-day maintenance margin requirement.

TradeCash stringOptional

Start-of-day trade cash.

type AccountList []Account
ID int64

The unique identifier for the account

formatint64
AccountHolderEntityID int64

The account holder entity identifier

formatint64
FullName string

The full legal name of the account

OpenDate Time

The date the account was opened

formatdate
OptionsLevel int64

The options level of the account

formatint64
ShortName string

The short name of the account

The current status of the account

One of the following:
const AccountStatusActive AccountStatus = "ACTIVE"
const AccountStatusInactive AccountStatus = "INACTIVE"
const AccountStatusClosed AccountStatus = "CLOSED"

The sub-type of account

One of the following:
const AccountSubtypeCash AccountSubtype = "CASH"
const AccountSubtypeMargin AccountSubtype = "MARGIN"
const AccountSubtypeOther AccountSubtype = "OTHER"

The type of account

One of the following:
const AccountTypeCustomer AccountType = "CUSTOMER"
const AccountTypeOther AccountType = "OTHER"
CloseDate TimeOptional

The date the account was closed, if applicable

formatdate
type AccountSettings struct{…}
Risk RiskSettingsOptional

Risk settings for the account

MaxNotional stringOptional

The maximum notional value available to the account

type AccountStatus string

Account status

One of the following:
const AccountStatusActive AccountStatus = "ACTIVE"
const AccountStatusInactive AccountStatus = "INACTIVE"
const AccountStatusClosed AccountStatus = "CLOSED"
type AccountSubtype string

Account subtype classification providing more granular categorization

One of the following:
const AccountSubtypeCash AccountSubtype = "CASH"
const AccountSubtypeMargin AccountSubtype = "MARGIN"
const AccountSubtypeOther AccountSubtype = "OTHER"
type AccountType string

Account type classification

One of the following:
const AccountTypeCustomer AccountType = "CUSTOMER"
const AccountTypeOther AccountType = "OTHER"
type MarginDetails struct{…}
DayTradeCount int64

The number of day trades executed over the 5 most recent trading days.

formatint32
minimum0
InitialMarginExcess string

Initial margin excess for trade-date balances.

InitialMarginRequirement string

Initial margin requirement for trade-date balances.

MaintenanceMarginExcess string

Maintenance margin excess for trade-date balances.

MaintenanceMarginRequirement string

Maintenance margin requirement for trade-date balances.

PatternDayTrader bool

true if the account is currently flagged as a PDT, otherwise false.

DayTradeBuyingPowerUsage stringOptional

The amount of day-trade buying power used during the current trading day.

TopContributors []MarginTopContributorOptional

Optional top margin contributors, returned only when explicitly requested.

DayTradeBuyingPowerUsage string

Day-trade buying power consumed by fills against this underlying on the current trade date. Populated only for pattern day trader accounts.

InitialMarginRequirement string

Initial margin requirement attributable to this underlying.

MaintenanceMarginRequirement string

Maintenance margin requirement attributable to this underlying.

MarketValue string

Net market value attributable to this underlying.

UnderlyingInstrumentID string

UUID of the underlying security contributing to margin requirement.

formatuuid
Usage MarginDetailsUsageOptional

Current usage totals.

Total string

The total margin available in the current model.

Used string

The amount of margin that is currently being utilized.

type MarginDetailsUsage struct{…}
Total string

The total margin available in the current model.

Used string

The amount of margin that is currently being utilized.

type MarginTopContributor struct{…}
DayTradeBuyingPowerUsage string

Day-trade buying power consumed by fills against this underlying on the current trade date. Populated only for pattern day trader accounts.

InitialMarginRequirement string

Initial margin requirement attributable to this underlying.

MaintenanceMarginRequirement string

Maintenance margin requirement attributable to this underlying.

MarketValue string

Net market value attributable to this underlying.

UnderlyingInstrumentID string

UUID of the underlying security contributing to margin requirement.

formatuuid
type MarginType string

An account’s margin type

One of the following:
const MarginTypeOther MarginType = "OTHER"
const MarginTypeNone MarginType = "NONE"
const MarginTypePortfolioMargin MarginType = "PORTFOLIO_MARGIN"
const MarginTypeRiskBasedHaircutBrokerDealer MarginType = "RISK_BASED_HAIRCUT_BROKER_DEALER"
const MarginTypeRegT MarginType = "REG_T"
const MarginTypeRiskBasedHaircutMarketMaker MarginType = "RISK_BASED_HAIRCUT_MARKET_MAKER"
const MarginTypeCiro MarginType = "CIRO"
const MarginTypeFuturesNlv MarginType = "FUTURES_NLV"
const MarginTypeFuturesTotEq MarginType = "FUTURES_TOT_EQ"
type PortfolioHistoryResponse struct{…}
Date Time

The date for this segment

formatdate
EodEquity string

The equity at the end of the trading day.

RealizedPnl string

Sum of the profit and loss realized from position closing trading activity.

SodEquity string

The equity at the start of the trading day.

UnrealizedPnl string

Sum of the profit and loss from market changes.

BoughtNotional stringOptional

Amount bought MTM

DayPnl stringOptional

Sum of the profit and loss from intraday trading activities for the trading day.

NetPnl stringOptional

P&L after netting all realized and unrealized P&L, adjustments, dividends, change in accruals, income and expenses

PositionPnl stringOptional

P&L attributable to start-of-day (carried) positions from market movement during this trading day.

SoldNotional stringOptional

Amount sold MTM

type PortfolioHistorySegment struct{…}
Date Time

The date for this segment

formatdate
EodEquity string

The equity at the end of the trading day.

RealizedPnl string

Sum of the profit and loss realized from position closing trading activity.

SodEquity string

The equity at the start of the trading day.

UnrealizedPnl string

Sum of the profit and loss from market changes.

BoughtNotional stringOptional

Amount bought MTM

DayPnl stringOptional

Sum of the profit and loss from intraday trading activities for the trading day.

NetPnl stringOptional

P&L after netting all realized and unrealized P&L, adjustments, dividends, change in accruals, income and expenses

PositionPnl stringOptional

P&L attributable to start-of-day (carried) positions from market movement during this trading day.

SoldNotional stringOptional

Amount sold MTM

type RiskSettings struct{…}

Risk settings for an account

MaxNotional stringOptional

The maximum notional value available to the account