Skip to content
Start Trading

Get Account Balances

client.V1.Accounts.GetAccountBalances(ctx, accountID, query) (*V1AccountGetAccountBalancesResponse, error)
GET/v1/accounts/{account_id}/balances

Fetch account balance information

ParametersExpand Collapse
accountID int64
query V1AccountGetAccountBalancesParams
TopMarginContributorsLimit param.Field[int64]Optional

Limit the number of top margin contributors returned.

formatint32
minimum1
ReturnsExpand Collapse
type V1AccountGetAccountBalancesResponse 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.

DailyChange string

Difference between current equity and start-of-day equity.

DailyPnl string

Total profit or loss since start of day.

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. When a null/undefined value is observed, it indicates that there is no available data.

formatdate
DeprecatedDayTradeBuyingPower stringOptional

Start-of-day day-trade buying power. When a null/undefined value is observed, it indicates it does not apply.

MaintenanceMarginExcess stringOptional

Start-of-day maintenance margin excess. When a null/undefined value is observed, it indicates it does not apply.

MaintenanceMarginRequirement stringOptional

Start-of-day maintenance margin requirement. When a null/undefined value is observed, it indicates it does not apply.

TradeCash stringOptional

Start-of-day trade cash. When a null/undefined value is observed, it indicates it does not apply.

TradeCash string

Trade-date effective cash.

UnrealizedPnl string

Total unrealized profit or loss across all open positions.

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. When a null/undefined value is observed, it indicates it does not apply.

DeprecatedDayTradeCount 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.

IntradayDetails MarginSessionDetails

Intraday session margin calculation details.

BuyingPower string

Maximum buying power available in the account during the session.

Multiplier stringOptional

Effective multiplier for margin calculations during the session.

MaintenanceMarginExcess string

Maintenance margin excess for trade-date balances.

MaintenanceMarginRequirement string

Maintenance margin requirement for trade-date balances.

OvernightDetails MarginSessionDetails

Overnight session margin calculation details.

BuyingPower string

Maximum buying power available in the account during the session.

Multiplier stringOptional

Effective multiplier for margin calculations during the session.

DeprecatedPatternDayTrader bool

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

DeprecatedDayTradeBuyingPowerUsage stringOptional

The amount of day-trade buying power used during the current trading day. When null/undefined, the value should be assumed to be zero. The field is omitted to simplify the response.

TopContributors []MarginTopContributorOptional

Optional top margin contributors, returned only when explicitly requested.

DeprecatedDayTradeBuyingPowerUsage 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. When a null/undefined value is observed, it indicates that there is no available data.

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. When a null/undefined value is observed, it indicates it does not apply.

ShortMarketValue stringOptional

The total market value of all short positions. When null/undefined, the value should be assumed to be zero. The field is omitted to simplify the response.

Get Account Balances

package main

import (
  "context"
  "fmt"

  "github.com/clear-street/clear-street-go"
  "github.com/clear-street/clear-street-go/option"
)

func main() {
  client := clearstreet.NewClient(
    option.WithAPIKey("My API Key"),
  )
  response, err := client.V1.Accounts.GetAccountBalances(
    context.TODO(),
    0,
    clearstreet.V1AccountGetAccountBalancesParams{

    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response)
}
{
  "data": {
    "account_id": 19816,
    "buying_power": "45000.00",
    "currency": "USD",
    "daily_change": "0.00",
    "daily_pnl": "1250.00",
    "daily_realized_pnl": "700.00",
    "daily_total_pnl": "1250.00",
    "daily_unrealized_pnl": "550.00",
    "equity": "100000.00",
    "long_market_value": "30000.00",
    "margin_type": "NONE",
    "open_order_adjustment": "-5000.00",
    "settled_cash": "60000.00",
    "sod": {
      "asof": "2023-09-27",
      "buying_power": "45000.00",
      "equity": "100000.00",
      "long_market_value": "30000.00",
      "short_market_value": "0.00"
    },
    "trade_cash": "60000.00",
    "unrealized_pnl": "1500.00",
    "unsettled_credits": "20000.00",
    "unsettled_debits": "10000.00",
    "withdrawable_cash": "55000.00"
  },
  "error": null,
  "metadata": {
    "request_id": "b7e2d3f4-a1b2-4c3d-8e4f-5a6b7c8d9e0f"
  }
}
{
  "data": {
    "account_id": 19816,
    "buying_power": "90000.00",
    "currency": "USD",
    "daily_change": "0.00",
    "daily_pnl": "1250.00",
    "daily_realized_pnl": "700.00",
    "daily_total_pnl": "1250.00",
    "daily_unrealized_pnl": "550.00",
    "equity": "100000.00",
    "long_market_value": "40000.00",
    "margin_details": {
      "day_trade_buying_power_usage": "0.00",
      "day_trade_count": 2,
      "initial_margin_excess": "50000.00",
      "initial_margin_requirement": "50000.00",
      "intraday_details": {
        "buying_power": "90000.00",
        "multiplier": "2"
      },
      "maintenance_margin_excess": "75000.00",
      "maintenance_margin_requirement": "25000.00",
      "overnight_details": {
        "buying_power": "90000.00",
        "multiplier": "2"
      },
      "pattern_day_trader": false,
      "top_contributors": [
        {
          "initial_margin_requirement": "25000.00",
          "maintenance_margin_requirement": "15000.00",
          "market_value": "50000.00",
          "underlying_instrument_id": "a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8"
        }
      ],
      "usage": {
        "total": "100000.00",
        "used": "5000.00"
      }
    },
    "margin_type": "REG_T",
    "multiplier": "2",
    "open_order_adjustment": "-10000.00",
    "settled_cash": "99775.05",
    "short_market_value": "10000.00",
    "sod": {
      "asof": "2023-09-27",
      "buying_power": "90000.00",
      "day_trade_buying_power": "200000.00",
      "equity": "100000.00",
      "long_market_value": "40000.00",
      "maintenance_margin_excess": "50000.00",
      "maintenance_margin_requirement": "50000.00",
      "short_market_value": "10000.00",
      "trade_cash": "70000.00"
    },
    "trade_cash": "70000.00",
    "unrealized_pnl": "1500.00",
    "unsettled_credits": "20000.00",
    "unsettled_debits": "10000.00",
    "withdrawable_cash": "75000.00"
  },
  "error": null,
  "metadata": {
    "request_id": "b7e2d3f4-a1b2-4c3d-8e4f-5a6b7c8d9e0f"
  }
}
{
  "error": {
    "code": 403,
    "message": "The caller does not have permission to execute the specified operation"
  },
  "metadata": {
    "request_id": "5518f0c6-58ff-4b4a-81a5-701556d41206"
  }
}
{
  "error": {
    "code": 404,
    "message": "Some requested entity was not found"
  },
  "metadata": {
    "request_id": "67e95eb4-93b9-4010-8c9b-7ada7c2be93f"
  }
}
Returns Examples
{
  "data": {
    "account_id": 19816,
    "buying_power": "45000.00",
    "currency": "USD",
    "daily_change": "0.00",
    "daily_pnl": "1250.00",
    "daily_realized_pnl": "700.00",
    "daily_total_pnl": "1250.00",
    "daily_unrealized_pnl": "550.00",
    "equity": "100000.00",
    "long_market_value": "30000.00",
    "margin_type": "NONE",
    "open_order_adjustment": "-5000.00",
    "settled_cash": "60000.00",
    "sod": {
      "asof": "2023-09-27",
      "buying_power": "45000.00",
      "equity": "100000.00",
      "long_market_value": "30000.00",
      "short_market_value": "0.00"
    },
    "trade_cash": "60000.00",
    "unrealized_pnl": "1500.00",
    "unsettled_credits": "20000.00",
    "unsettled_debits": "10000.00",
    "withdrawable_cash": "55000.00"
  },
  "error": null,
  "metadata": {
    "request_id": "b7e2d3f4-a1b2-4c3d-8e4f-5a6b7c8d9e0f"
  }
}
{
  "data": {
    "account_id": 19816,
    "buying_power": "90000.00",
    "currency": "USD",
    "daily_change": "0.00",
    "daily_pnl": "1250.00",
    "daily_realized_pnl": "700.00",
    "daily_total_pnl": "1250.00",
    "daily_unrealized_pnl": "550.00",
    "equity": "100000.00",
    "long_market_value": "40000.00",
    "margin_details": {
      "day_trade_buying_power_usage": "0.00",
      "day_trade_count": 2,
      "initial_margin_excess": "50000.00",
      "initial_margin_requirement": "50000.00",
      "intraday_details": {
        "buying_power": "90000.00",
        "multiplier": "2"
      },
      "maintenance_margin_excess": "75000.00",
      "maintenance_margin_requirement": "25000.00",
      "overnight_details": {
        "buying_power": "90000.00",
        "multiplier": "2"
      },
      "pattern_day_trader": false,
      "top_contributors": [
        {
          "initial_margin_requirement": "25000.00",
          "maintenance_margin_requirement": "15000.00",
          "market_value": "50000.00",
          "underlying_instrument_id": "a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8"
        }
      ],
      "usage": {
        "total": "100000.00",
        "used": "5000.00"
      }
    },
    "margin_type": "REG_T",
    "multiplier": "2",
    "open_order_adjustment": "-10000.00",
    "settled_cash": "99775.05",
    "short_market_value": "10000.00",
    "sod": {
      "asof": "2023-09-27",
      "buying_power": "90000.00",
      "day_trade_buying_power": "200000.00",
      "equity": "100000.00",
      "long_market_value": "40000.00",
      "maintenance_margin_excess": "50000.00",
      "maintenance_margin_requirement": "50000.00",
      "short_market_value": "10000.00",
      "trade_cash": "70000.00"
    },
    "trade_cash": "70000.00",
    "unrealized_pnl": "1500.00",
    "unsettled_credits": "20000.00",
    "unsettled_debits": "10000.00",
    "withdrawable_cash": "75000.00"
  },
  "error": null,
  "metadata": {
    "request_id": "b7e2d3f4-a1b2-4c3d-8e4f-5a6b7c8d9e0f"
  }
}
{
  "error": {
    "code": 403,
    "message": "The caller does not have permission to execute the specified operation"
  },
  "metadata": {
    "request_id": "5518f0c6-58ff-4b4a-81a5-701556d41206"
  }
}
{
  "error": {
    "code": 404,
    "message": "Some requested entity was not found"
  },
  "metadata": {
    "request_id": "67e95eb4-93b9-4010-8c9b-7ada7c2be93f"
  }
}