# V1 ## Domain Types ### Security Type - `SecurityType = "COMMON_STOCK" | "PREFERRED_STOCK" | "OPTION" | 2 more` Security type - `"COMMON_STOCK"` - `"PREFERRED_STOCK"` - `"OPTION"` - `"CASH"` - `"OTHER"` # Accounts ## Get Accounts `client.v1.accounts.getAccounts(AccountGetAccountsParamsquery?, RequestOptionsoptions?): AccountGetAccountsResponse` **get** `/v1/accounts` List accounts the authenticated user has permission to access ### Parameters - `query: AccountGetAccountsParams` - `page_size?: number` The number of items to return per page. Only used when page_token is not provided. - `page_token?: string` Token for retrieving the next or previous page of results. Contains encoded pagination state; when provided, page_size is ignored. ### Returns - `AccountGetAccountsResponse extends BaseResponse` - `data: AccountList` - `id: number` The unique identifier for the account - `account_holder_entity_id: number` The account holder entity identifier - `full_name: string` The full legal name of the account - `open_date: string` The date the account was opened - `options_level: number` The options level of the account - `short_name: string` The short name of the account - `status: AccountStatus` The current status of the account - `"ACTIVE"` - `"INACTIVE"` - `"CLOSED"` - `subtype: AccountSubtype` The sub-type of account - `"CASH"` - `"MARGIN"` - `"OTHER"` - `type: AccountType` The type of account - `"CUSTOMER"` - `"OTHER"` - `close_date?: string | null` The date the account was closed, if applicable ### Example ```typescript import ClearStreet from '@clear-street-internal/sdk'; const client = new ClearStreet({ apiKey: 'My API Key', }); const response = await client.v1.accounts.getAccounts(); console.log(response); ``` #### Response ```json { "data": [ { "account_holder_entity_id": 987654321, "close_date": null, "full_name": "Test Trading Account", "id": 19816, "open_date": "2023-01-15", "short_name": "TST-ACCOUNT-01", "status": "ACTIVE", "subtype": "MARGIN", "type": "CUSTOMER" }, { "account_holder_entity_id": 987654322, "close_date": "2024-08-01", "full_name": "Old Test Account", "id": 19817, "open_date": "2021-05-20", "short_name": "TST-ACCOUNT-02-CLOSED", "status": "CLOSED", "subtype": "CASH", "type": "CUSTOMER" } ], "error": null, "metadata": { "next_page_token": "cGFnZT0yJmxhc3RfaWQ9MTk4MTc=", "page_number": 1, "request_id": "a1b2c3d4-e5f6-7890-1234-567890abcdef", "total_items": 25, "total_pages": 3 } } ``` ## Get Account By ID `client.v1.accounts.getAccountByID(numberaccountID, RequestOptionsoptions?): AccountGetAccountByIDResponse` **get** `/v1/accounts/{account_id}` Fetch account details by ID ### Parameters - `accountID: number` ### Returns - `AccountGetAccountByIDResponse extends BaseResponse` - `data: Account` Represents a trading account - `id: number` The unique identifier for the account - `account_holder_entity_id: number` The account holder entity identifier - `full_name: string` The full legal name of the account - `open_date: string` The date the account was opened - `options_level: number` The options level of the account - `short_name: string` The short name of the account - `status: AccountStatus` The current status of the account - `"ACTIVE"` - `"INACTIVE"` - `"CLOSED"` - `subtype: AccountSubtype` The sub-type of account - `"CASH"` - `"MARGIN"` - `"OTHER"` - `type: AccountType` The type of account - `"CUSTOMER"` - `"OTHER"` - `close_date?: string | null` The date the account was closed, if applicable ### Example ```typescript import ClearStreet from '@clear-street-internal/sdk'; const client = new ClearStreet({ apiKey: 'My API Key', }); const response = await client.v1.accounts.getAccountByID(0); console.log(response); ``` #### Response ```json { "data": { "account_holder_entity_id": 987654321, "close_date": null, "full_name": "Test Trading Account", "id": 19816, "open_date": "2023-01-15", "short_name": "TST-ACCOUNT-01", "status": "ACTIVE", "subtype": "MARGIN", "type": "CUSTOMER" }, "error": null, "metadata": { "request_id": "b7e2d3f4-a1b2-4c3d-8e4f-5a6b7c8d9e0f" } } ``` ## Patch Account By ID `client.v1.accounts.patchAccountByID(numberaccountID, AccountPatchAccountByIDParamsbody, RequestOptionsoptions?): AccountPatchAccountByIDResponse` **patch** `/v1/accounts/{account_id}` Update account risk settings ### Parameters - `accountID: number` - `body: AccountPatchAccountByIDParams` - `risk?: RiskSettings | null` Risk settings for the account - `max_notional?: string | null` The maximum notional value available to the account ### Returns - `AccountPatchAccountByIDResponse extends BaseResponse` - `data: AccountSettings` - `risk?: RiskSettings | null` Risk settings for the account - `max_notional?: string | null` The maximum notional value available to the account ### Example ```typescript import ClearStreet from '@clear-street-internal/sdk'; const client = new ClearStreet({ apiKey: 'My API Key', }); const response = await client.v1.accounts.patchAccountByID(0); console.log(response); ``` #### Response ```json { "data": { "risk": { "max_notional": "5000000.00" } }, "error": null, "metadata": { "request_id": "c8f3e4a5-b2c3-5d4e-9f0a-6b7c8d9e0f1a" } } ``` ## Get Account Balances `client.v1.accounts.getAccountBalances(numberaccountID, AccountGetAccountBalancesParamsquery?, RequestOptionsoptions?): AccountGetAccountBalancesResponse` **get** `/v1/accounts/{account_id}/balances` Fetch account balance information ### Parameters - `accountID: number` - `query: AccountGetAccountBalancesParams` - `top_margin_contributors_limit?: number` Limit the number of top margin contributors returned by the engine. ### Returns - `AccountGetAccountBalancesResponse extends BaseResponse` - `data: AccountBalances` Represents the balance details for a trading account - `account_id: number` The unique identifier for the account - `buying_power: string` The total buying power available in the account. - `currency: string` Currency identifier for all monetary values. - `daily_realized_pnl: string` Realized profit or loss since start of day. - `daily_total_pnl: string` Total profit or loss since start of day. - `daily_unrealized_pnl: string` Total unrealized profit or loss across all positions relative to prior close. - `equity: string` The total equity in the account. - `long_market_value: string` The total market value of all long positions. - `margin_type: MarginType` The applicable margin model for the account - `"OTHER"` - `"NONE"` - `"PORTFOLIO_MARGIN"` - `"RISK_BASED_HAIRCUT_BROKER_DEALER"` - `"REG_T"` - `"RISK_BASED_HAIRCUT_MARKET_MAKER"` - `"CIRO"` - `"FUTURES_NLV"` - `"FUTURES_TOT_EQ"` - `open_order_adjustment: string` Signed buying-power correction from open orders. - `settled_cash: string` The amount of cash that is settled and available for withdrawal or trading. - `sod: AccountBalancesSod` Start-of-day snapshot balances. - `buying_power: string` Start-of-day buying power. - `equity: string` Start-of-day equity. - `long_market_value: string` Start-of-day long market value. - `short_market_value: string` Start-of-day short market value. - `asof?: string | null` Timestamp for the start-of-day values. - `day_trade_buying_power?: string | null` Start-of-day day-trade buying power. - `maintenance_margin_excess?: string | null` Start-of-day maintenance margin excess. - `maintenance_margin_requirement?: string | null` Start-of-day maintenance margin requirement. - `trade_cash?: string | null` Start-of-day trade cash. - `trade_cash: string` Trade-date effective cash. - `unsettled_credits: string` Trade-date unsettled cash credits. - `unsettled_debits: string` Trade-date unsettled cash debits. - `withdrawable_cash: string` The amount of cash currently available to withdraw. - `margin_details?: MarginDetails | null` Margin-account-only details. - `day_trade_count: number` The number of day trades executed over the 5 most recent trading days. - `initial_margin_excess: string` Initial margin excess for trade-date balances. - `initial_margin_requirement: string` Initial margin requirement for trade-date balances. - `maintenance_margin_excess: string` Maintenance margin excess for trade-date balances. - `maintenance_margin_requirement: string` Maintenance margin requirement for trade-date balances. - `pattern_day_trader: boolean` `true` if the account is currently flagged as a PDT, otherwise `false`. - `day_trade_buying_power_usage?: string | null` The amount of day-trade buying power used during the current trading day. - `top_contributors?: Array` Optional top margin contributors, returned only when explicitly requested. - `day_trade_buying_power_usage: string` Day-trade buying power consumed by fills against this underlying on the current trade date. Populated only for pattern day trader accounts. - `initial_margin_requirement: string` Initial margin requirement attributable to this underlying. - `maintenance_margin_requirement: string` Maintenance margin requirement attributable to this underlying. - `market_value: string` Net market value attributable to this underlying. - `underlying_instrument_id: string` UUID of the underlying security contributing to margin requirement. - `usage?: MarginDetailsUsage | null` 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?: string | null` Applied multiplier for margin calculations. - `short_market_value?: string | null` The total market value of all short positions. ### Example ```typescript import ClearStreet from '@clear-street-internal/sdk'; const client = new ClearStreet({ apiKey: 'My API Key', }); const response = await client.v1.accounts.getAccountBalances(0); console.log(response); ``` #### Response ```json { "data": { "account_id": 19816, "buying_power": "45000.00", "currency": "USD", "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" }, "trade_cash": "60000.00", "unsettled_credits": "20000.00", "unsettled_debits": "10000.00", "withdrawable_cash": "55000.00" }, "error": null, "metadata": { "request_id": "b7e2d3f4-a1b2-4c3d-8e4f-5a6b7c8d9e0f" } } ``` ## Get Portfolio History `client.v1.accounts.getPortfolioHistory(numberaccountID, AccountGetPortfolioHistoryParamsquery, RequestOptionsoptions?): AccountGetPortfolioHistoryResponse` **get** `/v1/accounts/{account_id}/portfolio-history` Retrieves daily portfolio history for the specified account. ### Parameters - `accountID: number` - `query: AccountGetPortfolioHistoryParams` - `start_date: string` Start date for the portfolio history range, in YYYY-MM-DD format. - `end_date?: string` Defaults to today in America/New_York when omitted. ### Returns - `AccountGetPortfolioHistoryResponse extends BaseResponse` - `data: PortfolioHistoryResponse` - `segments: Array` - `date: string` The date for this segment - `eod_equity: string` The equity at the end of the trading day. - `realized_pnl: string` Sum of the profit and loss realized from position closing trading activity. - `sod_equity: string` The equity at the start of the trading day. - `unrealized_pnl: string` Sum of the profit and loss from market changes. - `bought_notional?: string | null` Amount bought MTM - `day_pnl?: string | null` Sum of the profit and loss from intraday trading activities for the trading day. - `net_pnl?: string | null` P&L after netting all realized and unrealized P&L, adjustments, dividends, change in accruals, income and expenses - `position_pnl?: string | null` P&L attributable to start-of-day (carried) positions from market movement during this trading day. - `sold_notional?: string | null` Amount sold MTM ### Example ```typescript import ClearStreet from '@clear-street-internal/sdk'; const client = new ClearStreet({ apiKey: 'My API Key', }); const response = await client.v1.accounts.getPortfolioHistory(0, { start_date: '2019-12-27' }); console.log(response); ``` #### Response ```json { "data": { "segments": [ { "bought_notional": "39800.00", "date": "2026-04-15", "day_pnl": "850.25", "eod_equity": "100850.25", "net_pnl": "850.25", "position_pnl": "-350.25", "realized_pnl": "1200.50", "sod_equity": "100000.00", "sold_notional": "42500.00", "unrealized_pnl": "-350.25" } ] }, "error": null, "metadata": { "request_id": "f076d6f6-10c9-42a0-98c5-18cebc427e80" } } ``` ## Domain Types ### Account - `Account` Represents a trading account - `id: number` The unique identifier for the account - `account_holder_entity_id: number` The account holder entity identifier - `full_name: string` The full legal name of the account - `open_date: string` The date the account was opened - `options_level: number` The options level of the account - `short_name: string` The short name of the account - `status: AccountStatus` The current status of the account - `"ACTIVE"` - `"INACTIVE"` - `"CLOSED"` - `subtype: AccountSubtype` The sub-type of account - `"CASH"` - `"MARGIN"` - `"OTHER"` - `type: AccountType` The type of account - `"CUSTOMER"` - `"OTHER"` - `close_date?: string | null` The date the account was closed, if applicable ### Account Balances - `AccountBalances` Represents the balance details for a trading account - `account_id: number` The unique identifier for the account - `buying_power: string` The total buying power available in the account. - `currency: string` Currency identifier for all monetary values. - `daily_realized_pnl: string` Realized profit or loss since start of day. - `daily_total_pnl: string` Total profit or loss since start of day. - `daily_unrealized_pnl: string` Total unrealized profit or loss across all positions relative to prior close. - `equity: string` The total equity in the account. - `long_market_value: string` The total market value of all long positions. - `margin_type: MarginType` The applicable margin model for the account - `"OTHER"` - `"NONE"` - `"PORTFOLIO_MARGIN"` - `"RISK_BASED_HAIRCUT_BROKER_DEALER"` - `"REG_T"` - `"RISK_BASED_HAIRCUT_MARKET_MAKER"` - `"CIRO"` - `"FUTURES_NLV"` - `"FUTURES_TOT_EQ"` - `open_order_adjustment: string` Signed buying-power correction from open orders. - `settled_cash: string` The amount of cash that is settled and available for withdrawal or trading. - `sod: AccountBalancesSod` Start-of-day snapshot balances. - `buying_power: string` Start-of-day buying power. - `equity: string` Start-of-day equity. - `long_market_value: string` Start-of-day long market value. - `short_market_value: string` Start-of-day short market value. - `asof?: string | null` Timestamp for the start-of-day values. - `day_trade_buying_power?: string | null` Start-of-day day-trade buying power. - `maintenance_margin_excess?: string | null` Start-of-day maintenance margin excess. - `maintenance_margin_requirement?: string | null` Start-of-day maintenance margin requirement. - `trade_cash?: string | null` Start-of-day trade cash. - `trade_cash: string` Trade-date effective cash. - `unsettled_credits: string` Trade-date unsettled cash credits. - `unsettled_debits: string` Trade-date unsettled cash debits. - `withdrawable_cash: string` The amount of cash currently available to withdraw. - `margin_details?: MarginDetails | null` Margin-account-only details. - `day_trade_count: number` The number of day trades executed over the 5 most recent trading days. - `initial_margin_excess: string` Initial margin excess for trade-date balances. - `initial_margin_requirement: string` Initial margin requirement for trade-date balances. - `maintenance_margin_excess: string` Maintenance margin excess for trade-date balances. - `maintenance_margin_requirement: string` Maintenance margin requirement for trade-date balances. - `pattern_day_trader: boolean` `true` if the account is currently flagged as a PDT, otherwise `false`. - `day_trade_buying_power_usage?: string | null` The amount of day-trade buying power used during the current trading day. - `top_contributors?: Array` Optional top margin contributors, returned only when explicitly requested. - `day_trade_buying_power_usage: string` Day-trade buying power consumed by fills against this underlying on the current trade date. Populated only for pattern day trader accounts. - `initial_margin_requirement: string` Initial margin requirement attributable to this underlying. - `maintenance_margin_requirement: string` Maintenance margin requirement attributable to this underlying. - `market_value: string` Net market value attributable to this underlying. - `underlying_instrument_id: string` UUID of the underlying security contributing to margin requirement. - `usage?: MarginDetailsUsage | null` 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?: string | null` Applied multiplier for margin calculations. - `short_market_value?: string | null` The total market value of all short positions. ### Account Balances Sod - `AccountBalancesSod` - `buying_power: string` Start-of-day buying power. - `equity: string` Start-of-day equity. - `long_market_value: string` Start-of-day long market value. - `short_market_value: string` Start-of-day short market value. - `asof?: string | null` Timestamp for the start-of-day values. - `day_trade_buying_power?: string | null` Start-of-day day-trade buying power. - `maintenance_margin_excess?: string | null` Start-of-day maintenance margin excess. - `maintenance_margin_requirement?: string | null` Start-of-day maintenance margin requirement. - `trade_cash?: string | null` Start-of-day trade cash. ### Account List - `AccountList = Array` - `id: number` The unique identifier for the account - `account_holder_entity_id: number` The account holder entity identifier - `full_name: string` The full legal name of the account - `open_date: string` The date the account was opened - `options_level: number` The options level of the account - `short_name: string` The short name of the account - `status: AccountStatus` The current status of the account - `"ACTIVE"` - `"INACTIVE"` - `"CLOSED"` - `subtype: AccountSubtype` The sub-type of account - `"CASH"` - `"MARGIN"` - `"OTHER"` - `type: AccountType` The type of account - `"CUSTOMER"` - `"OTHER"` - `close_date?: string | null` The date the account was closed, if applicable ### Account Settings - `AccountSettings` - `risk?: RiskSettings | null` Risk settings for the account - `max_notional?: string | null` The maximum notional value available to the account ### Account Status - `AccountStatus = "ACTIVE" | "INACTIVE" | "CLOSED"` Account status - `"ACTIVE"` - `"INACTIVE"` - `"CLOSED"` ### Account Subtype - `AccountSubtype = "CASH" | "MARGIN" | "OTHER"` Account subtype classification providing more granular categorization - `"CASH"` - `"MARGIN"` - `"OTHER"` ### Account Type - `AccountType = "CUSTOMER" | "OTHER"` Account type classification - `"CUSTOMER"` - `"OTHER"` ### Margin Details - `MarginDetails` - `day_trade_count: number` The number of day trades executed over the 5 most recent trading days. - `initial_margin_excess: string` Initial margin excess for trade-date balances. - `initial_margin_requirement: string` Initial margin requirement for trade-date balances. - `maintenance_margin_excess: string` Maintenance margin excess for trade-date balances. - `maintenance_margin_requirement: string` Maintenance margin requirement for trade-date balances. - `pattern_day_trader: boolean` `true` if the account is currently flagged as a PDT, otherwise `false`. - `day_trade_buying_power_usage?: string | null` The amount of day-trade buying power used during the current trading day. - `top_contributors?: Array` Optional top margin contributors, returned only when explicitly requested. - `day_trade_buying_power_usage: string` Day-trade buying power consumed by fills against this underlying on the current trade date. Populated only for pattern day trader accounts. - `initial_margin_requirement: string` Initial margin requirement attributable to this underlying. - `maintenance_margin_requirement: string` Maintenance margin requirement attributable to this underlying. - `market_value: string` Net market value attributable to this underlying. - `underlying_instrument_id: string` UUID of the underlying security contributing to margin requirement. - `usage?: MarginDetailsUsage | null` Current usage totals. - `total: string` The total margin available in the current model. - `used: string` The amount of margin that is currently being utilized. ### Margin Details Usage - `MarginDetailsUsage` - `total: string` The total margin available in the current model. - `used: string` The amount of margin that is currently being utilized. ### Margin Top Contributor - `MarginTopContributor` - `day_trade_buying_power_usage: string` Day-trade buying power consumed by fills against this underlying on the current trade date. Populated only for pattern day trader accounts. - `initial_margin_requirement: string` Initial margin requirement attributable to this underlying. - `maintenance_margin_requirement: string` Maintenance margin requirement attributable to this underlying. - `market_value: string` Net market value attributable to this underlying. - `underlying_instrument_id: string` UUID of the underlying security contributing to margin requirement. ### Margin Type - `MarginType = "OTHER" | "NONE" | "PORTFOLIO_MARGIN" | 6 more` An account's margin type - `"OTHER"` - `"NONE"` - `"PORTFOLIO_MARGIN"` - `"RISK_BASED_HAIRCUT_BROKER_DEALER"` - `"REG_T"` - `"RISK_BASED_HAIRCUT_MARKET_MAKER"` - `"CIRO"` - `"FUTURES_NLV"` - `"FUTURES_TOT_EQ"` ### Portfolio History Response - `PortfolioHistoryResponse` - `segments: Array` - `date: string` The date for this segment - `eod_equity: string` The equity at the end of the trading day. - `realized_pnl: string` Sum of the profit and loss realized from position closing trading activity. - `sod_equity: string` The equity at the start of the trading day. - `unrealized_pnl: string` Sum of the profit and loss from market changes. - `bought_notional?: string | null` Amount bought MTM - `day_pnl?: string | null` Sum of the profit and loss from intraday trading activities for the trading day. - `net_pnl?: string | null` P&L after netting all realized and unrealized P&L, adjustments, dividends, change in accruals, income and expenses - `position_pnl?: string | null` P&L attributable to start-of-day (carried) positions from market movement during this trading day. - `sold_notional?: string | null` Amount sold MTM ### Portfolio History Segment - `PortfolioHistorySegment` - `date: string` The date for this segment - `eod_equity: string` The equity at the end of the trading day. - `realized_pnl: string` Sum of the profit and loss realized from position closing trading activity. - `sod_equity: string` The equity at the start of the trading day. - `unrealized_pnl: string` Sum of the profit and loss from market changes. - `bought_notional?: string | null` Amount bought MTM - `day_pnl?: string | null` Sum of the profit and loss from intraday trading activities for the trading day. - `net_pnl?: string | null` P&L after netting all realized and unrealized P&L, adjustments, dividends, change in accruals, income and expenses - `position_pnl?: string | null` P&L attributable to start-of-day (carried) positions from market movement during this trading day. - `sold_notional?: string | null` Amount sold MTM ### Risk Settings - `RiskSettings` Risk settings for an account - `max_notional?: string | null` The maximum notional value available to the account ### Account Get Accounts Response - `AccountGetAccountsResponse extends BaseResponse` - `data: AccountList` - `id: number` The unique identifier for the account - `account_holder_entity_id: number` The account holder entity identifier - `full_name: string` The full legal name of the account - `open_date: string` The date the account was opened - `options_level: number` The options level of the account - `short_name: string` The short name of the account - `status: AccountStatus` The current status of the account - `"ACTIVE"` - `"INACTIVE"` - `"CLOSED"` - `subtype: AccountSubtype` The sub-type of account - `"CASH"` - `"MARGIN"` - `"OTHER"` - `type: AccountType` The type of account - `"CUSTOMER"` - `"OTHER"` - `close_date?: string | null` The date the account was closed, if applicable ### Account Get Account By ID Response - `AccountGetAccountByIDResponse extends BaseResponse` - `data: Account` Represents a trading account - `id: number` The unique identifier for the account - `account_holder_entity_id: number` The account holder entity identifier - `full_name: string` The full legal name of the account - `open_date: string` The date the account was opened - `options_level: number` The options level of the account - `short_name: string` The short name of the account - `status: AccountStatus` The current status of the account - `"ACTIVE"` - `"INACTIVE"` - `"CLOSED"` - `subtype: AccountSubtype` The sub-type of account - `"CASH"` - `"MARGIN"` - `"OTHER"` - `type: AccountType` The type of account - `"CUSTOMER"` - `"OTHER"` - `close_date?: string | null` The date the account was closed, if applicable ### Account Patch Account By ID Response - `AccountPatchAccountByIDResponse extends BaseResponse` - `data: AccountSettings` - `risk?: RiskSettings | null` Risk settings for the account - `max_notional?: string | null` The maximum notional value available to the account ### Account Get Account Balances Response - `AccountGetAccountBalancesResponse extends BaseResponse` - `data: AccountBalances` Represents the balance details for a trading account - `account_id: number` The unique identifier for the account - `buying_power: string` The total buying power available in the account. - `currency: string` Currency identifier for all monetary values. - `daily_realized_pnl: string` Realized profit or loss since start of day. - `daily_total_pnl: string` Total profit or loss since start of day. - `daily_unrealized_pnl: string` Total unrealized profit or loss across all positions relative to prior close. - `equity: string` The total equity in the account. - `long_market_value: string` The total market value of all long positions. - `margin_type: MarginType` The applicable margin model for the account - `"OTHER"` - `"NONE"` - `"PORTFOLIO_MARGIN"` - `"RISK_BASED_HAIRCUT_BROKER_DEALER"` - `"REG_T"` - `"RISK_BASED_HAIRCUT_MARKET_MAKER"` - `"CIRO"` - `"FUTURES_NLV"` - `"FUTURES_TOT_EQ"` - `open_order_adjustment: string` Signed buying-power correction from open orders. - `settled_cash: string` The amount of cash that is settled and available for withdrawal or trading. - `sod: AccountBalancesSod` Start-of-day snapshot balances. - `buying_power: string` Start-of-day buying power. - `equity: string` Start-of-day equity. - `long_market_value: string` Start-of-day long market value. - `short_market_value: string` Start-of-day short market value. - `asof?: string | null` Timestamp for the start-of-day values. - `day_trade_buying_power?: string | null` Start-of-day day-trade buying power. - `maintenance_margin_excess?: string | null` Start-of-day maintenance margin excess. - `maintenance_margin_requirement?: string | null` Start-of-day maintenance margin requirement. - `trade_cash?: string | null` Start-of-day trade cash. - `trade_cash: string` Trade-date effective cash. - `unsettled_credits: string` Trade-date unsettled cash credits. - `unsettled_debits: string` Trade-date unsettled cash debits. - `withdrawable_cash: string` The amount of cash currently available to withdraw. - `margin_details?: MarginDetails | null` Margin-account-only details. - `day_trade_count: number` The number of day trades executed over the 5 most recent trading days. - `initial_margin_excess: string` Initial margin excess for trade-date balances. - `initial_margin_requirement: string` Initial margin requirement for trade-date balances. - `maintenance_margin_excess: string` Maintenance margin excess for trade-date balances. - `maintenance_margin_requirement: string` Maintenance margin requirement for trade-date balances. - `pattern_day_trader: boolean` `true` if the account is currently flagged as a PDT, otherwise `false`. - `day_trade_buying_power_usage?: string | null` The amount of day-trade buying power used during the current trading day. - `top_contributors?: Array` Optional top margin contributors, returned only when explicitly requested. - `day_trade_buying_power_usage: string` Day-trade buying power consumed by fills against this underlying on the current trade date. Populated only for pattern day trader accounts. - `initial_margin_requirement: string` Initial margin requirement attributable to this underlying. - `maintenance_margin_requirement: string` Maintenance margin requirement attributable to this underlying. - `market_value: string` Net market value attributable to this underlying. - `underlying_instrument_id: string` UUID of the underlying security contributing to margin requirement. - `usage?: MarginDetailsUsage | null` 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?: string | null` Applied multiplier for margin calculations. - `short_market_value?: string | null` The total market value of all short positions. ### Account Get Portfolio History Response - `AccountGetPortfolioHistoryResponse extends BaseResponse` - `data: PortfolioHistoryResponse` - `segments: Array` - `date: string` The date for this segment - `eod_equity: string` The equity at the end of the trading day. - `realized_pnl: string` Sum of the profit and loss realized from position closing trading activity. - `sod_equity: string` The equity at the start of the trading day. - `unrealized_pnl: string` Sum of the profit and loss from market changes. - `bought_notional?: string | null` Amount bought MTM - `day_pnl?: string | null` Sum of the profit and loss from intraday trading activities for the trading day. - `net_pnl?: string | null` P&L after netting all realized and unrealized P&L, adjustments, dividends, change in accruals, income and expenses - `position_pnl?: string | null` P&L attributable to start-of-day (carried) positions from market movement during this trading day. - `sold_notional?: string | null` Amount sold MTM # API Version ## Get the API version. `client.v1.apiVersion.getVersion(RequestOptionsoptions?): APIVersionGetVersionResponse` **get** `/v1/version` Returns the current version string for this API endpoint. ### Returns - `APIVersionGetVersionResponse extends BaseResponse` - `data: Version` API version information - `version: string` API version string ### Example ```typescript import ClearStreet from '@clear-street-internal/sdk'; const client = new ClearStreet({ apiKey: 'My API Key', }); const response = await client.v1.apiVersion.getVersion(); console.log(response); ``` #### Response ```json { "data": { "version": "2025-10-31" }, "error": null, "metadata": { "request_id": "2c3d4e5f-6a7b-8c9d-0e1f-2a3b4c5d6e7f" } } ``` ## Domain Types ### Version - `Version` API version information - `version: string` API version string ### API Version Get Version Response - `APIVersionGetVersionResponse extends BaseResponse` - `data: Version` API version information - `version: string` API version string # Calendar ## Get Clock `client.v1.calendar.getClock(RequestOptionsoptions?): CalendarGetClockResponse` **get** `/v1/clock` Returns the current server time in UTC. ### Returns - `CalendarGetClockResponse extends BaseResponse` - `data: ClockDetail` Current server time and market clock information - `clock: string` Current server time in UTC ### Example ```typescript import ClearStreet from '@clear-street-internal/sdk'; const client = new ClearStreet({ apiKey: 'My API Key', }); const response = await client.v1.calendar.getClock(); console.log(response); ``` #### Response ```json { "data": { "clock": "2025-03-01T03:35:00.000000000Z" }, "error": null, "metadata": { "request_id": "1b2c3d4e-5f6a-7b8c-9d0e-1f2a3b4c5d6e" } } ``` ## Get Market Hours Calendar. `client.v1.calendar.getMarketHoursCalendar(CalendarGetMarketHoursCalendarParamsquery, RequestOptionsoptions?): CalendarGetMarketHoursCalendarResponse` **get** `/v1/calendars/market-hours` Retrieves comprehensive trading hours including pre-market, regular, and after-hours sessions. Returns market status, session times, and next session schedules. ### Parameters - `query: CalendarGetMarketHoursCalendarParams` - `date: string` The date to query market hours for (YYYY-MM-DD). Defaults to today. - `market?: MarketType` Market type to query (us_equities, us_options). If omitted, returns all markets. - `"us_equities"` - `"us_options"` ### Returns - `CalendarGetMarketHoursCalendarResponse extends BaseResponse` - `data: MarketHoursDetailList` - `current_time: string` Current time in market timezone with offset - `date: string` The date for which market hours are provided - `market: MarketType` Market type identifier - `"us_equities"` - `"us_options"` - `market_name: string` Human-readable market name - `next_sessions: TradingSessions` Next trading day's session schedules (without time_until fields) - `after_hours?: SessionSchedule | null` After-hours session schedule, null if not available - `close: string` Session close timestamp with timezone offset - `open: string` Session open timestamp with timezone offset - `time_until_close?: string | null` ISO 8601 duration until session closes. Null if session is not currently open. - `time_until_open?: string | null` ISO 8601 duration until session opens. Null if session has already started or closed. - `pre_market?: SessionSchedule | null` Pre-market session schedule, null if not available - `regular?: SessionSchedule | null` Regular trading session schedule, null if holiday/weekend - `status: MarketStatus` Market status information - `day_type: DayType` The type of trading day - `"TRADING_DAY"` - `"EARLY_CLOSE"` - `"HOLIDAY"` - `"WEEKEND"` - `is_open: boolean` Whether the market is currently open (real-time) - `current_session?: MarketSessionType | null` Current session type if market is open, null if closed - `"pre_market"` - `"regular"` - `"after_hours"` - `timezone: string` IANA timezone identifier for the market - `today_sessions: TradingSessions` Trading session schedules for the requested date with time_until fields ### Example ```typescript import ClearStreet from '@clear-street-internal/sdk'; const client = new ClearStreet({ apiKey: 'My API Key', }); const response = await client.v1.calendar.getMarketHoursCalendar({ date: 'date' }); console.log(response); ``` #### Response ```json { "data": [ { "current_time": "2025-11-28T11:00:00-05:00", "date": "2025-11-28", "market": "us_equities", "market_name": "US Equities", "next_sessions": { "after_hours": { "close": "2025-12-01T20:00:00-05:00", "open": "2025-12-01T16:00:00-05:00" }, "pre_market": { "close": "2025-12-01T09:30:00-05:00", "open": "2025-12-01T04:00:00-05:00" }, "regular": { "close": "2025-12-01T16:00:00-05:00", "open": "2025-12-01T09:30:00-05:00" } }, "status": { "current_session": "regular", "day_type": "EARLY_CLOSE", "is_open": true }, "timezone": "America/New_York", "today_sessions": { "pre_market": { "close": "2025-11-28T09:30:00-05:00", "open": "2025-11-28T04:00:00-05:00" }, "regular": { "close": "2025-11-28T13:00:00-05:00", "open": "2025-11-28T09:30:00-05:00", "time_until_close": "PT2H" } } } ], "error": null, "metadata": { "request_id": "3d4e5f6a-7b8c-9d0e-1f2a-3b4c5d6e7f8a" } } ``` ## Domain Types ### Clock Detail - `ClockDetail` Current server time and market clock information - `clock: string` Current server time in UTC ### Day Type - `DayType = "TRADING_DAY" | "EARLY_CLOSE" | "HOLIDAY" | "WEEKEND"` Day type for market hours - indicates the type of trading day - `"TRADING_DAY"` - `"EARLY_CLOSE"` - `"HOLIDAY"` - `"WEEKEND"` ### Market Hours Detail - `MarketHoursDetail` Comprehensive market hours information for a specific market and date - `current_time: string` Current time in market timezone with offset - `date: string` The date for which market hours are provided - `market: MarketType` Market type identifier - `"us_equities"` - `"us_options"` - `market_name: string` Human-readable market name - `next_sessions: TradingSessions` Next trading day's session schedules (without time_until fields) - `after_hours?: SessionSchedule | null` After-hours session schedule, null if not available - `close: string` Session close timestamp with timezone offset - `open: string` Session open timestamp with timezone offset - `time_until_close?: string | null` ISO 8601 duration until session closes. Null if session is not currently open. - `time_until_open?: string | null` ISO 8601 duration until session opens. Null if session has already started or closed. - `pre_market?: SessionSchedule | null` Pre-market session schedule, null if not available - `regular?: SessionSchedule | null` Regular trading session schedule, null if holiday/weekend - `status: MarketStatus` Market status information - `day_type: DayType` The type of trading day - `"TRADING_DAY"` - `"EARLY_CLOSE"` - `"HOLIDAY"` - `"WEEKEND"` - `is_open: boolean` Whether the market is currently open (real-time) - `current_session?: MarketSessionType | null` Current session type if market is open, null if closed - `"pre_market"` - `"regular"` - `"after_hours"` - `timezone: string` IANA timezone identifier for the market - `today_sessions: TradingSessions` Trading session schedules for the requested date with time_until fields ### Market Hours Detail List - `MarketHoursDetailList = Array` - `current_time: string` Current time in market timezone with offset - `date: string` The date for which market hours are provided - `market: MarketType` Market type identifier - `"us_equities"` - `"us_options"` - `market_name: string` Human-readable market name - `next_sessions: TradingSessions` Next trading day's session schedules (without time_until fields) - `after_hours?: SessionSchedule | null` After-hours session schedule, null if not available - `close: string` Session close timestamp with timezone offset - `open: string` Session open timestamp with timezone offset - `time_until_close?: string | null` ISO 8601 duration until session closes. Null if session is not currently open. - `time_until_open?: string | null` ISO 8601 duration until session opens. Null if session has already started or closed. - `pre_market?: SessionSchedule | null` Pre-market session schedule, null if not available - `regular?: SessionSchedule | null` Regular trading session schedule, null if holiday/weekend - `status: MarketStatus` Market status information - `day_type: DayType` The type of trading day - `"TRADING_DAY"` - `"EARLY_CLOSE"` - `"HOLIDAY"` - `"WEEKEND"` - `is_open: boolean` Whether the market is currently open (real-time) - `current_session?: MarketSessionType | null` Current session type if market is open, null if closed - `"pre_market"` - `"regular"` - `"after_hours"` - `timezone: string` IANA timezone identifier for the market - `today_sessions: TradingSessions` Trading session schedules for the requested date with time_until fields ### Market Session Type - `MarketSessionType = "pre_market" | "regular" | "after_hours"` Session type for market hours - `"pre_market"` - `"regular"` - `"after_hours"` ### Market Status - `MarketStatus` Market status information - `day_type: DayType` The type of trading day - `"TRADING_DAY"` - `"EARLY_CLOSE"` - `"HOLIDAY"` - `"WEEKEND"` - `is_open: boolean` Whether the market is currently open (real-time) - `current_session?: MarketSessionType | null` Current session type if market is open, null if closed - `"pre_market"` - `"regular"` - `"after_hours"` ### Market Type - `MarketType = "us_equities" | "us_options"` Market type for market hours calendar endpoint - `"us_equities"` - `"us_options"` ### Session Schedule - `SessionSchedule` Session schedule with open and close timestamps - `close: string` Session close timestamp with timezone offset - `open: string` Session open timestamp with timezone offset - `time_until_close?: string | null` ISO 8601 duration until session closes. Null if session is not currently open. - `time_until_open?: string | null` ISO 8601 duration until session opens. Null if session has already started or closed. ### Trading Sessions - `TradingSessions` Trading sessions for a market day with full timestamps - `after_hours?: SessionSchedule | null` After-hours session schedule, null if not available - `close: string` Session close timestamp with timezone offset - `open: string` Session open timestamp with timezone offset - `time_until_close?: string | null` ISO 8601 duration until session closes. Null if session is not currently open. - `time_until_open?: string | null` ISO 8601 duration until session opens. Null if session has already started or closed. - `pre_market?: SessionSchedule | null` Pre-market session schedule, null if not available - `regular?: SessionSchedule | null` Regular trading session schedule, null if holiday/weekend ### Calendar Get Clock Response - `CalendarGetClockResponse extends BaseResponse` - `data: ClockDetail` Current server time and market clock information - `clock: string` Current server time in UTC ### Calendar Get Market Hours Calendar Response - `CalendarGetMarketHoursCalendarResponse extends BaseResponse` - `data: MarketHoursDetailList` - `current_time: string` Current time in market timezone with offset - `date: string` The date for which market hours are provided - `market: MarketType` Market type identifier - `"us_equities"` - `"us_options"` - `market_name: string` Human-readable market name - `next_sessions: TradingSessions` Next trading day's session schedules (without time_until fields) - `after_hours?: SessionSchedule | null` After-hours session schedule, null if not available - `close: string` Session close timestamp with timezone offset - `open: string` Session open timestamp with timezone offset - `time_until_close?: string | null` ISO 8601 duration until session closes. Null if session is not currently open. - `time_until_open?: string | null` ISO 8601 duration until session opens. Null if session has already started or closed. - `pre_market?: SessionSchedule | null` Pre-market session schedule, null if not available - `regular?: SessionSchedule | null` Regular trading session schedule, null if holiday/weekend - `status: MarketStatus` Market status information - `day_type: DayType` The type of trading day - `"TRADING_DAY"` - `"EARLY_CLOSE"` - `"HOLIDAY"` - `"WEEKEND"` - `is_open: boolean` Whether the market is currently open (real-time) - `current_session?: MarketSessionType | null` Current session type if market is open, null if closed - `"pre_market"` - `"regular"` - `"after_hours"` - `timezone: string` IANA timezone identifier for the market - `today_sessions: TradingSessions` Trading session schedules for the requested date with time_until fields # Instrument Data ## Get All Instrument Events `client.v1.instrumentData.getAllInstrumentEvents(InstrumentDataGetAllInstrumentEventsParamsquery?, RequestOptionsoptions?): InstrumentDataGetAllInstrumentEventsResponse` **get** `/v1/instruments/events` List instrument events across all securities. Retrieves all instrument events grouped by date. ### Parameters - `query: InstrumentDataGetAllInstrumentEventsParams` - `event_types?: Array` Filter by event type(s). Comma-delimited list. Example: `event_types=EARNINGS,IPO`. - `"EARNINGS"` - `"DIVIDEND"` - `"STOCK_SPLIT"` - `"IPO"` - `from_date?: string` The start date for the query range, inclusive (YYYY-MM-DD). - `instrument_ids?: Array` Filter by OEMS instrument ID(s). Comma-delimited list of UUIDs. Example: `instrument_ids=550e8400-e29b-41d4-a716-446655440000`. - `to_date?: string` The end date for the query range, inclusive (YYYY-MM-DD). ### Returns - `InstrumentDataGetAllInstrumentEventsResponse extends BaseResponse` - `data: InstrumentAllEventsData` All-events payload grouped by date. - `event_dates: Array` Events grouped by date in descending order. - `date: string` Event date. - `events: Array` Flat event envelopes for this date. - `symbol: string` Symbol associated with the event. - `type: AllEventsEventType` Event type discriminator. - `"EARNINGS"` - `"DIVIDEND"` - `"STOCK_SPLIT"` - `"IPO"` - `dividend_event_data?: InstrumentDividendEvent | null` Dividend payload when type is DIVIDEND. - `adjusted_dividend_amount: string` The adjusted dividend amount accounting for any splits. - `ex_date: string` The day the stock starts trading without the right to receive that dividend. - `declaration_date?: string | null` The declaration date of the dividend - `dividend_amount?: string | null` The dividend amount per share. - `dividend_yield?: string | null` The dividend yield as a percentage of the stock price. - `frequency?: string | null` The frequency of the dividend payments (e.g., "Quarterly", "Annual"). - `payment_date?: string | null` The payment date is the date on which a declared stock dividend is scheduled to be paid. - `record_date?: string | null` The record date, set by a company's board of directors, is when a company compiles a list of shareholders of the stock for which it has declared a dividend. - `earnings_event_data?: InstrumentEarnings | null` Earnings payload when type is EARNINGS. - `date: string` The date when the earnings report was published - `eps_actual?: string | null` The actual earnings per share (EPS) for the period - `eps_estimate?: string | null` The estimated earnings per share (EPS) for the period - `eps_surprise_percent?: string | null` The percentage difference between actual and estimated EPS - `revenue_actual?: string | null` The actual total revenue for the period - `revenue_estimate?: string | null` The estimated total revenue for the period - `revenue_surprise_percent?: string | null` The percentage difference between actual and estimated revenue - `instrument_id?: string | null` OEMS instrument identifier, when the instrument is found in the instrument cache. - `ipo_event_data?: InstrumentEventIpoItem | null` IPO payload when type is IPO. - `actions?: string | null` IPO action. - `announced_at?: string | null` IPO announced timestamp. - `company?: string | null` IPO company name. - `exchange?: string | null` IPO exchange. - `market_cap?: string | null` IPO market cap. - `price_range?: string | null` IPO price range. - `shares?: string | null` IPO shares offered. - `name?: string | null` Instrument name associated with the event, when available. - `reporting_currency?: string | null` The currency used for reporting financial data. - `stock_split_event_data?: InstrumentSplitEvent | null` Stock split payload when type is STOCK_SPLIT. - `date: string` The date of the stock split - `denominator: string` The denominator of the split ratio - `numerator: string` The numerator of the split ratio - `split_type: string` The type of stock split (e.g., "stock-split", "stock-dividend", "bonus-issue") ### Example ```typescript import ClearStreet from '@clear-street-internal/sdk'; const client = new ClearStreet({ apiKey: 'My API Key', }); const response = await client.v1.instrumentData.getAllInstrumentEvents(); console.log(response); ``` #### Response ```json { "data": { "event_dates": [ { "date": "2026-04-23", "events": [ { "dividend_event_data": { "adjusted_dividend_amount": "0.5236", "declaration_date": "2026-04-22", "dividend_amount": "0.5236", "dividend_yield": "43.82881469863321", "ex_date": "2026-04-23", "frequency": "Weekly", "payment_date": "2026-04-24", "record_date": "2026-04-23" }, "instrument_id": "2281b543-7136-4008-aa0a-a402bf9d9f90", "name": "YieldMax ABNB Option Income Strategy ETF", "reporting_currency": "USD", "symbol": "ABNY", "type": "DIVIDEND" }, { "dividend_event_data": { "adjusted_dividend_amount": "0.1432", "declaration_date": "2026-04-22", "dividend_amount": "0.1432", "dividend_yield": "181.7918287937743", "ex_date": "2026-04-23", "frequency": "Weekly", "payment_date": "2026-04-24", "record_date": "2026-04-23" }, "instrument_id": "4b33fa52-8ab6-43f5-a8df-042e0c63d20e", "name": "YieldMax AI Option Income Strategy ETF", "reporting_currency": "USD", "symbol": "AIYY", "type": "DIVIDEND" } ] } ] }, "metadata": { "request_id": "5efbf08a-9067-4491-9f29-cf0b233507ef" } } ``` ## Get Instrument Events `client.v1.instrumentData.getInstrumentEvents(InstrumentIDOrSymbolinstrumentID, InstrumentDataGetInstrumentEventsParamsquery?, RequestOptionsoptions?): InstrumentDataGetInstrumentEventsResponse` **get** `/v1/instruments/{instrument_id}/events` Retrieves corporate events (dividends, splits, etc.) for an instrument, grouped by event type. Date range defaults: - `from_date`: today - 365 days - `to_date`: today + 60 days ### Parameters - `instrument_id: InstrumentIDOrSymbol` OEMS instrument UUID - `query: InstrumentDataGetInstrumentEventsParams` - `from_date?: string` The start date for the query range, inclusive (YYYY-MM-DD). - `to_date?: string` The end date for the query range, inclusive (YYYY-MM-DD). ### Returns - `InstrumentDataGetInstrumentEventsResponse extends BaseResponse` - `data: InstrumentEventsData` Grouped instrument events by type - `dividends: Array` Dividend distribution events - `adjusted_dividend_amount: string` The adjusted dividend amount accounting for any splits. - `ex_date: string` The day the stock starts trading without the right to receive that dividend. - `declaration_date?: string | null` The declaration date of the dividend - `dividend_amount?: string | null` The dividend amount per share. - `dividend_yield?: string | null` The dividend yield as a percentage of the stock price. - `frequency?: string | null` The frequency of the dividend payments (e.g., "Quarterly", "Annual"). - `payment_date?: string | null` The payment date is the date on which a declared stock dividend is scheduled to be paid. - `record_date?: string | null` The record date, set by a company's board of directors, is when a company compiles a list of shareholders of the stock for which it has declared a dividend. - `earnings: Array` Earnings announcement events - `date: string` The date when the earnings report was published - `eps_actual?: string | null` The actual earnings per share (EPS) for the period - `eps_estimate?: string | null` The estimated earnings per share (EPS) for the period - `eps_surprise_percent?: string | null` The percentage difference between actual and estimated EPS - `revenue_actual?: string | null` The actual total revenue for the period - `revenue_estimate?: string | null` The estimated total revenue for the period - `revenue_surprise_percent?: string | null` The percentage difference between actual and estimated revenue - `instrument_id: string` OEMS instrument UUID from the request - `splits: Array` Stock split events - `date: string` The date of the stock split - `denominator: string` The denominator of the split ratio - `numerator: string` The numerator of the split ratio - `split_type: string` The type of stock split (e.g., "stock-split", "stock-dividend", "bonus-issue") - `reporting_currency?: string | null` The currency used for reporting financial data ### Example ```typescript import ClearStreet from '@clear-street-internal/sdk'; const client = new ClearStreet({ apiKey: 'My API Key', }); const response = await client.v1.instrumentData.getInstrumentEvents( '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', ); console.log(response); ``` #### Response ```json { "data": { "dividends": [ { "adjusted_dividend_amount": "0.25", "declaration_date": "2024-10-31", "dividend_amount": "0.25", "dividend_yield": "0.44", "ex_date": "2024-11-08", "frequency": "Quarterly", "payment_date": "2024-11-14", "record_date": "2024-11-11" } ], "earnings": [ { "date": "2024-10-31", "eps_actual": "1.64", "eps_estimate": "1.60", "eps_surprise_percent": "2.5", "revenue_actual": "94930000000", "revenue_estimate": "94500000000", "revenue_surprise_percent": "0.45" } ], "instrument_id": "a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8", "reporting_currency": "USD", "splits": [ { "date": "2020-08-31", "denominator": "1", "numerator": "4", "split_type": "stock-split" } ] }, "error": null, "metadata": { "request_id": "0f1a2b3c-4d5e-6789-8a7b-6c5d4e3f2a1b" } } ``` ## Get Instrument Fundamentals `client.v1.instrumentData.getInstrumentFundamentals(InstrumentIDOrSymbolinstrumentID, RequestOptionsoptions?): InstrumentDataGetInstrumentFundamentalsResponse` **get** `/v1/instruments/{instrument_id}/fundamentals` Retrieves supplemental fundamentals and company profile data for an instrument. ### Parameters - `instrument_id: InstrumentIDOrSymbol` OEMS instrument UUID ### Returns - `InstrumentDataGetInstrumentFundamentalsResponse extends BaseResponse` - `data: InstrumentFundamentals` Supplemental fundamentals and company profile data for an instrument. - `average_volume?: number | null` The average daily trading volume over the past 30 days - `beta?: string | null` The beta value, measuring the instrument's volatility relative to the overall market - `description?: string | null` A detailed description of the instrument or company - `dividend_yield?: string | null` The trailing twelve months (TTM) dividend yield - `earnings_per_share?: string | null` The trailing twelve months (TTM) earnings per share - `fifty_two_week_high?: string | null` The highest price over the last 52 weeks - `fifty_two_week_low?: string | null` The lowest price over the last 52 weeks - `industry?: string | null` The specific industry of the instrument's issuer - `list_date?: string | null` The date the instrument was first listed - `logo_url?: string | null` URL to a representative logo image for the instrument or issuer - `market_cap?: string | null` The total market capitalization - `previous_close?: string | null` The closing price from the previous trading day - `price_to_earnings?: string | null` The price-to-earnings (P/E) ratio for the trailing twelve months (TTM) - `reporting_currency?: string | null` The currency used for reporting financial data - `sector?: string | null` The business sector of the instrument's issuer ### Example ```typescript import ClearStreet from '@clear-street-internal/sdk'; const client = new ClearStreet({ apiKey: 'My API Key', }); const response = await client.v1.instrumentData.getInstrumentFundamentals( '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', ); console.log(response); ``` #### Response ```json { "data": { "average_volume": 76000000, "beta": "1.20", "description": "Apple Inc. designs, manufactures, and markets smartphones, personal computers, tablets, wearables, and accessories worldwide.", "dividend_yield": "0.005", "earnings_per_share": "5.61", "fifty_two_week_high": "230.00", "fifty_two_week_low": "165.00", "industry": "Consumer Electronics", "list_date": "1980-12-12", "logo_url": "https://example.com/logos/aapl.png", "market_cap": "2800000000000", "previous_close": "210.87", "price_to_earnings": "30.5", "reporting_currency": "USD", "sector": "Technology" }, "error": null, "metadata": { "request_id": "5b6c7d8e-9f0a-1b2c-3d4e-5f6a7b8c9d0e" } } ``` ## Get Instrument Balance Sheet Statements `client.v1.instrumentData.getInstrumentBalanceSheetStatements(InstrumentIDOrSymbolinstrumentID, InstrumentDataGetInstrumentBalanceSheetStatementsParamsquery?, RequestOptionsoptions?): InstrumentDataGetInstrumentBalanceSheetStatementsResponse` **get** `/v1/instruments/{instrument_id}/balance-sheets` Get balance sheet statements for an instrument. Retrieves quarterly balance sheet statements for a specific instrument, sorted by fiscal period (most recent first). Date range defaults: - `from_date`: None (no lower bound) - `to_date`: None (no upper bound) ### Parameters - `instrument_id: InstrumentIDOrSymbol` OEMS instrument UUID - `query: InstrumentDataGetInstrumentBalanceSheetStatementsParams` - `from_date?: string` The start date for the query range, inclusive (YYYY-MM-DD). - `page_size?: number` The number of items to return per page. Only used when page_token is not provided. - `page_token?: string` Token for retrieving the next or previous page of results. Contains encoded pagination state; when provided, page_size is ignored. - `to_date?: string` The end date for the query range, inclusive (YYYY-MM-DD). ### Returns - `InstrumentDataGetInstrumentBalanceSheetStatementsResponse extends BaseResponse` - `data: InstrumentBalanceSheetStatementList` - `accepted_date: string` The date and time when the filing was accepted by the SEC - `filing_date: string` The date the financial statement was filed - `period: string` The fiscal period identifier (e.g., "Q1", "Q2", "Q3", "Q4") - `period_type: FiscalPeriodType` The type of fiscal period - `"QUARTERLY"` - `"ANNUAL"` - `"TTM"` - `"BIANNUAL"` - `reported_currency: string` The currency in which the statement is reported (ISO 4217) - `year: number` The fiscal year of the statement - `account_payables?: string | null` Account payables - `accounts_receivables?: string | null` Accounts receivables - `accrued_expenses?: string | null` Accrued expenses - `accumulated_other_comprehensive_income_loss?: string | null` Accumulated other comprehensive income/loss - `additional_paid_in_capital?: string | null` Additional paid-in capital - `capital_lease_obligations?: string | null` Capital lease obligations (total) - `capital_lease_obligations_current?: string | null` Capital lease obligations (current portion) - `cash_and_cash_equivalents?: string | null` Cash and cash equivalents - `cash_and_short_term_investments?: string | null` Cash and short-term investments combined - `common_stock?: string | null` Common stock - `deferred_revenue?: string | null` Deferred revenue - `deferred_revenue_non_current?: string | null` Deferred revenue (non-current) - `deferred_tax_liabilities_non_current?: string | null` Deferred tax liabilities (non-current) - `goodwill?: string | null` Goodwill - `goodwill_and_intangible_assets?: string | null` Goodwill and intangible assets combined - `intangible_assets?: string | null` Intangible assets - `inventory?: string | null` Inventory - `long_term_debt?: string | null` Long-term debt - `long_term_investments?: string | null` Long-term investments - `minority_interest?: string | null` Minority interest - `net_debt?: string | null` Net debt (total debt minus cash) - `net_receivables?: string | null` Net receivables - `other_assets?: string | null` Other assets - `other_current_assets?: string | null` Other current assets - `other_current_liabilities?: string | null` Other current liabilities - `other_liabilities?: string | null` Other liabilities - `other_non_current_assets?: string | null` Other non-current assets - `other_non_current_liabilities?: string | null` Other non-current liabilities - `other_payables?: string | null` Other payables - `other_receivables?: string | null` Other receivables - `other_total_stockholders_equity?: string | null` Other total stockholders equity - `preferred_stock?: string | null` Preferred stock - `prepaids?: string | null` Prepaids - `property_plant_and_equipment_net?: string | null` Property, plant and equipment net of depreciation - `retained_earnings?: string | null` Retained earnings - `short_term_debt?: string | null` Short-term debt - `short_term_investments?: string | null` Short-term investments - `tax_assets?: string | null` Tax assets - `tax_payables?: string | null` Tax payables - `total_assets?: string | null` Total assets - `total_current_assets?: string | null` Total current assets - `total_current_liabilities?: string | null` Total current liabilities - `total_debt?: string | null` Total debt - `total_equity?: string | null` Total equity - `total_investments?: string | null` Total investments - `total_liabilities?: string | null` Total liabilities - `total_liabilities_and_total_equity?: string | null` Total liabilities and total equity - `total_non_current_assets?: string | null` Total non-current assets - `total_non_current_liabilities?: string | null` Total non-current liabilities - `total_payables?: string | null` Total payables - `total_stockholders_equity?: string | null` Total stockholders equity - `treasury_stock?: string | null` Treasury stock ### Example ```typescript import ClearStreet from '@clear-street-internal/sdk'; const client = new ClearStreet({ apiKey: 'My API Key', }); const response = await client.v1.instrumentData.getInstrumentBalanceSheetStatements( '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', ); console.log(response); ``` #### Response ```json { "data": [ { "accepted_date": "2025-05-02T14:30:00Z", "cash_and_cash_equivalents": "29943000000", "filing_date": "2025-05-01", "net_debt": "76323000000", "period": "Q1", "period_type": "QUARTERLY", "reported_currency": "USD", "total_assets": "352583000000", "total_debt": "106266000000", "total_liabilities": "308258000000", "total_stockholders_equity": "56727000000", "year": 2025 } ], "error": null, "metadata": { "next_page_token": "AAAAAAAAAGQAAAAAAAAAZQ==", "page_number": 1, "request_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "total_items": 20, "total_pages": 2 } } ``` ## Get Instrument Income Statements `client.v1.instrumentData.getInstrumentIncomeStatements(InstrumentIDOrSymbolinstrumentID, InstrumentDataGetInstrumentIncomeStatementsParamsquery?, RequestOptionsoptions?): InstrumentDataGetInstrumentIncomeStatementsResponse` **get** `/v1/instruments/{instrument_id}/income-statements` Retrieves quarterly income statements for a specific instrument, sorted by fiscal period (most recent first). Date range defaults: - `from_date`: None (no lower bound) - `to_date`: None (no upper bound) ### Parameters - `instrument_id: InstrumentIDOrSymbol` OEMS instrument UUID - `query: InstrumentDataGetInstrumentIncomeStatementsParams` - `from_date?: string` The start date for the query range, inclusive (YYYY-MM-DD). - `page_size?: number` The number of items to return per page. Only used when page_token is not provided. - `page_token?: string` Token for retrieving the next or previous page of results. Contains encoded pagination state; when provided, page_size is ignored. - `to_date?: string` The end date for the query range, inclusive (YYYY-MM-DD). ### Returns - `InstrumentDataGetInstrumentIncomeStatementsResponse extends BaseResponse` - `data: InstrumentIncomeStatementList` - `accepted_date: string` The date and time when the filing was accepted by the SEC - `filing_date: string` The date the financial statement was filed - `period: string` The fiscal period identifier (e.g., "Q1", "Q2", "Q3", "Q4") - `period_type: FiscalPeriodType` The type of fiscal period - `"QUARTERLY"` - `"ANNUAL"` - `"TTM"` - `"BIANNUAL"` - `reported_currency: string` The currency in which the statement is reported (ISO 4217) - `year: number` The fiscal year of the statement - `bottom_line_net_income?: string | null` Bottom line net income after all adjustments - `cost_and_expenses?: string | null` Total costs and expenses - `cost_of_revenue?: string | null` Direct costs attributable to producing goods sold - `depreciation_and_amortization?: string | null` Depreciation and amortization expenses - `ebit?: string | null` Earnings before interest and taxes - `ebitda?: string | null` Earnings before interest, taxes, depreciation, and amortization - `eps?: string | null` Basic earnings per share - `eps_diluted?: string | null` Diluted earnings per share - `general_and_administrative_expenses?: string | null` General administrative overhead expenses - `gross_profit?: string | null` Revenue minus cost of revenue - `income_before_tax?: string | null` Income before income tax expense - `income_tax_expense?: string | null` Income tax expense for the period - `interest_expense?: string | null` Interest paid on debt - `interest_income?: string | null` Interest earned on investments and cash - `net_income?: string | null` Total net income for the period - `net_income_deductions?: string | null` Deductions from net income - `net_income_from_continuing_operations?: string | null` Net income from continuing operations - `net_income_from_discontinued_operations?: string | null` Net income from discontinued operations - `net_interest_income?: string | null` Net interest income (interest income minus interest expense) - `non_operating_income_excluding_interest?: string | null` Non-operating income excluding interest - `operating_expenses?: string | null` Total operating expenses - `operating_income?: string | null` Income from core business operations - `other_adjustments_to_net_income?: string | null` Other adjustments to net income - `other_expenses?: string | null` Other miscellaneous expenses - `research_and_development_expenses?: string | null` Expenditure on research and development activities - `revenue?: string | null` Total revenue from sales of goods and services - `selling_and_marketing_expenses?: string | null` Expenditure on marketing and sales activities - `selling_general_and_administrative_expenses?: string | null` Combined selling, general, and administrative expenses - `total_other_income_expenses_net?: string | null` Net of other income and expenses - `weighted_average_shs_out?: string | null` Weighted average shares outstanding (basic) - `weighted_average_shs_out_dil?: string | null` Weighted average shares outstanding (diluted) ### Example ```typescript import ClearStreet from '@clear-street-internal/sdk'; const client = new ClearStreet({ apiKey: 'My API Key', }); const response = await client.v1.instrumentData.getInstrumentIncomeStatements( '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', ); console.log(response); ``` #### Response ```json { "data": [ { "accepted_date": "2025-05-02T14:30:00Z", "cost_of_revenue": "52080000000", "eps": "1.40", "eps_diluted": "1.38", "filing_date": "2025-05-01", "gross_profit": "42850000000", "net_income": "22200000000", "operating_income": "26550000000", "period": "Q1", "period_type": "QUARTERLY", "reported_currency": "USD", "revenue": "94930000000", "year": 2025 } ], "error": null, "metadata": { "next_page_token": "AAAAAAAAAGQAAAAAAAAAZQ==", "page_number": 1, "request_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "total_items": 20, "total_pages": 2 } } ``` ## Get Instrument Analyst Consensus `client.v1.instrumentData.getInstrumentAnalystConsensus(InstrumentIDOrSymbolinstrumentID, InstrumentDataGetInstrumentAnalystConsensusParamsquery?, RequestOptionsoptions?): InstrumentDataGetInstrumentAnalystConsensusResponse` **get** `/v1/instruments/{instrument_id}/analyst-reporting` Retrieves analyst ratings and price targets for an instrument. ### Parameters - `instrument_id: InstrumentIDOrSymbol` OEMS instrument UUID - `query: InstrumentDataGetInstrumentAnalystConsensusParams` - `from?: string` The start date for the query range, inclusive (YYYY-MM-DD) - `to?: string` The end date for the query range, inclusive (YYYY-MM-DD) ### Returns - `InstrumentDataGetInstrumentAnalystConsensusResponse extends BaseResponse` - `data: InstrumentAnalystConsensus` Aggregated analyst consensus metrics - `date: string` The date the consensus snapshot was generated - `distribution?: AnalystDistribution | null` Count of individual analyst recommendations by category - `buy: number` Number of buy recommendations - `hold: number` Number of hold recommendations - `sell: number` Number of sell recommendations - `strong_buy: number` Number of strong buy recommendations - `strong_sell: number` Number of strong sell recommendations - `price_target?: PriceTarget | null` Aggregated analyst price target statistics - `average: string` Average analyst price target - `currency: string` ISO 4217 currency code of the price targets - `high: string` Highest analyst price target - `low: string` Lowest analyst price target - `rating?: AnalystRating | null` Consensus analyst rating - `"STRONG_BUY"` - `"BUY"` - `"HOLD"` - `"SELL"` - `"STRONG_SELL"` ### Example ```typescript import ClearStreet from '@clear-street-internal/sdk'; const client = new ClearStreet({ apiKey: 'My API Key', }); const response = await client.v1.instrumentData.getInstrumentAnalystConsensus( '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', ); console.log(response); ``` #### Response ```json { "data": { "date": "2025-10-01", "distribution": { "buy": 20, "hold": 3, "sell": 1, "strong_buy": 18, "strong_sell": 0 }, "price_target": { "average": "240.00", "currency": "USD", "high": "275.00", "low": "190.00" }, "rating": "BUY" }, "error": null, "metadata": { "request_id": "9e0f1a2b-3c4d-5e6f-7890-1a2b3c4d5e6f" } } ``` ## Get Instrument Cash Flow Statements `client.v1.instrumentData.getInstrumentCashFlowStatements(InstrumentIDOrSymbolinstrumentID, InstrumentDataGetInstrumentCashFlowStatementsParamsquery?, RequestOptionsoptions?): InstrumentDataGetInstrumentCashFlowStatementsResponse` **get** `/v1/instruments/{instrument_id}/cash-flow-statements` Get cash flow statements for an instrument. Retrieves historical cash flow statements for the specified instrument. Cash flow statements show cash inflows and outflows from operating, investing, and financing activities. ### Parameters - `instrument_id: InstrumentIDOrSymbol` OEMS instrument UUID - `query: InstrumentDataGetInstrumentCashFlowStatementsParams` - `from_date?: string` The start date for the query range, inclusive (YYYY-MM-DD). - `page_size?: number` The number of items to return per page. Only used when page_token is not provided. - `page_token?: string` Token for retrieving the next or previous page of results. Contains encoded pagination state; when provided, page_size is ignored. - `to_date?: string` The end date for the query range, inclusive (YYYY-MM-DD). ### Returns - `InstrumentDataGetInstrumentCashFlowStatementsResponse extends BaseResponse` - `data: InstrumentCashFlowStatementList` - `accepted_date: string` The date and time when the filing was accepted by the SEC - `filing_date: string` The date the financial statement was filed - `period: string` The fiscal period identifier (e.g., "Q1", "Q2", "Q3", "Q4") - `period_type: FiscalPeriodType` The type of fiscal period - `"QUARTERLY"` - `"ANNUAL"` - `"TTM"` - `"BIANNUAL"` - `reported_currency: string` The currency in which the statement is reported (ISO 4217) - `year: number` The fiscal year of the statement - `accounts_payables?: string | null` Change in accounts payables - `accounts_receivables?: string | null` Change in accounts receivables - `acquisitions_net?: string | null` Net acquisitions - `capital_expenditure?: string | null` Capital expenditure - `cash_at_beginning_of_period?: string | null` Cash and cash equivalents at beginning of period - `cash_at_end_of_period?: string | null` Cash and cash equivalents at end of period - `change_in_working_capital?: string | null` Change in working capital - `common_dividends_paid?: string | null` Common dividends paid - `common_stock_issuance?: string | null` Common stock issuance - `common_stock_repurchased?: string | null` Common stock repurchased (buybacks) - `deferred_income_tax?: string | null` Deferred income tax expense - `depreciation_and_amortization?: string | null` Depreciation and amortization expense - `effect_of_forex_changes_on_cash?: string | null` Effect of foreign exchange changes on cash - `free_cash_flow?: string | null` Free cash flow (operating cash flow minus capital expenditure) - `income_taxes_paid?: string | null` Income taxes paid - `interest_paid?: string | null` Interest paid - `inventory?: string | null` Change in inventory - `investments_in_property_plant_and_equipment?: string | null` Investments in property, plant, and equipment - `long_term_net_debt_issuance?: string | null` Long-term net debt issuance - `net_cash_provided_by_financing_activities?: string | null` Net cash provided by financing activities - `net_cash_provided_by_investing_activities?: string | null` Net cash provided by investing activities - `net_cash_provided_by_operating_activities?: string | null` Net cash provided by operating activities - `net_change_in_cash?: string | null` Net change in cash during the period - `net_common_stock_issuance?: string | null` Net common stock issuance - `net_debt_issuance?: string | null` Net debt issuance (long-term + short-term) - `net_dividends_paid?: string | null` Net dividends paid (common + preferred) - `net_income?: string | null` Net income for the period - `net_preferred_stock_issuance?: string | null` Net preferred stock issuance - `net_stock_issuance?: string | null` Net stock issuance (common + preferred) - `operating_cash_flow?: string | null` Operating cash flow (alternative calculation) - `other_financing_activities?: string | null` Other financing activities - `other_investing_activities?: string | null` Other investing activities - `other_non_cash_items?: string | null` Other non-cash items - `other_working_capital?: string | null` Change in other working capital - `preferred_dividends_paid?: string | null` Preferred dividends paid - `purchases_of_investments?: string | null` Purchases of investments - `sales_maturities_of_investments?: string | null` Sales and maturities of investments - `short_term_net_debt_issuance?: string | null` Short-term net debt issuance - `stock_based_compensation?: string | null` Stock-based compensation expense ### Example ```typescript import ClearStreet from '@clear-street-internal/sdk'; const client = new ClearStreet({ apiKey: 'My API Key', }); const response = await client.v1.instrumentData.getInstrumentCashFlowStatements( '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', ); console.log(response); ``` #### Response ```json { "data": [ { "accepted_date": "2025-05-02T14:30:00Z", "capital_expenditure": "-2600000000", "cash_at_beginning_of_period": "33743000000", "cash_at_end_of_period": "29943000000", "change_in_working_capital": "-3200000000", "common_stock_repurchased": "-23000000000", "depreciation_and_amortization": "2900000000", "filing_date": "2025-05-01", "free_cash_flow": "25800000000", "investments_in_property_plant_and_equipment": "-2600000000", "net_cash_provided_by_financing_activities": "-28300000000", "net_cash_provided_by_investing_activities": "-3900000000", "net_cash_provided_by_operating_activities": "28400000000", "net_change_in_cash": "-3800000000", "net_debt_issuance": "-1500000000", "net_dividends_paid": "-3800000000", "net_income": "22200000000", "operating_cash_flow": "28400000000", "period": "Q1", "period_type": "QUARTERLY", "purchases_of_investments": "-9500000000", "reported_currency": "USD", "sales_maturities_of_investments": "8200000000", "stock_based_compensation": "2500000000", "year": 2025 } ], "error": null, "metadata": { "next_page_token": "AAAAAAAAAGQAAAAAAAAAZQ==", "page_number": 1, "request_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "total_items": 20, "total_pages": 2 } } ``` ## Domain Types ### All Events Event Type - `AllEventsEventType = "EARNINGS" | "DIVIDEND" | "STOCK_SPLIT" | "IPO"` Event types supported by the all-events endpoint. - `"EARNINGS"` - `"DIVIDEND"` - `"STOCK_SPLIT"` - `"IPO"` ### Analyst Distribution - `AnalystDistribution` Analyst recommendation distribution - `buy: number` Number of buy recommendations - `hold: number` Number of hold recommendations - `sell: number` Number of sell recommendations - `strong_buy: number` Number of strong buy recommendations - `strong_sell: number` Number of strong sell recommendations ### Analyst Rating - `AnalystRating = "STRONG_BUY" | "BUY" | "HOLD" | 2 more` Analyst rating category - `"STRONG_BUY"` - `"BUY"` - `"HOLD"` - `"SELL"` - `"STRONG_SELL"` ### Fiscal Period Type - `FiscalPeriodType = "QUARTERLY" | "ANNUAL" | "TTM" | "BIANNUAL"` Fiscal period type for earnings reports - `"QUARTERLY"` - `"ANNUAL"` - `"TTM"` - `"BIANNUAL"` ### Instrument All Events Data - `InstrumentAllEventsData` All-events payload grouped by date. - `event_dates: Array` Events grouped by date in descending order. - `date: string` Event date. - `events: Array` Flat event envelopes for this date. - `symbol: string` Symbol associated with the event. - `type: AllEventsEventType` Event type discriminator. - `"EARNINGS"` - `"DIVIDEND"` - `"STOCK_SPLIT"` - `"IPO"` - `dividend_event_data?: InstrumentDividendEvent | null` Dividend payload when type is DIVIDEND. - `adjusted_dividend_amount: string` The adjusted dividend amount accounting for any splits. - `ex_date: string` The day the stock starts trading without the right to receive that dividend. - `declaration_date?: string | null` The declaration date of the dividend - `dividend_amount?: string | null` The dividend amount per share. - `dividend_yield?: string | null` The dividend yield as a percentage of the stock price. - `frequency?: string | null` The frequency of the dividend payments (e.g., "Quarterly", "Annual"). - `payment_date?: string | null` The payment date is the date on which a declared stock dividend is scheduled to be paid. - `record_date?: string | null` The record date, set by a company's board of directors, is when a company compiles a list of shareholders of the stock for which it has declared a dividend. - `earnings_event_data?: InstrumentEarnings | null` Earnings payload when type is EARNINGS. - `date: string` The date when the earnings report was published - `eps_actual?: string | null` The actual earnings per share (EPS) for the period - `eps_estimate?: string | null` The estimated earnings per share (EPS) for the period - `eps_surprise_percent?: string | null` The percentage difference between actual and estimated EPS - `revenue_actual?: string | null` The actual total revenue for the period - `revenue_estimate?: string | null` The estimated total revenue for the period - `revenue_surprise_percent?: string | null` The percentage difference between actual and estimated revenue - `instrument_id?: string | null` OEMS instrument identifier, when the instrument is found in the instrument cache. - `ipo_event_data?: InstrumentEventIpoItem | null` IPO payload when type is IPO. - `actions?: string | null` IPO action. - `announced_at?: string | null` IPO announced timestamp. - `company?: string | null` IPO company name. - `exchange?: string | null` IPO exchange. - `market_cap?: string | null` IPO market cap. - `price_range?: string | null` IPO price range. - `shares?: string | null` IPO shares offered. - `name?: string | null` Instrument name associated with the event, when available. - `reporting_currency?: string | null` The currency used for reporting financial data. - `stock_split_event_data?: InstrumentSplitEvent | null` Stock split payload when type is STOCK_SPLIT. - `date: string` The date of the stock split - `denominator: string` The denominator of the split ratio - `numerator: string` The numerator of the split ratio - `split_type: string` The type of stock split (e.g., "stock-split", "stock-dividend", "bonus-issue") ### Instrument Analyst Consensus - `InstrumentAnalystConsensus` Aggregated analyst consensus metrics - `date: string` The date the consensus snapshot was generated - `distribution?: AnalystDistribution | null` Count of individual analyst recommendations by category - `buy: number` Number of buy recommendations - `hold: number` Number of hold recommendations - `sell: number` Number of sell recommendations - `strong_buy: number` Number of strong buy recommendations - `strong_sell: number` Number of strong sell recommendations - `price_target?: PriceTarget | null` Aggregated analyst price target statistics - `average: string` Average analyst price target - `currency: string` ISO 4217 currency code of the price targets - `high: string` Highest analyst price target - `low: string` Lowest analyst price target - `rating?: AnalystRating | null` Consensus analyst rating - `"STRONG_BUY"` - `"BUY"` - `"HOLD"` - `"SELL"` - `"STRONG_SELL"` ### Instrument Balance Sheet Statement - `InstrumentBalanceSheetStatement` A quarterly balance sheet statement for an instrument. - `accepted_date: string` The date and time when the filing was accepted by the SEC - `filing_date: string` The date the financial statement was filed - `period: string` The fiscal period identifier (e.g., "Q1", "Q2", "Q3", "Q4") - `period_type: FiscalPeriodType` The type of fiscal period - `"QUARTERLY"` - `"ANNUAL"` - `"TTM"` - `"BIANNUAL"` - `reported_currency: string` The currency in which the statement is reported (ISO 4217) - `year: number` The fiscal year of the statement - `account_payables?: string | null` Account payables - `accounts_receivables?: string | null` Accounts receivables - `accrued_expenses?: string | null` Accrued expenses - `accumulated_other_comprehensive_income_loss?: string | null` Accumulated other comprehensive income/loss - `additional_paid_in_capital?: string | null` Additional paid-in capital - `capital_lease_obligations?: string | null` Capital lease obligations (total) - `capital_lease_obligations_current?: string | null` Capital lease obligations (current portion) - `cash_and_cash_equivalents?: string | null` Cash and cash equivalents - `cash_and_short_term_investments?: string | null` Cash and short-term investments combined - `common_stock?: string | null` Common stock - `deferred_revenue?: string | null` Deferred revenue - `deferred_revenue_non_current?: string | null` Deferred revenue (non-current) - `deferred_tax_liabilities_non_current?: string | null` Deferred tax liabilities (non-current) - `goodwill?: string | null` Goodwill - `goodwill_and_intangible_assets?: string | null` Goodwill and intangible assets combined - `intangible_assets?: string | null` Intangible assets - `inventory?: string | null` Inventory - `long_term_debt?: string | null` Long-term debt - `long_term_investments?: string | null` Long-term investments - `minority_interest?: string | null` Minority interest - `net_debt?: string | null` Net debt (total debt minus cash) - `net_receivables?: string | null` Net receivables - `other_assets?: string | null` Other assets - `other_current_assets?: string | null` Other current assets - `other_current_liabilities?: string | null` Other current liabilities - `other_liabilities?: string | null` Other liabilities - `other_non_current_assets?: string | null` Other non-current assets - `other_non_current_liabilities?: string | null` Other non-current liabilities - `other_payables?: string | null` Other payables - `other_receivables?: string | null` Other receivables - `other_total_stockholders_equity?: string | null` Other total stockholders equity - `preferred_stock?: string | null` Preferred stock - `prepaids?: string | null` Prepaids - `property_plant_and_equipment_net?: string | null` Property, plant and equipment net of depreciation - `retained_earnings?: string | null` Retained earnings - `short_term_debt?: string | null` Short-term debt - `short_term_investments?: string | null` Short-term investments - `tax_assets?: string | null` Tax assets - `tax_payables?: string | null` Tax payables - `total_assets?: string | null` Total assets - `total_current_assets?: string | null` Total current assets - `total_current_liabilities?: string | null` Total current liabilities - `total_debt?: string | null` Total debt - `total_equity?: string | null` Total equity - `total_investments?: string | null` Total investments - `total_liabilities?: string | null` Total liabilities - `total_liabilities_and_total_equity?: string | null` Total liabilities and total equity - `total_non_current_assets?: string | null` Total non-current assets - `total_non_current_liabilities?: string | null` Total non-current liabilities - `total_payables?: string | null` Total payables - `total_stockholders_equity?: string | null` Total stockholders equity - `treasury_stock?: string | null` Treasury stock ### Instrument Balance Sheet Statement List - `InstrumentBalanceSheetStatementList = Array` - `accepted_date: string` The date and time when the filing was accepted by the SEC - `filing_date: string` The date the financial statement was filed - `period: string` The fiscal period identifier (e.g., "Q1", "Q2", "Q3", "Q4") - `period_type: FiscalPeriodType` The type of fiscal period - `"QUARTERLY"` - `"ANNUAL"` - `"TTM"` - `"BIANNUAL"` - `reported_currency: string` The currency in which the statement is reported (ISO 4217) - `year: number` The fiscal year of the statement - `account_payables?: string | null` Account payables - `accounts_receivables?: string | null` Accounts receivables - `accrued_expenses?: string | null` Accrued expenses - `accumulated_other_comprehensive_income_loss?: string | null` Accumulated other comprehensive income/loss - `additional_paid_in_capital?: string | null` Additional paid-in capital - `capital_lease_obligations?: string | null` Capital lease obligations (total) - `capital_lease_obligations_current?: string | null` Capital lease obligations (current portion) - `cash_and_cash_equivalents?: string | null` Cash and cash equivalents - `cash_and_short_term_investments?: string | null` Cash and short-term investments combined - `common_stock?: string | null` Common stock - `deferred_revenue?: string | null` Deferred revenue - `deferred_revenue_non_current?: string | null` Deferred revenue (non-current) - `deferred_tax_liabilities_non_current?: string | null` Deferred tax liabilities (non-current) - `goodwill?: string | null` Goodwill - `goodwill_and_intangible_assets?: string | null` Goodwill and intangible assets combined - `intangible_assets?: string | null` Intangible assets - `inventory?: string | null` Inventory - `long_term_debt?: string | null` Long-term debt - `long_term_investments?: string | null` Long-term investments - `minority_interest?: string | null` Minority interest - `net_debt?: string | null` Net debt (total debt minus cash) - `net_receivables?: string | null` Net receivables - `other_assets?: string | null` Other assets - `other_current_assets?: string | null` Other current assets - `other_current_liabilities?: string | null` Other current liabilities - `other_liabilities?: string | null` Other liabilities - `other_non_current_assets?: string | null` Other non-current assets - `other_non_current_liabilities?: string | null` Other non-current liabilities - `other_payables?: string | null` Other payables - `other_receivables?: string | null` Other receivables - `other_total_stockholders_equity?: string | null` Other total stockholders equity - `preferred_stock?: string | null` Preferred stock - `prepaids?: string | null` Prepaids - `property_plant_and_equipment_net?: string | null` Property, plant and equipment net of depreciation - `retained_earnings?: string | null` Retained earnings - `short_term_debt?: string | null` Short-term debt - `short_term_investments?: string | null` Short-term investments - `tax_assets?: string | null` Tax assets - `tax_payables?: string | null` Tax payables - `total_assets?: string | null` Total assets - `total_current_assets?: string | null` Total current assets - `total_current_liabilities?: string | null` Total current liabilities - `total_debt?: string | null` Total debt - `total_equity?: string | null` Total equity - `total_investments?: string | null` Total investments - `total_liabilities?: string | null` Total liabilities - `total_liabilities_and_total_equity?: string | null` Total liabilities and total equity - `total_non_current_assets?: string | null` Total non-current assets - `total_non_current_liabilities?: string | null` Total non-current liabilities - `total_payables?: string | null` Total payables - `total_stockholders_equity?: string | null` Total stockholders equity - `treasury_stock?: string | null` Treasury stock ### Instrument Cash Flow Statement - `InstrumentCashFlowStatement` A quarterly cash flow statement for an instrument. - `accepted_date: string` The date and time when the filing was accepted by the SEC - `filing_date: string` The date the financial statement was filed - `period: string` The fiscal period identifier (e.g., "Q1", "Q2", "Q3", "Q4") - `period_type: FiscalPeriodType` The type of fiscal period - `"QUARTERLY"` - `"ANNUAL"` - `"TTM"` - `"BIANNUAL"` - `reported_currency: string` The currency in which the statement is reported (ISO 4217) - `year: number` The fiscal year of the statement - `accounts_payables?: string | null` Change in accounts payables - `accounts_receivables?: string | null` Change in accounts receivables - `acquisitions_net?: string | null` Net acquisitions - `capital_expenditure?: string | null` Capital expenditure - `cash_at_beginning_of_period?: string | null` Cash and cash equivalents at beginning of period - `cash_at_end_of_period?: string | null` Cash and cash equivalents at end of period - `change_in_working_capital?: string | null` Change in working capital - `common_dividends_paid?: string | null` Common dividends paid - `common_stock_issuance?: string | null` Common stock issuance - `common_stock_repurchased?: string | null` Common stock repurchased (buybacks) - `deferred_income_tax?: string | null` Deferred income tax expense - `depreciation_and_amortization?: string | null` Depreciation and amortization expense - `effect_of_forex_changes_on_cash?: string | null` Effect of foreign exchange changes on cash - `free_cash_flow?: string | null` Free cash flow (operating cash flow minus capital expenditure) - `income_taxes_paid?: string | null` Income taxes paid - `interest_paid?: string | null` Interest paid - `inventory?: string | null` Change in inventory - `investments_in_property_plant_and_equipment?: string | null` Investments in property, plant, and equipment - `long_term_net_debt_issuance?: string | null` Long-term net debt issuance - `net_cash_provided_by_financing_activities?: string | null` Net cash provided by financing activities - `net_cash_provided_by_investing_activities?: string | null` Net cash provided by investing activities - `net_cash_provided_by_operating_activities?: string | null` Net cash provided by operating activities - `net_change_in_cash?: string | null` Net change in cash during the period - `net_common_stock_issuance?: string | null` Net common stock issuance - `net_debt_issuance?: string | null` Net debt issuance (long-term + short-term) - `net_dividends_paid?: string | null` Net dividends paid (common + preferred) - `net_income?: string | null` Net income for the period - `net_preferred_stock_issuance?: string | null` Net preferred stock issuance - `net_stock_issuance?: string | null` Net stock issuance (common + preferred) - `operating_cash_flow?: string | null` Operating cash flow (alternative calculation) - `other_financing_activities?: string | null` Other financing activities - `other_investing_activities?: string | null` Other investing activities - `other_non_cash_items?: string | null` Other non-cash items - `other_working_capital?: string | null` Change in other working capital - `preferred_dividends_paid?: string | null` Preferred dividends paid - `purchases_of_investments?: string | null` Purchases of investments - `sales_maturities_of_investments?: string | null` Sales and maturities of investments - `short_term_net_debt_issuance?: string | null` Short-term net debt issuance - `stock_based_compensation?: string | null` Stock-based compensation expense ### Instrument Cash Flow Statement List - `InstrumentCashFlowStatementList = Array` - `accepted_date: string` The date and time when the filing was accepted by the SEC - `filing_date: string` The date the financial statement was filed - `period: string` The fiscal period identifier (e.g., "Q1", "Q2", "Q3", "Q4") - `period_type: FiscalPeriodType` The type of fiscal period - `"QUARTERLY"` - `"ANNUAL"` - `"TTM"` - `"BIANNUAL"` - `reported_currency: string` The currency in which the statement is reported (ISO 4217) - `year: number` The fiscal year of the statement - `accounts_payables?: string | null` Change in accounts payables - `accounts_receivables?: string | null` Change in accounts receivables - `acquisitions_net?: string | null` Net acquisitions - `capital_expenditure?: string | null` Capital expenditure - `cash_at_beginning_of_period?: string | null` Cash and cash equivalents at beginning of period - `cash_at_end_of_period?: string | null` Cash and cash equivalents at end of period - `change_in_working_capital?: string | null` Change in working capital - `common_dividends_paid?: string | null` Common dividends paid - `common_stock_issuance?: string | null` Common stock issuance - `common_stock_repurchased?: string | null` Common stock repurchased (buybacks) - `deferred_income_tax?: string | null` Deferred income tax expense - `depreciation_and_amortization?: string | null` Depreciation and amortization expense - `effect_of_forex_changes_on_cash?: string | null` Effect of foreign exchange changes on cash - `free_cash_flow?: string | null` Free cash flow (operating cash flow minus capital expenditure) - `income_taxes_paid?: string | null` Income taxes paid - `interest_paid?: string | null` Interest paid - `inventory?: string | null` Change in inventory - `investments_in_property_plant_and_equipment?: string | null` Investments in property, plant, and equipment - `long_term_net_debt_issuance?: string | null` Long-term net debt issuance - `net_cash_provided_by_financing_activities?: string | null` Net cash provided by financing activities - `net_cash_provided_by_investing_activities?: string | null` Net cash provided by investing activities - `net_cash_provided_by_operating_activities?: string | null` Net cash provided by operating activities - `net_change_in_cash?: string | null` Net change in cash during the period - `net_common_stock_issuance?: string | null` Net common stock issuance - `net_debt_issuance?: string | null` Net debt issuance (long-term + short-term) - `net_dividends_paid?: string | null` Net dividends paid (common + preferred) - `net_income?: string | null` Net income for the period - `net_preferred_stock_issuance?: string | null` Net preferred stock issuance - `net_stock_issuance?: string | null` Net stock issuance (common + preferred) - `operating_cash_flow?: string | null` Operating cash flow (alternative calculation) - `other_financing_activities?: string | null` Other financing activities - `other_investing_activities?: string | null` Other investing activities - `other_non_cash_items?: string | null` Other non-cash items - `other_working_capital?: string | null` Change in other working capital - `preferred_dividends_paid?: string | null` Preferred dividends paid - `purchases_of_investments?: string | null` Purchases of investments - `sales_maturities_of_investments?: string | null` Sales and maturities of investments - `short_term_net_debt_issuance?: string | null` Short-term net debt issuance - `stock_based_compensation?: string | null` Stock-based compensation expense ### Instrument Dividend Event - `InstrumentDividendEvent` Represents a dividend event for an instrument - `adjusted_dividend_amount: string` The adjusted dividend amount accounting for any splits. - `ex_date: string` The day the stock starts trading without the right to receive that dividend. - `declaration_date?: string | null` The declaration date of the dividend - `dividend_amount?: string | null` The dividend amount per share. - `dividend_yield?: string | null` The dividend yield as a percentage of the stock price. - `frequency?: string | null` The frequency of the dividend payments (e.g., "Quarterly", "Annual"). - `payment_date?: string | null` The payment date is the date on which a declared stock dividend is scheduled to be paid. - `record_date?: string | null` The record date, set by a company's board of directors, is when a company compiles a list of shareholders of the stock for which it has declared a dividend. ### Instrument Earnings - `InstrumentEarnings` Represents instrument earnings data - `date: string` The date when the earnings report was published - `eps_actual?: string | null` The actual earnings per share (EPS) for the period - `eps_estimate?: string | null` The estimated earnings per share (EPS) for the period - `eps_surprise_percent?: string | null` The percentage difference between actual and estimated EPS - `revenue_actual?: string | null` The actual total revenue for the period - `revenue_estimate?: string | null` The estimated total revenue for the period - `revenue_surprise_percent?: string | null` The percentage difference between actual and estimated revenue ### Instrument Event Envelope - `InstrumentEventEnvelope` Unified envelope for the all-events response. - `symbol: string` Symbol associated with the event. - `type: AllEventsEventType` Event type discriminator. - `"EARNINGS"` - `"DIVIDEND"` - `"STOCK_SPLIT"` - `"IPO"` - `dividend_event_data?: InstrumentDividendEvent | null` Dividend payload when type is DIVIDEND. - `adjusted_dividend_amount: string` The adjusted dividend amount accounting for any splits. - `ex_date: string` The day the stock starts trading without the right to receive that dividend. - `declaration_date?: string | null` The declaration date of the dividend - `dividend_amount?: string | null` The dividend amount per share. - `dividend_yield?: string | null` The dividend yield as a percentage of the stock price. - `frequency?: string | null` The frequency of the dividend payments (e.g., "Quarterly", "Annual"). - `payment_date?: string | null` The payment date is the date on which a declared stock dividend is scheduled to be paid. - `record_date?: string | null` The record date, set by a company's board of directors, is when a company compiles a list of shareholders of the stock for which it has declared a dividend. - `earnings_event_data?: InstrumentEarnings | null` Earnings payload when type is EARNINGS. - `date: string` The date when the earnings report was published - `eps_actual?: string | null` The actual earnings per share (EPS) for the period - `eps_estimate?: string | null` The estimated earnings per share (EPS) for the period - `eps_surprise_percent?: string | null` The percentage difference between actual and estimated EPS - `revenue_actual?: string | null` The actual total revenue for the period - `revenue_estimate?: string | null` The estimated total revenue for the period - `revenue_surprise_percent?: string | null` The percentage difference between actual and estimated revenue - `instrument_id?: string | null` OEMS instrument identifier, when the instrument is found in the instrument cache. - `ipo_event_data?: InstrumentEventIpoItem | null` IPO payload when type is IPO. - `actions?: string | null` IPO action. - `announced_at?: string | null` IPO announced timestamp. - `company?: string | null` IPO company name. - `exchange?: string | null` IPO exchange. - `market_cap?: string | null` IPO market cap. - `price_range?: string | null` IPO price range. - `shares?: string | null` IPO shares offered. - `name?: string | null` Instrument name associated with the event, when available. - `reporting_currency?: string | null` The currency used for reporting financial data. - `stock_split_event_data?: InstrumentSplitEvent | null` Stock split payload when type is STOCK_SPLIT. - `date: string` The date of the stock split - `denominator: string` The denominator of the split ratio - `numerator: string` The numerator of the split ratio - `split_type: string` The type of stock split (e.g., "stock-split", "stock-dividend", "bonus-issue") ### Instrument Event Ipo Item - `InstrumentEventIpoItem` IPO event in the all-events date grouping response. - `actions?: string | null` IPO action. - `announced_at?: string | null` IPO announced timestamp. - `company?: string | null` IPO company name. - `exchange?: string | null` IPO exchange. - `market_cap?: string | null` IPO market cap. - `price_range?: string | null` IPO price range. - `shares?: string | null` IPO shares offered. ### Instrument Events By Date - `InstrumentEventsByDate` Instrument events for a single date. - `date: string` Event date. - `events: Array` Flat event envelopes for this date. - `symbol: string` Symbol associated with the event. - `type: AllEventsEventType` Event type discriminator. - `"EARNINGS"` - `"DIVIDEND"` - `"STOCK_SPLIT"` - `"IPO"` - `dividend_event_data?: InstrumentDividendEvent | null` Dividend payload when type is DIVIDEND. - `adjusted_dividend_amount: string` The adjusted dividend amount accounting for any splits. - `ex_date: string` The day the stock starts trading without the right to receive that dividend. - `declaration_date?: string | null` The declaration date of the dividend - `dividend_amount?: string | null` The dividend amount per share. - `dividend_yield?: string | null` The dividend yield as a percentage of the stock price. - `frequency?: string | null` The frequency of the dividend payments (e.g., "Quarterly", "Annual"). - `payment_date?: string | null` The payment date is the date on which a declared stock dividend is scheduled to be paid. - `record_date?: string | null` The record date, set by a company's board of directors, is when a company compiles a list of shareholders of the stock for which it has declared a dividend. - `earnings_event_data?: InstrumentEarnings | null` Earnings payload when type is EARNINGS. - `date: string` The date when the earnings report was published - `eps_actual?: string | null` The actual earnings per share (EPS) for the period - `eps_estimate?: string | null` The estimated earnings per share (EPS) for the period - `eps_surprise_percent?: string | null` The percentage difference between actual and estimated EPS - `revenue_actual?: string | null` The actual total revenue for the period - `revenue_estimate?: string | null` The estimated total revenue for the period - `revenue_surprise_percent?: string | null` The percentage difference between actual and estimated revenue - `instrument_id?: string | null` OEMS instrument identifier, when the instrument is found in the instrument cache. - `ipo_event_data?: InstrumentEventIpoItem | null` IPO payload when type is IPO. - `actions?: string | null` IPO action. - `announced_at?: string | null` IPO announced timestamp. - `company?: string | null` IPO company name. - `exchange?: string | null` IPO exchange. - `market_cap?: string | null` IPO market cap. - `price_range?: string | null` IPO price range. - `shares?: string | null` IPO shares offered. - `name?: string | null` Instrument name associated with the event, when available. - `reporting_currency?: string | null` The currency used for reporting financial data. - `stock_split_event_data?: InstrumentSplitEvent | null` Stock split payload when type is STOCK_SPLIT. - `date: string` The date of the stock split - `denominator: string` The denominator of the split ratio - `numerator: string` The numerator of the split ratio - `split_type: string` The type of stock split (e.g., "stock-split", "stock-dividend", "bonus-issue") ### Instrument Events Data - `InstrumentEventsData` Grouped instrument events by type - `dividends: Array` Dividend distribution events - `adjusted_dividend_amount: string` The adjusted dividend amount accounting for any splits. - `ex_date: string` The day the stock starts trading without the right to receive that dividend. - `declaration_date?: string | null` The declaration date of the dividend - `dividend_amount?: string | null` The dividend amount per share. - `dividend_yield?: string | null` The dividend yield as a percentage of the stock price. - `frequency?: string | null` The frequency of the dividend payments (e.g., "Quarterly", "Annual"). - `payment_date?: string | null` The payment date is the date on which a declared stock dividend is scheduled to be paid. - `record_date?: string | null` The record date, set by a company's board of directors, is when a company compiles a list of shareholders of the stock for which it has declared a dividend. - `earnings: Array` Earnings announcement events - `date: string` The date when the earnings report was published - `eps_actual?: string | null` The actual earnings per share (EPS) for the period - `eps_estimate?: string | null` The estimated earnings per share (EPS) for the period - `eps_surprise_percent?: string | null` The percentage difference between actual and estimated EPS - `revenue_actual?: string | null` The actual total revenue for the period - `revenue_estimate?: string | null` The estimated total revenue for the period - `revenue_surprise_percent?: string | null` The percentage difference between actual and estimated revenue - `instrument_id: string` OEMS instrument UUID from the request - `splits: Array` Stock split events - `date: string` The date of the stock split - `denominator: string` The denominator of the split ratio - `numerator: string` The numerator of the split ratio - `split_type: string` The type of stock split (e.g., "stock-split", "stock-dividend", "bonus-issue") - `reporting_currency?: string | null` The currency used for reporting financial data ### Instrument Fundamentals - `InstrumentFundamentals` Supplemental fundamentals and company profile data for an instrument. - `average_volume?: number | null` The average daily trading volume over the past 30 days - `beta?: string | null` The beta value, measuring the instrument's volatility relative to the overall market - `description?: string | null` A detailed description of the instrument or company - `dividend_yield?: string | null` The trailing twelve months (TTM) dividend yield - `earnings_per_share?: string | null` The trailing twelve months (TTM) earnings per share - `fifty_two_week_high?: string | null` The highest price over the last 52 weeks - `fifty_two_week_low?: string | null` The lowest price over the last 52 weeks - `industry?: string | null` The specific industry of the instrument's issuer - `list_date?: string | null` The date the instrument was first listed - `logo_url?: string | null` URL to a representative logo image for the instrument or issuer - `market_cap?: string | null` The total market capitalization - `previous_close?: string | null` The closing price from the previous trading day - `price_to_earnings?: string | null` The price-to-earnings (P/E) ratio for the trailing twelve months (TTM) - `reporting_currency?: string | null` The currency used for reporting financial data - `sector?: string | null` The business sector of the instrument's issuer ### Instrument Income Statement - `InstrumentIncomeStatement` A quarterly income statement for an instrument. - `accepted_date: string` The date and time when the filing was accepted by the SEC - `filing_date: string` The date the financial statement was filed - `period: string` The fiscal period identifier (e.g., "Q1", "Q2", "Q3", "Q4") - `period_type: FiscalPeriodType` The type of fiscal period - `"QUARTERLY"` - `"ANNUAL"` - `"TTM"` - `"BIANNUAL"` - `reported_currency: string` The currency in which the statement is reported (ISO 4217) - `year: number` The fiscal year of the statement - `bottom_line_net_income?: string | null` Bottom line net income after all adjustments - `cost_and_expenses?: string | null` Total costs and expenses - `cost_of_revenue?: string | null` Direct costs attributable to producing goods sold - `depreciation_and_amortization?: string | null` Depreciation and amortization expenses - `ebit?: string | null` Earnings before interest and taxes - `ebitda?: string | null` Earnings before interest, taxes, depreciation, and amortization - `eps?: string | null` Basic earnings per share - `eps_diluted?: string | null` Diluted earnings per share - `general_and_administrative_expenses?: string | null` General administrative overhead expenses - `gross_profit?: string | null` Revenue minus cost of revenue - `income_before_tax?: string | null` Income before income tax expense - `income_tax_expense?: string | null` Income tax expense for the period - `interest_expense?: string | null` Interest paid on debt - `interest_income?: string | null` Interest earned on investments and cash - `net_income?: string | null` Total net income for the period - `net_income_deductions?: string | null` Deductions from net income - `net_income_from_continuing_operations?: string | null` Net income from continuing operations - `net_income_from_discontinued_operations?: string | null` Net income from discontinued operations - `net_interest_income?: string | null` Net interest income (interest income minus interest expense) - `non_operating_income_excluding_interest?: string | null` Non-operating income excluding interest - `operating_expenses?: string | null` Total operating expenses - `operating_income?: string | null` Income from core business operations - `other_adjustments_to_net_income?: string | null` Other adjustments to net income - `other_expenses?: string | null` Other miscellaneous expenses - `research_and_development_expenses?: string | null` Expenditure on research and development activities - `revenue?: string | null` Total revenue from sales of goods and services - `selling_and_marketing_expenses?: string | null` Expenditure on marketing and sales activities - `selling_general_and_administrative_expenses?: string | null` Combined selling, general, and administrative expenses - `total_other_income_expenses_net?: string | null` Net of other income and expenses - `weighted_average_shs_out?: string | null` Weighted average shares outstanding (basic) - `weighted_average_shs_out_dil?: string | null` Weighted average shares outstanding (diluted) ### Instrument Income Statement List - `InstrumentIncomeStatementList = Array` - `accepted_date: string` The date and time when the filing was accepted by the SEC - `filing_date: string` The date the financial statement was filed - `period: string` The fiscal period identifier (e.g., "Q1", "Q2", "Q3", "Q4") - `period_type: FiscalPeriodType` The type of fiscal period - `"QUARTERLY"` - `"ANNUAL"` - `"TTM"` - `"BIANNUAL"` - `reported_currency: string` The currency in which the statement is reported (ISO 4217) - `year: number` The fiscal year of the statement - `bottom_line_net_income?: string | null` Bottom line net income after all adjustments - `cost_and_expenses?: string | null` Total costs and expenses - `cost_of_revenue?: string | null` Direct costs attributable to producing goods sold - `depreciation_and_amortization?: string | null` Depreciation and amortization expenses - `ebit?: string | null` Earnings before interest and taxes - `ebitda?: string | null` Earnings before interest, taxes, depreciation, and amortization - `eps?: string | null` Basic earnings per share - `eps_diluted?: string | null` Diluted earnings per share - `general_and_administrative_expenses?: string | null` General administrative overhead expenses - `gross_profit?: string | null` Revenue minus cost of revenue - `income_before_tax?: string | null` Income before income tax expense - `income_tax_expense?: string | null` Income tax expense for the period - `interest_expense?: string | null` Interest paid on debt - `interest_income?: string | null` Interest earned on investments and cash - `net_income?: string | null` Total net income for the period - `net_income_deductions?: string | null` Deductions from net income - `net_income_from_continuing_operations?: string | null` Net income from continuing operations - `net_income_from_discontinued_operations?: string | null` Net income from discontinued operations - `net_interest_income?: string | null` Net interest income (interest income minus interest expense) - `non_operating_income_excluding_interest?: string | null` Non-operating income excluding interest - `operating_expenses?: string | null` Total operating expenses - `operating_income?: string | null` Income from core business operations - `other_adjustments_to_net_income?: string | null` Other adjustments to net income - `other_expenses?: string | null` Other miscellaneous expenses - `research_and_development_expenses?: string | null` Expenditure on research and development activities - `revenue?: string | null` Total revenue from sales of goods and services - `selling_and_marketing_expenses?: string | null` Expenditure on marketing and sales activities - `selling_general_and_administrative_expenses?: string | null` Combined selling, general, and administrative expenses - `total_other_income_expenses_net?: string | null` Net of other income and expenses - `weighted_average_shs_out?: string | null` Weighted average shares outstanding (basic) - `weighted_average_shs_out_dil?: string | null` Weighted average shares outstanding (diluted) ### Instrument Split Event - `InstrumentSplitEvent` Represents a stock split event for an instrument - `date: string` The date of the stock split - `denominator: string` The denominator of the split ratio - `numerator: string` The numerator of the split ratio - `split_type: string` The type of stock split (e.g., "stock-split", "stock-dividend", "bonus-issue") ### Price Target - `PriceTarget` Analyst price target statistics - `average: string` Average analyst price target - `currency: string` ISO 4217 currency code of the price targets - `high: string` Highest analyst price target - `low: string` Lowest analyst price target ### Instrument Data Get All Instrument Events Response - `InstrumentDataGetAllInstrumentEventsResponse extends BaseResponse` - `data: InstrumentAllEventsData` All-events payload grouped by date. - `event_dates: Array` Events grouped by date in descending order. - `date: string` Event date. - `events: Array` Flat event envelopes for this date. - `symbol: string` Symbol associated with the event. - `type: AllEventsEventType` Event type discriminator. - `"EARNINGS"` - `"DIVIDEND"` - `"STOCK_SPLIT"` - `"IPO"` - `dividend_event_data?: InstrumentDividendEvent | null` Dividend payload when type is DIVIDEND. - `adjusted_dividend_amount: string` The adjusted dividend amount accounting for any splits. - `ex_date: string` The day the stock starts trading without the right to receive that dividend. - `declaration_date?: string | null` The declaration date of the dividend - `dividend_amount?: string | null` The dividend amount per share. - `dividend_yield?: string | null` The dividend yield as a percentage of the stock price. - `frequency?: string | null` The frequency of the dividend payments (e.g., "Quarterly", "Annual"). - `payment_date?: string | null` The payment date is the date on which a declared stock dividend is scheduled to be paid. - `record_date?: string | null` The record date, set by a company's board of directors, is when a company compiles a list of shareholders of the stock for which it has declared a dividend. - `earnings_event_data?: InstrumentEarnings | null` Earnings payload when type is EARNINGS. - `date: string` The date when the earnings report was published - `eps_actual?: string | null` The actual earnings per share (EPS) for the period - `eps_estimate?: string | null` The estimated earnings per share (EPS) for the period - `eps_surprise_percent?: string | null` The percentage difference between actual and estimated EPS - `revenue_actual?: string | null` The actual total revenue for the period - `revenue_estimate?: string | null` The estimated total revenue for the period - `revenue_surprise_percent?: string | null` The percentage difference between actual and estimated revenue - `instrument_id?: string | null` OEMS instrument identifier, when the instrument is found in the instrument cache. - `ipo_event_data?: InstrumentEventIpoItem | null` IPO payload when type is IPO. - `actions?: string | null` IPO action. - `announced_at?: string | null` IPO announced timestamp. - `company?: string | null` IPO company name. - `exchange?: string | null` IPO exchange. - `market_cap?: string | null` IPO market cap. - `price_range?: string | null` IPO price range. - `shares?: string | null` IPO shares offered. - `name?: string | null` Instrument name associated with the event, when available. - `reporting_currency?: string | null` The currency used for reporting financial data. - `stock_split_event_data?: InstrumentSplitEvent | null` Stock split payload when type is STOCK_SPLIT. - `date: string` The date of the stock split - `denominator: string` The denominator of the split ratio - `numerator: string` The numerator of the split ratio - `split_type: string` The type of stock split (e.g., "stock-split", "stock-dividend", "bonus-issue") ### Instrument Data Get Instrument Events Response - `InstrumentDataGetInstrumentEventsResponse extends BaseResponse` - `data: InstrumentEventsData` Grouped instrument events by type - `dividends: Array` Dividend distribution events - `adjusted_dividend_amount: string` The adjusted dividend amount accounting for any splits. - `ex_date: string` The day the stock starts trading without the right to receive that dividend. - `declaration_date?: string | null` The declaration date of the dividend - `dividend_amount?: string | null` The dividend amount per share. - `dividend_yield?: string | null` The dividend yield as a percentage of the stock price. - `frequency?: string | null` The frequency of the dividend payments (e.g., "Quarterly", "Annual"). - `payment_date?: string | null` The payment date is the date on which a declared stock dividend is scheduled to be paid. - `record_date?: string | null` The record date, set by a company's board of directors, is when a company compiles a list of shareholders of the stock for which it has declared a dividend. - `earnings: Array` Earnings announcement events - `date: string` The date when the earnings report was published - `eps_actual?: string | null` The actual earnings per share (EPS) for the period - `eps_estimate?: string | null` The estimated earnings per share (EPS) for the period - `eps_surprise_percent?: string | null` The percentage difference between actual and estimated EPS - `revenue_actual?: string | null` The actual total revenue for the period - `revenue_estimate?: string | null` The estimated total revenue for the period - `revenue_surprise_percent?: string | null` The percentage difference between actual and estimated revenue - `instrument_id: string` OEMS instrument UUID from the request - `splits: Array` Stock split events - `date: string` The date of the stock split - `denominator: string` The denominator of the split ratio - `numerator: string` The numerator of the split ratio - `split_type: string` The type of stock split (e.g., "stock-split", "stock-dividend", "bonus-issue") - `reporting_currency?: string | null` The currency used for reporting financial data ### Instrument Data Get Instrument Fundamentals Response - `InstrumentDataGetInstrumentFundamentalsResponse extends BaseResponse` - `data: InstrumentFundamentals` Supplemental fundamentals and company profile data for an instrument. - `average_volume?: number | null` The average daily trading volume over the past 30 days - `beta?: string | null` The beta value, measuring the instrument's volatility relative to the overall market - `description?: string | null` A detailed description of the instrument or company - `dividend_yield?: string | null` The trailing twelve months (TTM) dividend yield - `earnings_per_share?: string | null` The trailing twelve months (TTM) earnings per share - `fifty_two_week_high?: string | null` The highest price over the last 52 weeks - `fifty_two_week_low?: string | null` The lowest price over the last 52 weeks - `industry?: string | null` The specific industry of the instrument's issuer - `list_date?: string | null` The date the instrument was first listed - `logo_url?: string | null` URL to a representative logo image for the instrument or issuer - `market_cap?: string | null` The total market capitalization - `previous_close?: string | null` The closing price from the previous trading day - `price_to_earnings?: string | null` The price-to-earnings (P/E) ratio for the trailing twelve months (TTM) - `reporting_currency?: string | null` The currency used for reporting financial data - `sector?: string | null` The business sector of the instrument's issuer ### Instrument Data Get Instrument Balance Sheet Statements Response - `InstrumentDataGetInstrumentBalanceSheetStatementsResponse extends BaseResponse` - `data: InstrumentBalanceSheetStatementList` - `accepted_date: string` The date and time when the filing was accepted by the SEC - `filing_date: string` The date the financial statement was filed - `period: string` The fiscal period identifier (e.g., "Q1", "Q2", "Q3", "Q4") - `period_type: FiscalPeriodType` The type of fiscal period - `"QUARTERLY"` - `"ANNUAL"` - `"TTM"` - `"BIANNUAL"` - `reported_currency: string` The currency in which the statement is reported (ISO 4217) - `year: number` The fiscal year of the statement - `account_payables?: string | null` Account payables - `accounts_receivables?: string | null` Accounts receivables - `accrued_expenses?: string | null` Accrued expenses - `accumulated_other_comprehensive_income_loss?: string | null` Accumulated other comprehensive income/loss - `additional_paid_in_capital?: string | null` Additional paid-in capital - `capital_lease_obligations?: string | null` Capital lease obligations (total) - `capital_lease_obligations_current?: string | null` Capital lease obligations (current portion) - `cash_and_cash_equivalents?: string | null` Cash and cash equivalents - `cash_and_short_term_investments?: string | null` Cash and short-term investments combined - `common_stock?: string | null` Common stock - `deferred_revenue?: string | null` Deferred revenue - `deferred_revenue_non_current?: string | null` Deferred revenue (non-current) - `deferred_tax_liabilities_non_current?: string | null` Deferred tax liabilities (non-current) - `goodwill?: string | null` Goodwill - `goodwill_and_intangible_assets?: string | null` Goodwill and intangible assets combined - `intangible_assets?: string | null` Intangible assets - `inventory?: string | null` Inventory - `long_term_debt?: string | null` Long-term debt - `long_term_investments?: string | null` Long-term investments - `minority_interest?: string | null` Minority interest - `net_debt?: string | null` Net debt (total debt minus cash) - `net_receivables?: string | null` Net receivables - `other_assets?: string | null` Other assets - `other_current_assets?: string | null` Other current assets - `other_current_liabilities?: string | null` Other current liabilities - `other_liabilities?: string | null` Other liabilities - `other_non_current_assets?: string | null` Other non-current assets - `other_non_current_liabilities?: string | null` Other non-current liabilities - `other_payables?: string | null` Other payables - `other_receivables?: string | null` Other receivables - `other_total_stockholders_equity?: string | null` Other total stockholders equity - `preferred_stock?: string | null` Preferred stock - `prepaids?: string | null` Prepaids - `property_plant_and_equipment_net?: string | null` Property, plant and equipment net of depreciation - `retained_earnings?: string | null` Retained earnings - `short_term_debt?: string | null` Short-term debt - `short_term_investments?: string | null` Short-term investments - `tax_assets?: string | null` Tax assets - `tax_payables?: string | null` Tax payables - `total_assets?: string | null` Total assets - `total_current_assets?: string | null` Total current assets - `total_current_liabilities?: string | null` Total current liabilities - `total_debt?: string | null` Total debt - `total_equity?: string | null` Total equity - `total_investments?: string | null` Total investments - `total_liabilities?: string | null` Total liabilities - `total_liabilities_and_total_equity?: string | null` Total liabilities and total equity - `total_non_current_assets?: string | null` Total non-current assets - `total_non_current_liabilities?: string | null` Total non-current liabilities - `total_payables?: string | null` Total payables - `total_stockholders_equity?: string | null` Total stockholders equity - `treasury_stock?: string | null` Treasury stock ### Instrument Data Get Instrument Income Statements Response - `InstrumentDataGetInstrumentIncomeStatementsResponse extends BaseResponse` - `data: InstrumentIncomeStatementList` - `accepted_date: string` The date and time when the filing was accepted by the SEC - `filing_date: string` The date the financial statement was filed - `period: string` The fiscal period identifier (e.g., "Q1", "Q2", "Q3", "Q4") - `period_type: FiscalPeriodType` The type of fiscal period - `"QUARTERLY"` - `"ANNUAL"` - `"TTM"` - `"BIANNUAL"` - `reported_currency: string` The currency in which the statement is reported (ISO 4217) - `year: number` The fiscal year of the statement - `bottom_line_net_income?: string | null` Bottom line net income after all adjustments - `cost_and_expenses?: string | null` Total costs and expenses - `cost_of_revenue?: string | null` Direct costs attributable to producing goods sold - `depreciation_and_amortization?: string | null` Depreciation and amortization expenses - `ebit?: string | null` Earnings before interest and taxes - `ebitda?: string | null` Earnings before interest, taxes, depreciation, and amortization - `eps?: string | null` Basic earnings per share - `eps_diluted?: string | null` Diluted earnings per share - `general_and_administrative_expenses?: string | null` General administrative overhead expenses - `gross_profit?: string | null` Revenue minus cost of revenue - `income_before_tax?: string | null` Income before income tax expense - `income_tax_expense?: string | null` Income tax expense for the period - `interest_expense?: string | null` Interest paid on debt - `interest_income?: string | null` Interest earned on investments and cash - `net_income?: string | null` Total net income for the period - `net_income_deductions?: string | null` Deductions from net income - `net_income_from_continuing_operations?: string | null` Net income from continuing operations - `net_income_from_discontinued_operations?: string | null` Net income from discontinued operations - `net_interest_income?: string | null` Net interest income (interest income minus interest expense) - `non_operating_income_excluding_interest?: string | null` Non-operating income excluding interest - `operating_expenses?: string | null` Total operating expenses - `operating_income?: string | null` Income from core business operations - `other_adjustments_to_net_income?: string | null` Other adjustments to net income - `other_expenses?: string | null` Other miscellaneous expenses - `research_and_development_expenses?: string | null` Expenditure on research and development activities - `revenue?: string | null` Total revenue from sales of goods and services - `selling_and_marketing_expenses?: string | null` Expenditure on marketing and sales activities - `selling_general_and_administrative_expenses?: string | null` Combined selling, general, and administrative expenses - `total_other_income_expenses_net?: string | null` Net of other income and expenses - `weighted_average_shs_out?: string | null` Weighted average shares outstanding (basic) - `weighted_average_shs_out_dil?: string | null` Weighted average shares outstanding (diluted) ### Instrument Data Get Instrument Analyst Consensus Response - `InstrumentDataGetInstrumentAnalystConsensusResponse extends BaseResponse` - `data: InstrumentAnalystConsensus` Aggregated analyst consensus metrics - `date: string` The date the consensus snapshot was generated - `distribution?: AnalystDistribution | null` Count of individual analyst recommendations by category - `buy: number` Number of buy recommendations - `hold: number` Number of hold recommendations - `sell: number` Number of sell recommendations - `strong_buy: number` Number of strong buy recommendations - `strong_sell: number` Number of strong sell recommendations - `price_target?: PriceTarget | null` Aggregated analyst price target statistics - `average: string` Average analyst price target - `currency: string` ISO 4217 currency code of the price targets - `high: string` Highest analyst price target - `low: string` Lowest analyst price target - `rating?: AnalystRating | null` Consensus analyst rating - `"STRONG_BUY"` - `"BUY"` - `"HOLD"` - `"SELL"` - `"STRONG_SELL"` ### Instrument Data Get Instrument Cash Flow Statements Response - `InstrumentDataGetInstrumentCashFlowStatementsResponse extends BaseResponse` - `data: InstrumentCashFlowStatementList` - `accepted_date: string` The date and time when the filing was accepted by the SEC - `filing_date: string` The date the financial statement was filed - `period: string` The fiscal period identifier (e.g., "Q1", "Q2", "Q3", "Q4") - `period_type: FiscalPeriodType` The type of fiscal period - `"QUARTERLY"` - `"ANNUAL"` - `"TTM"` - `"BIANNUAL"` - `reported_currency: string` The currency in which the statement is reported (ISO 4217) - `year: number` The fiscal year of the statement - `accounts_payables?: string | null` Change in accounts payables - `accounts_receivables?: string | null` Change in accounts receivables - `acquisitions_net?: string | null` Net acquisitions - `capital_expenditure?: string | null` Capital expenditure - `cash_at_beginning_of_period?: string | null` Cash and cash equivalents at beginning of period - `cash_at_end_of_period?: string | null` Cash and cash equivalents at end of period - `change_in_working_capital?: string | null` Change in working capital - `common_dividends_paid?: string | null` Common dividends paid - `common_stock_issuance?: string | null` Common stock issuance - `common_stock_repurchased?: string | null` Common stock repurchased (buybacks) - `deferred_income_tax?: string | null` Deferred income tax expense - `depreciation_and_amortization?: string | null` Depreciation and amortization expense - `effect_of_forex_changes_on_cash?: string | null` Effect of foreign exchange changes on cash - `free_cash_flow?: string | null` Free cash flow (operating cash flow minus capital expenditure) - `income_taxes_paid?: string | null` Income taxes paid - `interest_paid?: string | null` Interest paid - `inventory?: string | null` Change in inventory - `investments_in_property_plant_and_equipment?: string | null` Investments in property, plant, and equipment - `long_term_net_debt_issuance?: string | null` Long-term net debt issuance - `net_cash_provided_by_financing_activities?: string | null` Net cash provided by financing activities - `net_cash_provided_by_investing_activities?: string | null` Net cash provided by investing activities - `net_cash_provided_by_operating_activities?: string | null` Net cash provided by operating activities - `net_change_in_cash?: string | null` Net change in cash during the period - `net_common_stock_issuance?: string | null` Net common stock issuance - `net_debt_issuance?: string | null` Net debt issuance (long-term + short-term) - `net_dividends_paid?: string | null` Net dividends paid (common + preferred) - `net_income?: string | null` Net income for the period - `net_preferred_stock_issuance?: string | null` Net preferred stock issuance - `net_stock_issuance?: string | null` Net stock issuance (common + preferred) - `operating_cash_flow?: string | null` Operating cash flow (alternative calculation) - `other_financing_activities?: string | null` Other financing activities - `other_investing_activities?: string | null` Other investing activities - `other_non_cash_items?: string | null` Other non-cash items - `other_working_capital?: string | null` Change in other working capital - `preferred_dividends_paid?: string | null` Preferred dividends paid - `purchases_of_investments?: string | null` Purchases of investments - `sales_maturities_of_investments?: string | null` Sales and maturities of investments - `short_term_net_debt_issuance?: string | null` Short-term net debt issuance - `stock_based_compensation?: string | null` Stock-based compensation expense # Market Data ## Get Snapshots `client.v1.instrumentData.marketData.getSnapshots(MarketDataGetSnapshotsParamsquery?, RequestOptionsoptions?): MarketDataGetSnapshotsResponse` **get** `/v1/market-data/snapshot` Get market data snapshots for one or more securities. ### Parameters - `query: MarketDataGetSnapshotsParams` - `instrument_ids?: Array` Comma-separated OEMS instrument UUIDs. ### Returns - `MarketDataGetSnapshotsResponse extends BaseResponse` - `data: MarketDataSnapshotList` - `instrument_id: string` OEMS instrument identifier. - `symbol: string` Display symbol for the security. - `cumulative_volume?: number | null` Cumulative traded volume reported on the most recent trade, in shares for equities or contracts for options. Absent when no trade is available. - `last_quote?: SnapshotQuote | null` Most recent quote if available. - `ask: string` Current best ask. - `bid: string` Current best bid. - `midpoint: string` Midpoint of bid and ask. - `ask_size?: number | null` Size at the best ask, in shares. - `bid_size?: number | null` Size at the best bid, in shares. - `last_trade?: SnapshotLastTrade | null` Most recent last-sale trade if available. - `price: string` Most recent last-sale eligible trade price. - `name?: string | null` Security name if available. - `session?: SnapshotSession | null` Session metrics computed from previous close and last trade, if available. - `change: string` Absolute change from previous close to last trade. - `change_percent: string` Percent change from previous close to last trade. - `previous_close: string` Previous session close price. ### Example ```typescript import ClearStreet from '@clear-street-internal/sdk'; const client = new ClearStreet({ apiKey: 'My API Key', }); const response = await client.v1.instrumentData.marketData.getSnapshots(); console.log(response); ``` #### Response ```json { "data": [ { "cumulative_volume": 12345678, "instrument_id": "a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8", "last_quote": { "ask": "210.14", "ask_size": 120, "bid": "210.10", "bid_size": 100, "midpoint": "210.12" }, "last_trade": { "price": "210.12" }, "name": "Apple Inc.", "session": { "change": "1.82", "change_percent": "0.8737", "previous_close": "208.30" }, "symbol": "AAPL" } ], "error": null, "metadata": { "request_id": "2d0c9159-8f5d-49ca-a861-0d8346fd11da" } } ``` ## Get Daily Aggregate Summaries `client.v1.instrumentData.marketData.getDailySummaries(MarketDataGetDailySummariesParamsquery, RequestOptionsoptions?): MarketDataGetDailySummariesResponse` **get** `/v1/market-data/daily-summary` Returns the most recent OHLV and current price for the requested OEMS instruments. Backed by the in-memory Polygon snapshot cache. Response contract: every request returns one row per **unique** `instrument_id`, in first-seen request order. Unresolvable IDs come back with `symbol = null` and every market-data field `null`; resolvable IDs with no cache entry come back with `symbol` populated but market-data fields `null`. **Note (temporary):** ID resolution currently goes through the supplemental screener (OEMS instrument_id → FMP fmp_symbol → metadata_id → realtime cache). Removed when the market-data service serves daily aggregates directly, or when Polygon symbology is loaded into the instrument cache. ### Parameters - `query: MarketDataGetDailySummariesParams` - `instrument_ids: string` Comma-separated OEMS instrument UUIDs (required, 1..=100) ### Returns - `MarketDataGetDailySummariesResponse extends BaseResponse` - `data: DailySummaryList` - `instrument_id: string` OEMS instrument identifier. Always populated; echoes the request ID. - `high?: string | null` Session high. - `low?: string | null` Session low. - `open?: string | null` Opening price for the session. - `symbol?: string | null` Display symbol for the security. `None` for unresolvable IDs. - `trade_date?: string | null` Session date the OHLV represents, US/Eastern. - `volume?: number | null` Session cumulative trading volume. ### Example ```typescript import ClearStreet from '@clear-street-internal/sdk'; const client = new ClearStreet({ apiKey: 'My API Key', }); const response = await client.v1.instrumentData.marketData.getDailySummaries({ instrument_ids: 'instrument_ids', }); console.log(response); ``` #### Response ```json { "metadata": { "request_id": "request_id", "next_page_token": "U3RhaW5sZXNzIHJvY2tz", "page_number": 0, "previous_page_token": "U3RhaW5sZXNzIHJvY2tz", "total_items": 0, "total_pages": 0 }, "error": { "code": 400, "message": "Order quantity must be greater than zero", "details": [ { "foo": "bar" } ] }, "data": [ { "instrument_id": "a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8", "high": "215.20", "low": "210.10", "open": "211.00", "symbol": "AAPL", "trade_date": "2026-04-23", "volume": 88000000 } ] } ``` ## Domain Types ### Daily Summary - `DailySummary` Daily aggregate (OHLV) summary for a single instrument. Returned by `GET /market-data/daily-summary`. Every field except `instrument_id` is `Option`: - Unresolvable `instrument_id` → all other fields `None` (including `symbol`). - Resolvable `instrument_id` with no realtime cache entry → `symbol` populated, OHLV/`trade_date` `None`. - `trade_date` reflects the session the OHLV represents (today during trading hours, the last trading date during weekends/holidays). - `instrument_id: string` OEMS instrument identifier. Always populated; echoes the request ID. - `high?: string | null` Session high. - `low?: string | null` Session low. - `open?: string | null` Opening price for the session. - `symbol?: string | null` Display symbol for the security. `None` for unresolvable IDs. - `trade_date?: string | null` Session date the OHLV represents, US/Eastern. - `volume?: number | null` Session cumulative trading volume. ### Daily Summary List - `DailySummaryList = Array` - `instrument_id: string` OEMS instrument identifier. Always populated; echoes the request ID. - `high?: string | null` Session high. - `low?: string | null` Session low. - `open?: string | null` Opening price for the session. - `symbol?: string | null` Display symbol for the security. `None` for unresolvable IDs. - `trade_date?: string | null` Session date the OHLV represents, US/Eastern. - `volume?: number | null` Session cumulative trading volume. ### Market Data Snapshot - `MarketDataSnapshot` Market data snapshot for a single security. - `instrument_id: string` OEMS instrument identifier. - `symbol: string` Display symbol for the security. - `cumulative_volume?: number | null` Cumulative traded volume reported on the most recent trade, in shares for equities or contracts for options. Absent when no trade is available. - `last_quote?: SnapshotQuote | null` Most recent quote if available. - `ask: string` Current best ask. - `bid: string` Current best bid. - `midpoint: string` Midpoint of bid and ask. - `ask_size?: number | null` Size at the best ask, in shares. - `bid_size?: number | null` Size at the best bid, in shares. - `last_trade?: SnapshotLastTrade | null` Most recent last-sale trade if available. - `price: string` Most recent last-sale eligible trade price. - `name?: string | null` Security name if available. - `session?: SnapshotSession | null` Session metrics computed from previous close and last trade, if available. - `change: string` Absolute change from previous close to last trade. - `change_percent: string` Percent change from previous close to last trade. - `previous_close: string` Previous session close price. ### Market Data Snapshot List - `MarketDataSnapshotList = Array` - `instrument_id: string` OEMS instrument identifier. - `symbol: string` Display symbol for the security. - `cumulative_volume?: number | null` Cumulative traded volume reported on the most recent trade, in shares for equities or contracts for options. Absent when no trade is available. - `last_quote?: SnapshotQuote | null` Most recent quote if available. - `ask: string` Current best ask. - `bid: string` Current best bid. - `midpoint: string` Midpoint of bid and ask. - `ask_size?: number | null` Size at the best ask, in shares. - `bid_size?: number | null` Size at the best bid, in shares. - `last_trade?: SnapshotLastTrade | null` Most recent last-sale trade if available. - `price: string` Most recent last-sale eligible trade price. - `name?: string | null` Security name if available. - `session?: SnapshotSession | null` Session metrics computed from previous close and last trade, if available. - `change: string` Absolute change from previous close to last trade. - `change_percent: string` Percent change from previous close to last trade. - `previous_close: string` Previous session close price. ### Snapshot Last Trade - `SnapshotLastTrade` Last-trade fields for a market data snapshot. - `price: string` Most recent last-sale eligible trade price. ### Snapshot Quote - `SnapshotQuote` L1 quote fields for a market data snapshot. - `ask: string` Current best ask. - `bid: string` Current best bid. - `midpoint: string` Midpoint of bid and ask. - `ask_size?: number | null` Size at the best ask, in shares. - `bid_size?: number | null` Size at the best bid, in shares. ### Snapshot Session - `SnapshotSession` Session-level pricing metrics for a market data snapshot. - `change: string` Absolute change from previous close to last trade. - `change_percent: string` Percent change from previous close to last trade. - `previous_close: string` Previous session close price. ### Market Data Get Snapshots Response - `MarketDataGetSnapshotsResponse extends BaseResponse` - `data: MarketDataSnapshotList` - `instrument_id: string` OEMS instrument identifier. - `symbol: string` Display symbol for the security. - `cumulative_volume?: number | null` Cumulative traded volume reported on the most recent trade, in shares for equities or contracts for options. Absent when no trade is available. - `last_quote?: SnapshotQuote | null` Most recent quote if available. - `ask: string` Current best ask. - `bid: string` Current best bid. - `midpoint: string` Midpoint of bid and ask. - `ask_size?: number | null` Size at the best ask, in shares. - `bid_size?: number | null` Size at the best bid, in shares. - `last_trade?: SnapshotLastTrade | null` Most recent last-sale trade if available. - `price: string` Most recent last-sale eligible trade price. - `name?: string | null` Security name if available. - `session?: SnapshotSession | null` Session metrics computed from previous close and last trade, if available. - `change: string` Absolute change from previous close to last trade. - `change_percent: string` Percent change from previous close to last trade. - `previous_close: string` Previous session close price. ### Market Data Get Daily Summaries Response - `MarketDataGetDailySummariesResponse extends BaseResponse` - `data: DailySummaryList` - `instrument_id: string` OEMS instrument identifier. Always populated; echoes the request ID. - `high?: string | null` Session high. - `low?: string | null` Session low. - `open?: string | null` Opening price for the session. - `symbol?: string | null` Display symbol for the security. `None` for unresolvable IDs. - `trade_date?: string | null` Session date the OHLV represents, US/Eastern. - `volume?: number | null` Session cumulative trading volume. # News ## Get News `client.v1.instrumentData.news.getNews(NewsGetNewsParamsquery?, RequestOptionsoptions?): NewsGetNewsResponse` **get** `/v1/news` Retrieves news items with optional filtering by security IDs, time range, publisher, type, and text query. ### Parameters - `query: NewsGetNewsParams` - `exclude_publishers?: string` Comma-separated list of publishers to exclude (mutually exclusive with include_publishers). - `from?: string` Inclusive start timestamp. Accepts `YYYY-MM-DD` or RFC3339 datetime. - `include_publishers?: string` Comma-separated list of publishers to include (mutually exclusive with exclude_publishers). - `instrument_ids?: Array` Comma-delimited OEMS instrument UUIDs to filter by. - `news_type?: "NEWS" | "PRESS_RELEASE"` Filter by news type. - `"NEWS"` - `"PRESS_RELEASE"` - `page_size?: number` The number of items to return per page. Only used when page_token is not provided. - `page_token?: string` Token for retrieving the next or previous page of results. Contains encoded pagination state; when provided, page_size is ignored. - `search_query?: string` Free-text query matched against title/text and associated security IDs. - `sectors?: Array<"BASIC_MATERIALS" | "COMMUNICATION_SERVICES" | "CONSUMER_CYCLICAL" | 8 more>` Comma-separated sector values to filter by. - `"BASIC_MATERIALS"` - `"COMMUNICATION_SERVICES"` - `"CONSUMER_CYCLICAL"` - `"CONSUMER_DEFENSIVE"` - `"ENERGY"` - `"FINANCIAL_SERVICES"` - `"HEALTHCARE"` - `"INDUSTRIALS"` - `"REAL_ESTATE"` - `"TECHNOLOGY"` - `"UTILITIES"` - `to?: string` Inclusive end timestamp. Accepts `YYYY-MM-DD` or RFC3339 datetime. ### Returns - `NewsGetNewsResponse extends BaseResponse` - `data: NewsItemList` - `instruments: Array` Instruments associated with this news item. - `instrument_id: string` OEMS instrument UUID. - `name?: string | null` Instrument name/description, if available from instrument cache enrichment. - `symbol?: string | null` Trading symbol, if available from instrument cache enrichment. - `news_type: NewsType` Classification of the item. - `"NEWS"` - `"PRESS_RELEASE"` - `published_at: string` The published date/time of the article in UTC. - `publisher: string` The publisher or newswire source. - `title: string` The headline/title of the article. - `url: string` Canonical URL to the full article. - `image_url?: string | null` URL of an associated image if provided by the source. - `site?: string | null` The primary domain/site of the publisher. - `text?: string | null` The full or excerpted article body. ### Example ```typescript import ClearStreet from '@clear-street-internal/sdk'; const client = new ClearStreet({ apiKey: 'My API Key', }); const response = await client.v1.instrumentData.news.getNews(); console.log(response); ``` #### Response ```json { "data": [ { "instruments": [ { "instrument_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "name": "Apple Inc.", "symbol": "AAPL" } ], "news_type": "NEWS", "published_at": "2025-10-31T14:30:00.000000000Z", "publisher": "Reuters", "site": "reuters.com", "title": "Apple announces new hardware lineup", "url": "https://example.com/news/1" } ], "error": null, "metadata": { "next_page_token": "cGFnZT0yJmxhc3Rfc3ltYm9sPVRTM0E", "page_number": 1, "request_id": "0f1a2b3c-4d5e-6f78-9012-3a4b5c6d7e8f", "total_items": 25, "total_pages": 3 } } ``` ## Domain Types ### News Instrument - `NewsInstrument` Instrument associated with a news item. - `instrument_id: string` OEMS instrument UUID. - `name?: string | null` Instrument name/description, if available from instrument cache enrichment. - `symbol?: string | null` Trading symbol, if available from instrument cache enrichment. ### News Item - `NewsItem` A single news item and its associated instruments. - `instruments: Array` Instruments associated with this news item. - `instrument_id: string` OEMS instrument UUID. - `name?: string | null` Instrument name/description, if available from instrument cache enrichment. - `symbol?: string | null` Trading symbol, if available from instrument cache enrichment. - `news_type: NewsType` Classification of the item. - `"NEWS"` - `"PRESS_RELEASE"` - `published_at: string` The published date/time of the article in UTC. - `publisher: string` The publisher or newswire source. - `title: string` The headline/title of the article. - `url: string` Canonical URL to the full article. - `image_url?: string | null` URL of an associated image if provided by the source. - `site?: string | null` The primary domain/site of the publisher. - `text?: string | null` The full or excerpted article body. ### News Item List - `NewsItemList = Array` - `instruments: Array` Instruments associated with this news item. - `instrument_id: string` OEMS instrument UUID. - `name?: string | null` Instrument name/description, if available from instrument cache enrichment. - `symbol?: string | null` Trading symbol, if available from instrument cache enrichment. - `news_type: NewsType` Classification of the item. - `"NEWS"` - `"PRESS_RELEASE"` - `published_at: string` The published date/time of the article in UTC. - `publisher: string` The publisher or newswire source. - `title: string` The headline/title of the article. - `url: string` Canonical URL to the full article. - `image_url?: string | null` URL of an associated image if provided by the source. - `site?: string | null` The primary domain/site of the publisher. - `text?: string | null` The full or excerpted article body. ### News Type - `NewsType = "NEWS" | "PRESS_RELEASE"` News item classification. - `"NEWS"` - `"PRESS_RELEASE"` ### News Get News Response - `NewsGetNewsResponse extends BaseResponse` - `data: NewsItemList` - `instruments: Array` Instruments associated with this news item. - `instrument_id: string` OEMS instrument UUID. - `name?: string | null` Instrument name/description, if available from instrument cache enrichment. - `symbol?: string | null` Trading symbol, if available from instrument cache enrichment. - `news_type: NewsType` Classification of the item. - `"NEWS"` - `"PRESS_RELEASE"` - `published_at: string` The published date/time of the article in UTC. - `publisher: string` The publisher or newswire source. - `title: string` The headline/title of the article. - `url: string` Canonical URL to the full article. - `image_url?: string | null` URL of an associated image if provided by the source. - `site?: string | null` The primary domain/site of the publisher. - `text?: string | null` The full or excerpted article body. # Instruments ## Get Instruments `client.v1.instruments.getInstruments(InstrumentGetInstrumentsParamsquery?, RequestOptionsoptions?): InstrumentGetInstrumentsResponse` **get** `/v1/instruments` Retrieves a list of tradeable instruments. ### Parameters - `query: InstrumentGetInstrumentsParams` - `easy_to_borrow?: boolean` Filter by easy to borrow status - `instrument_ids?: Array` Comma-separated OEMS instrument UUIDs - `instrument_type?: "COMMON_STOCK" | "PREFERRED_STOCK" | "OPTION" | 2 more` Filter by instrument type. OPTION is not supported on this endpoint; use GET /instruments/options/contracts to list option contracts. If omitted, returns all supported instrument types except options. - `"COMMON_STOCK"` - `"PREFERRED_STOCK"` - `"OPTION"` - `"CASH"` - `"OTHER"` - `is_liquidation_only?: boolean` Filter by liquidation only status - `is_marginable?: boolean` Filter by marginable status - `is_restricted?: boolean` Filter by restricted status - `is_short_prohibited?: boolean` Filter by short prohibited status - `is_threshold_security?: boolean` Filter by threshold security status - `page_size?: number` The number of items to return per page. Only used when page_token is not provided. - `page_token?: string` Token for retrieving the next or previous page of results. Contains encoded pagination state; when provided, page_size is ignored. ### Returns - `InstrumentGetInstrumentsResponse extends BaseResponse` - `data: InstrumentCoreList` - `id: string` Unique OEMS instrument identifier (UUID) - `country_of_issue: string` The ISO country code of the instrument's issue - `currency: string` The ISO currency code in which the instrument is traded - `easy_to_borrow: boolean` Indicates if the instrument is classified as Easy-To-Borrow - `is_liquidation_only: boolean` Indicates if the instrument is liquidation only and cannot be bought - `is_marginable: boolean` Indicates if the instrument is marginable - `is_restricted: boolean` Indicates if the instrument is restricted from trading - `is_short_prohibited: boolean` Indicates if short selling is prohibited for the instrument - `is_threshold_security: boolean` Indicates if the instrument is on the Regulation SHO Threshold Security List - `is_tradable: boolean` Indicates if the instrument is tradable - `symbol: string` The trading symbol for the instrument - `venue: string` The MIC code of the primary listing venue - `adv?: string | null` Average daily share volume from the security definition. - `expiry?: string | null` The expiration date for options instruments - `instrument_type?: SecurityType | null` The type of security (e.g., Common Stock, ETF) - `"COMMON_STOCK"` - `"PREFERRED_STOCK"` - `"OPTION"` - `"CASH"` - `"OTHER"` - `long_margin_rate?: string | null` The percent of a long position's value you must post as margin - `name?: string | null` The full name of the instrument or its issuer - `notional_adv?: string | null` Notional ADV (`adv × previous_close`). The primary liquidity signal used by `/instruments/search` ranking. Computed at response time so it stays consistent with whatever `adv` and `previous_close` show. - `previous_close?: string | null` Last close price from the security definition. - `short_margin_rate?: string | null` The percent of a short position's value you must post as margin - `strike_price?: string | null` The strike price for options instruments ### Example ```typescript import ClearStreet from '@clear-street-internal/sdk'; const client = new ClearStreet({ apiKey: 'My API Key', }); const response = await client.v1.instruments.getInstruments(); console.log(response); ``` #### Response ```json { "data": [ { "country_of_issue": "US", "currency": "USD", "easy_to_borrow": true, "id": "0f5a1a4e-5b3e-4d8f-9b7a-2b1d0e3f4a5b", "instrument_type": "COMMON_STOCK", "is_liquidation_only": false, "is_marginable": true, "is_restricted": false, "is_short_prohibited": false, "is_threshold_security": false, "is_tradable": true, "name": "Apple Inc.", "symbol": "AAPL", "venue": "XNMS" } ], "error": null, "metadata": { "next_page_token": "cGFnZT0yJmxhc3Rfc3ltYm9sPUdNRQ==", "page_number": 1, "request_id": "4a5b6c7d-8e9f-0a1b-2c3d-4e5f6a7b8c9d", "total_items": 10, "total_pages": 5 } } ``` ## Get Instrument By ID `client.v1.instruments.getInstrumentByID(InstrumentIDOrSymbolinstrumentID, InstrumentGetInstrumentByIDParamsquery?, RequestOptionsoptions?): InstrumentGetInstrumentByIDResponse` **get** `/v1/instruments/{instrument_id}` Retrieves detailed information for a specific instrument. ### Parameters - `instrument_id: InstrumentIDOrSymbol` OEMS instrument UUID - `query: InstrumentGetInstrumentByIDParams` - `include_options_expiry_dates?: boolean | null` When true, include unique options expiry dates for this instrument ### Returns - `InstrumentGetInstrumentByIDResponse extends BaseResponse` - `data: Instrument` Represents a tradable financial instrument. - `id: string` Unique OEMS instrument identifier (UUID) - `country_of_issue: string` The ISO country code of the instrument's issue - `currency: string` The ISO currency code in which the instrument is traded - `easy_to_borrow: boolean` Indicates if the instrument is classified as Easy-To-Borrow - `is_liquidation_only: boolean` Indicates if the instrument is liquidation only and cannot be bought - `is_marginable: boolean` Indicates if the instrument is marginable - `is_restricted: boolean` Indicates if the instrument is restricted from trading - `is_short_prohibited: boolean` Indicates if short selling is prohibited for the instrument - `is_threshold_security: boolean` Indicates if the instrument is on the Regulation SHO Threshold Security List - `is_tradable: boolean` Indicates if the instrument is tradable - `symbol: string` The trading symbol for the instrument - `venue: string` The MIC code of the primary listing venue - `adv?: string | null` Average daily share volume from the security definition. - `expiry?: string | null` The expiration date for options instruments - `instrument_type?: SecurityType | null` The type of security (e.g., Common Stock, ETF) - `"COMMON_STOCK"` - `"PREFERRED_STOCK"` - `"OPTION"` - `"CASH"` - `"OTHER"` - `long_margin_rate?: string | null` The percent of a long position's value you must post as margin - `name?: string | null` The full name of the instrument or its issuer - `notional_adv?: string | null` Notional ADV (`adv × previous_close`). The primary liquidity signal used by `/instruments/search` ranking. Computed at response time so it stays consistent with whatever `adv` and `previous_close` show. - `options_expiry_dates?: Array | null` Available options expiration dates for this instrument. Present only when `include_options_expiry_dates=true` in the request. - `previous_close?: string | null` Last close price from the security definition. - `short_margin_rate?: string | null` The percent of a short position's value you must post as margin - `strike_price?: string | null` The strike price for options instruments ### Example ```typescript import ClearStreet from '@clear-street-internal/sdk'; const client = new ClearStreet({ apiKey: 'My API Key', }); const response = await client.v1.instruments.getInstrumentByID( '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', ); console.log(response); ``` #### Response ```json { "data": { "country_of_issue": "US", "currency": "USD", "easy_to_borrow": true, "id": "0f5a1a4e-5b3e-4d8f-9b7a-2b1d0e3f4a5b", "instrument_type": "COMMON_STOCK", "is_liquidation_only": false, "is_marginable": true, "is_restricted": false, "is_short_prohibited": false, "is_threshold_security": false, "is_tradable": true, "long_margin_rate": "0.25", "name": "Apple Inc.", "short_margin_rate": "0.25", "symbol": "AAPL", "venue": "XNMS" }, "error": null, "metadata": { "request_id": "5b6c7d8e-9f0a-1b2c-3d4e-5f6a7b8c9d0e" } } ``` ## Search Instruments `client.v1.instruments.searchInstruments(InstrumentSearchInstrumentsParamsquery, RequestOptionsoptions?): InstrumentSearchInstrumentsResponse` **get** `/v1/instruments/search` Search instruments by symbol, alternate identifier, or company name. The `q` parameter is case-insensitive and supports ticker symbols, alternate identifiers such as CUSIP, ISIN, OPRA root, and CMS identifiers, and company names for non-option instruments. Results are ranked by match quality plus instrument quality signals including log-scaled ADV, listing status, marginability, easy-to-borrow status, and OTC, restricted, and liquidation-only penalties. Defaults to the `EQUITY` asset class (common stocks, preferred shares, ADRs, ETFs, and exchange-traded mutual funds). Pass `asset_class=OPTION` to search option contracts by symbol or alternate identifier. ### Parameters - `query: InstrumentSearchInstrumentsParams` - `q: string` Search term applied case-insensitively to ticker symbols, alternate identifiers (CUSIP, ISIN, OPRA root, CMS), and company names for non-option instruments. Option searches match symbols and alternate identifiers. - `asset_class?: string` Comma-separated asset classes (EQUITY|OPTION|WARRANT|BOND|FX|OTHER). Defaults to EQUITY. - `country?: string` Optional listing-country filter (e.g., US). - `currency?: string` Optional ISO currency filter (e.g., USD). - `include_inactive?: boolean` Include inactive instruments. Default false. - `include_restricted?: boolean` Include restricted instruments. Default true (penalized in ranking). - `page_size?: number` The number of items to return per page. Only used when page_token is not provided. - `page_token?: string` Token for retrieving the next or previous page of results. Contains encoded pagination state; when provided, page_size is ignored. ### Returns - `InstrumentSearchInstrumentsResponse extends BaseResponse` - `data: InstrumentCoreList` - `id: string` Unique OEMS instrument identifier (UUID) - `country_of_issue: string` The ISO country code of the instrument's issue - `currency: string` The ISO currency code in which the instrument is traded - `easy_to_borrow: boolean` Indicates if the instrument is classified as Easy-To-Borrow - `is_liquidation_only: boolean` Indicates if the instrument is liquidation only and cannot be bought - `is_marginable: boolean` Indicates if the instrument is marginable - `is_restricted: boolean` Indicates if the instrument is restricted from trading - `is_short_prohibited: boolean` Indicates if short selling is prohibited for the instrument - `is_threshold_security: boolean` Indicates if the instrument is on the Regulation SHO Threshold Security List - `is_tradable: boolean` Indicates if the instrument is tradable - `symbol: string` The trading symbol for the instrument - `venue: string` The MIC code of the primary listing venue - `adv?: string | null` Average daily share volume from the security definition. - `expiry?: string | null` The expiration date for options instruments - `instrument_type?: SecurityType | null` The type of security (e.g., Common Stock, ETF) - `"COMMON_STOCK"` - `"PREFERRED_STOCK"` - `"OPTION"` - `"CASH"` - `"OTHER"` - `long_margin_rate?: string | null` The percent of a long position's value you must post as margin - `name?: string | null` The full name of the instrument or its issuer - `notional_adv?: string | null` Notional ADV (`adv × previous_close`). The primary liquidity signal used by `/instruments/search` ranking. Computed at response time so it stays consistent with whatever `adv` and `previous_close` show. - `previous_close?: string | null` Last close price from the security definition. - `short_margin_rate?: string | null` The percent of a short position's value you must post as margin - `strike_price?: string | null` The strike price for options instruments ### Example ```typescript import ClearStreet from '@clear-street-internal/sdk'; const client = new ClearStreet({ apiKey: 'My API Key', }); const response = await client.v1.instruments.searchInstruments({ q: 'q' }); console.log(response); ``` #### Response ```json { "data": [ { "currency": "USD", "id": "0f5a1a4e-5b3e-4d8f-9b7a-2b1d0e3f4a5b", "instrument_type": "COMMON_STOCK", "is_marginable": true, "name": "Apple Inc.", "symbol": "AAPL", "venue": "XNMS" } ], "error": null, "metadata": { "request_id": "..." } } ``` ## Get Option Contracts `client.v1.instruments.getOptionContracts(InstrumentGetOptionContractsParamsquery?, RequestOptionsoptions?): InstrumentGetOptionContractsResponse` **get** `/v1/instruments/options/contracts` List options contracts. Returns options contracts for a given underlier with options-specific metadata. Exactly one underlier identifier must be provided. ### Parameters - `query: InstrumentGetOptionContractsParams` - `contract_type?: ContractType` Filter by contract type: CALL or PUT - `"CALL"` - `"PUT"` - `expiry?: string` Filter to contracts expiring on this date (YYYY-MM-DD) - `page_size?: number` The number of items to return per page. Only used when page_token is not provided. - `page_token?: string` Token for retrieving the next or previous page of results. Contains encoded pagination state; when provided, page_size is ignored. - `underlier?: string` Underlier symbol (e.g., AAPL, SPX) - `underlying_instrument_id?: InstrumentIDOrSymbol` OEMS instrument UUID or symbol of the underlying equity/index ### Returns - `InstrumentGetOptionContractsResponse extends BaseResponse` - `data: OptionsContractList` - `id: string` OEMS instrument identifier - `contract_type: ContractType` Whether this is a CALL or PUT - `"CALL"` - `"PUT"` - `currency: string` ISO currency code - `exchange: string` MIC code of the primary listing venue - `exercise_style: ExerciseStyle` Exercise style - `"AMERICAN"` - `"EUROPEAN"` - `expiry: string` Expiration date - `is_liquidation_only: boolean` Whether the contract is liquidation-only - `is_marginable: boolean` Whether the contract is marginable - `is_restricted: boolean` Whether the contract is restricted from trading - `listing_type: ListingType` Listing type - `"STANDARD"` - `"FLEX"` - `"OTC"` - `multiplier: string` Contract multiplier (100 for standard options) - `strike_price: string` Strike price - `symbol: string` OSI symbol (e.g. "AAPL 251219C00150000") - `open_interest?: number | null` Open interest (number of outstanding contracts), if available - `underlying_instrument_id?: string | null` OEMS instrument ID of the underlying instrument, if resolvable ### Example ```typescript import ClearStreet from '@clear-street-internal/sdk'; const client = new ClearStreet({ apiKey: 'My API Key', }); const response = await client.v1.instruments.getOptionContracts(); console.log(response); ``` #### Response ```json { "data": [ { "contract_type": "CALL", "currency": "USD", "exchange": "BATO", "exercise_style": "AMERICAN", "expiry": "2026-03-20", "id": "b6f4b5e2-94a8-4fe4-9a85-2b4a81d30cc5", "is_liquidation_only": false, "is_marginable": true, "is_restricted": false, "is_tradable": true, "listing_type": "STANDARD", "multiplier": "100", "strike_price": "180", "symbol": "AAPL 260320C00180000", "underlying_instrument_id": "a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8" }, { "contract_type": "PUT", "currency": "USD", "exchange": "BATO", "exercise_style": "AMERICAN", "expiry": "2026-03-20", "id": "c7e5c6f3-a5b9-5gf5-0b96-3c5b92e41dd6", "is_liquidation_only": false, "is_marginable": true, "is_restricted": false, "is_tradable": true, "listing_type": "STANDARD", "multiplier": "100", "strike_price": "180", "symbol": "AAPL 260320P00180000", "underlying_instrument_id": "a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8" } ], "metadata": { "page_number": 1, "request_id": "c2d0429d-c629-4ee1-b719-df007157f3bb", "total_items": 2, "total_pages": 1 } } ``` ## Domain Types ### Contract Type - `ContractType = "CALL" | "PUT"` The type of options contract - `"CALL"` - `"PUT"` ### Exercise Style - `ExerciseStyle = "AMERICAN" | "EUROPEAN"` The exercise style of an options contract - `"AMERICAN"` - `"EUROPEAN"` ### Instrument - `Instrument` Represents a tradable financial instrument. - `id: string` Unique OEMS instrument identifier (UUID) - `country_of_issue: string` The ISO country code of the instrument's issue - `currency: string` The ISO currency code in which the instrument is traded - `easy_to_borrow: boolean` Indicates if the instrument is classified as Easy-To-Borrow - `is_liquidation_only: boolean` Indicates if the instrument is liquidation only and cannot be bought - `is_marginable: boolean` Indicates if the instrument is marginable - `is_restricted: boolean` Indicates if the instrument is restricted from trading - `is_short_prohibited: boolean` Indicates if short selling is prohibited for the instrument - `is_threshold_security: boolean` Indicates if the instrument is on the Regulation SHO Threshold Security List - `is_tradable: boolean` Indicates if the instrument is tradable - `symbol: string` The trading symbol for the instrument - `venue: string` The MIC code of the primary listing venue - `adv?: string | null` Average daily share volume from the security definition. - `expiry?: string | null` The expiration date for options instruments - `instrument_type?: SecurityType | null` The type of security (e.g., Common Stock, ETF) - `"COMMON_STOCK"` - `"PREFERRED_STOCK"` - `"OPTION"` - `"CASH"` - `"OTHER"` - `long_margin_rate?: string | null` The percent of a long position's value you must post as margin - `name?: string | null` The full name of the instrument or its issuer - `notional_adv?: string | null` Notional ADV (`adv × previous_close`). The primary liquidity signal used by `/instruments/search` ranking. Computed at response time so it stays consistent with whatever `adv` and `previous_close` show. - `options_expiry_dates?: Array | null` Available options expiration dates for this instrument. Present only when `include_options_expiry_dates=true` in the request. - `previous_close?: string | null` Last close price from the security definition. - `short_margin_rate?: string | null` The percent of a short position's value you must post as margin - `strike_price?: string | null` The strike price for options instruments ### Instrument Core - `InstrumentCore` - `id: string` Unique OEMS instrument identifier (UUID) - `country_of_issue: string` The ISO country code of the instrument's issue - `currency: string` The ISO currency code in which the instrument is traded - `easy_to_borrow: boolean` Indicates if the instrument is classified as Easy-To-Borrow - `is_liquidation_only: boolean` Indicates if the instrument is liquidation only and cannot be bought - `is_marginable: boolean` Indicates if the instrument is marginable - `is_restricted: boolean` Indicates if the instrument is restricted from trading - `is_short_prohibited: boolean` Indicates if short selling is prohibited for the instrument - `is_threshold_security: boolean` Indicates if the instrument is on the Regulation SHO Threshold Security List - `is_tradable: boolean` Indicates if the instrument is tradable - `symbol: string` The trading symbol for the instrument - `venue: string` The MIC code of the primary listing venue - `adv?: string | null` Average daily share volume from the security definition. - `expiry?: string | null` The expiration date for options instruments - `instrument_type?: SecurityType | null` The type of security (e.g., Common Stock, ETF) - `"COMMON_STOCK"` - `"PREFERRED_STOCK"` - `"OPTION"` - `"CASH"` - `"OTHER"` - `long_margin_rate?: string | null` The percent of a long position's value you must post as margin - `name?: string | null` The full name of the instrument or its issuer - `notional_adv?: string | null` Notional ADV (`adv × previous_close`). The primary liquidity signal used by `/instruments/search` ranking. Computed at response time so it stays consistent with whatever `adv` and `previous_close` show. - `previous_close?: string | null` Last close price from the security definition. - `short_margin_rate?: string | null` The percent of a short position's value you must post as margin - `strike_price?: string | null` The strike price for options instruments ### Instrument Core List - `InstrumentCoreList = Array` - `id: string` Unique OEMS instrument identifier (UUID) - `country_of_issue: string` The ISO country code of the instrument's issue - `currency: string` The ISO currency code in which the instrument is traded - `easy_to_borrow: boolean` Indicates if the instrument is classified as Easy-To-Borrow - `is_liquidation_only: boolean` Indicates if the instrument is liquidation only and cannot be bought - `is_marginable: boolean` Indicates if the instrument is marginable - `is_restricted: boolean` Indicates if the instrument is restricted from trading - `is_short_prohibited: boolean` Indicates if short selling is prohibited for the instrument - `is_threshold_security: boolean` Indicates if the instrument is on the Regulation SHO Threshold Security List - `is_tradable: boolean` Indicates if the instrument is tradable - `symbol: string` The trading symbol for the instrument - `venue: string` The MIC code of the primary listing venue - `adv?: string | null` Average daily share volume from the security definition. - `expiry?: string | null` The expiration date for options instruments - `instrument_type?: SecurityType | null` The type of security (e.g., Common Stock, ETF) - `"COMMON_STOCK"` - `"PREFERRED_STOCK"` - `"OPTION"` - `"CASH"` - `"OTHER"` - `long_margin_rate?: string | null` The percent of a long position's value you must post as margin - `name?: string | null` The full name of the instrument or its issuer - `notional_adv?: string | null` Notional ADV (`adv × previous_close`). The primary liquidity signal used by `/instruments/search` ranking. Computed at response time so it stays consistent with whatever `adv` and `previous_close` show. - `previous_close?: string | null` Last close price from the security definition. - `short_margin_rate?: string | null` The percent of a short position's value you must post as margin - `strike_price?: string | null` The strike price for options instruments ### Listing Type - `ListingType = "STANDARD" | "FLEX" | "OTC"` The listing type of an options contract - `"STANDARD"` - `"FLEX"` - `"OTC"` ### Options Contract - `OptionsContract` An options contract with options-specific metadata - `id: string` OEMS instrument identifier - `contract_type: ContractType` Whether this is a CALL or PUT - `"CALL"` - `"PUT"` - `currency: string` ISO currency code - `exchange: string` MIC code of the primary listing venue - `exercise_style: ExerciseStyle` Exercise style - `"AMERICAN"` - `"EUROPEAN"` - `expiry: string` Expiration date - `is_liquidation_only: boolean` Whether the contract is liquidation-only - `is_marginable: boolean` Whether the contract is marginable - `is_restricted: boolean` Whether the contract is restricted from trading - `listing_type: ListingType` Listing type - `"STANDARD"` - `"FLEX"` - `"OTC"` - `multiplier: string` Contract multiplier (100 for standard options) - `strike_price: string` Strike price - `symbol: string` OSI symbol (e.g. "AAPL 251219C00150000") - `open_interest?: number | null` Open interest (number of outstanding contracts), if available - `underlying_instrument_id?: string | null` OEMS instrument ID of the underlying instrument, if resolvable ### Options Contract List - `OptionsContractList = Array` - `id: string` OEMS instrument identifier - `contract_type: ContractType` Whether this is a CALL or PUT - `"CALL"` - `"PUT"` - `currency: string` ISO currency code - `exchange: string` MIC code of the primary listing venue - `exercise_style: ExerciseStyle` Exercise style - `"AMERICAN"` - `"EUROPEAN"` - `expiry: string` Expiration date - `is_liquidation_only: boolean` Whether the contract is liquidation-only - `is_marginable: boolean` Whether the contract is marginable - `is_restricted: boolean` Whether the contract is restricted from trading - `listing_type: ListingType` Listing type - `"STANDARD"` - `"FLEX"` - `"OTC"` - `multiplier: string` Contract multiplier (100 for standard options) - `strike_price: string` Strike price - `symbol: string` OSI symbol (e.g. "AAPL 251219C00150000") - `open_interest?: number | null` Open interest (number of outstanding contracts), if available - `underlying_instrument_id?: string | null` OEMS instrument ID of the underlying instrument, if resolvable ### Instrument Get Instruments Response - `InstrumentGetInstrumentsResponse extends BaseResponse` - `data: InstrumentCoreList` - `id: string` Unique OEMS instrument identifier (UUID) - `country_of_issue: string` The ISO country code of the instrument's issue - `currency: string` The ISO currency code in which the instrument is traded - `easy_to_borrow: boolean` Indicates if the instrument is classified as Easy-To-Borrow - `is_liquidation_only: boolean` Indicates if the instrument is liquidation only and cannot be bought - `is_marginable: boolean` Indicates if the instrument is marginable - `is_restricted: boolean` Indicates if the instrument is restricted from trading - `is_short_prohibited: boolean` Indicates if short selling is prohibited for the instrument - `is_threshold_security: boolean` Indicates if the instrument is on the Regulation SHO Threshold Security List - `is_tradable: boolean` Indicates if the instrument is tradable - `symbol: string` The trading symbol for the instrument - `venue: string` The MIC code of the primary listing venue - `adv?: string | null` Average daily share volume from the security definition. - `expiry?: string | null` The expiration date for options instruments - `instrument_type?: SecurityType | null` The type of security (e.g., Common Stock, ETF) - `"COMMON_STOCK"` - `"PREFERRED_STOCK"` - `"OPTION"` - `"CASH"` - `"OTHER"` - `long_margin_rate?: string | null` The percent of a long position's value you must post as margin - `name?: string | null` The full name of the instrument or its issuer - `notional_adv?: string | null` Notional ADV (`adv × previous_close`). The primary liquidity signal used by `/instruments/search` ranking. Computed at response time so it stays consistent with whatever `adv` and `previous_close` show. - `previous_close?: string | null` Last close price from the security definition. - `short_margin_rate?: string | null` The percent of a short position's value you must post as margin - `strike_price?: string | null` The strike price for options instruments ### Instrument Get Instrument By ID Response - `InstrumentGetInstrumentByIDResponse extends BaseResponse` - `data: Instrument` Represents a tradable financial instrument. - `id: string` Unique OEMS instrument identifier (UUID) - `country_of_issue: string` The ISO country code of the instrument's issue - `currency: string` The ISO currency code in which the instrument is traded - `easy_to_borrow: boolean` Indicates if the instrument is classified as Easy-To-Borrow - `is_liquidation_only: boolean` Indicates if the instrument is liquidation only and cannot be bought - `is_marginable: boolean` Indicates if the instrument is marginable - `is_restricted: boolean` Indicates if the instrument is restricted from trading - `is_short_prohibited: boolean` Indicates if short selling is prohibited for the instrument - `is_threshold_security: boolean` Indicates if the instrument is on the Regulation SHO Threshold Security List - `is_tradable: boolean` Indicates if the instrument is tradable - `symbol: string` The trading symbol for the instrument - `venue: string` The MIC code of the primary listing venue - `adv?: string | null` Average daily share volume from the security definition. - `expiry?: string | null` The expiration date for options instruments - `instrument_type?: SecurityType | null` The type of security (e.g., Common Stock, ETF) - `"COMMON_STOCK"` - `"PREFERRED_STOCK"` - `"OPTION"` - `"CASH"` - `"OTHER"` - `long_margin_rate?: string | null` The percent of a long position's value you must post as margin - `name?: string | null` The full name of the instrument or its issuer - `notional_adv?: string | null` Notional ADV (`adv × previous_close`). The primary liquidity signal used by `/instruments/search` ranking. Computed at response time so it stays consistent with whatever `adv` and `previous_close` show. - `options_expiry_dates?: Array | null` Available options expiration dates for this instrument. Present only when `include_options_expiry_dates=true` in the request. - `previous_close?: string | null` Last close price from the security definition. - `short_margin_rate?: string | null` The percent of a short position's value you must post as margin - `strike_price?: string | null` The strike price for options instruments ### Instrument Search Instruments Response - `InstrumentSearchInstrumentsResponse extends BaseResponse` - `data: InstrumentCoreList` - `id: string` Unique OEMS instrument identifier (UUID) - `country_of_issue: string` The ISO country code of the instrument's issue - `currency: string` The ISO currency code in which the instrument is traded - `easy_to_borrow: boolean` Indicates if the instrument is classified as Easy-To-Borrow - `is_liquidation_only: boolean` Indicates if the instrument is liquidation only and cannot be bought - `is_marginable: boolean` Indicates if the instrument is marginable - `is_restricted: boolean` Indicates if the instrument is restricted from trading - `is_short_prohibited: boolean` Indicates if short selling is prohibited for the instrument - `is_threshold_security: boolean` Indicates if the instrument is on the Regulation SHO Threshold Security List - `is_tradable: boolean` Indicates if the instrument is tradable - `symbol: string` The trading symbol for the instrument - `venue: string` The MIC code of the primary listing venue - `adv?: string | null` Average daily share volume from the security definition. - `expiry?: string | null` The expiration date for options instruments - `instrument_type?: SecurityType | null` The type of security (e.g., Common Stock, ETF) - `"COMMON_STOCK"` - `"PREFERRED_STOCK"` - `"OPTION"` - `"CASH"` - `"OTHER"` - `long_margin_rate?: string | null` The percent of a long position's value you must post as margin - `name?: string | null` The full name of the instrument or its issuer - `notional_adv?: string | null` Notional ADV (`adv × previous_close`). The primary liquidity signal used by `/instruments/search` ranking. Computed at response time so it stays consistent with whatever `adv` and `previous_close` show. - `previous_close?: string | null` Last close price from the security definition. - `short_margin_rate?: string | null` The percent of a short position's value you must post as margin - `strike_price?: string | null` The strike price for options instruments ### Instrument Get Option Contracts Response - `InstrumentGetOptionContractsResponse extends BaseResponse` - `data: OptionsContractList` - `id: string` OEMS instrument identifier - `contract_type: ContractType` Whether this is a CALL or PUT - `"CALL"` - `"PUT"` - `currency: string` ISO currency code - `exchange: string` MIC code of the primary listing venue - `exercise_style: ExerciseStyle` Exercise style - `"AMERICAN"` - `"EUROPEAN"` - `expiry: string` Expiration date - `is_liquidation_only: boolean` Whether the contract is liquidation-only - `is_marginable: boolean` Whether the contract is marginable - `is_restricted: boolean` Whether the contract is restricted from trading - `listing_type: ListingType` Listing type - `"STANDARD"` - `"FLEX"` - `"OTC"` - `multiplier: string` Contract multiplier (100 for standard options) - `strike_price: string` Strike price - `symbol: string` OSI symbol (e.g. "AAPL 251219C00150000") - `open_interest?: number | null` Open interest (number of outstanding contracts), if available - `underlying_instrument_id?: string | null` OEMS instrument ID of the underlying instrument, if resolvable # Omni AI ## Domain Types ### Action Button - `ActionButton` Button metadata shared by chart and suggested-actions payloads. - `buttonId: string` Stable button identifier within the content part. - `label: string` User-visible label. - `prompt?: PromptButtonAction | null` Follow-up prompt to submit as the next user message. - `prompt: string` Prompt text to submit as the next user turn. - `structuredAction?: StructuredActionButtonAction | null` Structured action in the same message to execute on click. - `actionId?: string | null` UUID of a `structured_action` content part in the same message. ### Chart Payload - `ChartPayload` Typed chart payload rendered inline in assistant content. - `chartId: string` Stable chart identifier scoped to the content part. - `actionButtons?: Array` Buttons associated with this chart. - `buttonId: string` Stable button identifier within the content part. - `label: string` User-visible label. - `prompt?: PromptButtonAction | null` Follow-up prompt to submit as the next user message. - `prompt: string` Prompt text to submit as the next user turn. - `structuredAction?: StructuredActionButtonAction | null` Structured action in the same message to execute on click. - `actionId?: string | null` UUID of a `structured_action` content part in the same message. - `dataChart?: DataChart | null` Explicit series-driven chart definition. - `series?: Array` - `name: string` - `points?: Array` - `x: string` - `y: number` - `symbolChart?: SymbolChart | null` Symbol-driven chart definition. - `symbol: string` - `timeframe?: string | null` ### Chart Point - `ChartPoint` Single chart coordinate. - `x: string` - `y: number` ### Chart Series - `ChartSeries` Named data series within a chart. - `name: string` - `points?: Array` - `x: string` - `y: number` ### Content Part Chart Payload - `ContentPartChartPayload` Chart payload content part. - `payload: ChartPayload` Typed chart payload rendered inline in assistant content. - `chartId: string` Stable chart identifier scoped to the content part. - `actionButtons?: Array` Buttons associated with this chart. - `buttonId: string` Stable button identifier within the content part. - `label: string` User-visible label. - `prompt?: PromptButtonAction | null` Follow-up prompt to submit as the next user message. - `prompt: string` Prompt text to submit as the next user turn. - `structuredAction?: StructuredActionButtonAction | null` Structured action in the same message to execute on click. - `actionId?: string | null` UUID of a `structured_action` content part in the same message. - `dataChart?: DataChart | null` Explicit series-driven chart definition. - `series?: Array` - `name: string` - `points?: Array` - `x: string` - `y: number` - `symbolChart?: SymbolChart | null` Symbol-driven chart definition. - `symbol: string` - `timeframe?: string | null` ### Content Part Custom Payload - `ContentPartCustomPayload` Escape-hatch custom payload content part. - `payload: unknown` ### Content Part Structured Action Payload - `ContentPartStructuredActionPayload` Structured action content part. - `action: StructuredAction` Structured actions that Omni AI can return to clients. These actions provide machine-readable instructions for the client to execute, such as prefilling an order ticket, opening a chart, or navigating to a route. - `PrefillOrder` Prefill an order ticket for user confirmation - `prefill_order: PrefillOrderAction` Prefill an order ticket for user confirmation - `PrefillNewOrderAction extends PrefillNewOrderAction` Create one or more new orders. - `action_type: "NEW"` - `"NEW"` - `PrefillCancelOrderAction extends PrefillCancelOrderAction` Cancel one or more existing orders. - `action_type: "CANCEL"` - `"CANCEL"` - `OpenChart` Open a chart for a symbol - `open_chart: OpenChartAction` Open a chart for a symbol - `symbol: string` Trading symbol to chart - `extras?: unknown` Additional chart configuration (indicators, overlays, etc.) - `timeframe?: string | null` Chart timeframe (e.g., "1D", "1W", "1M", "3M", "1Y", "5Y") - `OpenScreener` Open a stock screener with filters - `open_screener: OpenScreenerAction` Open a stock screener with filters - `filters: Array` Filter criteria for the screener - `field: string` Field to filter on (e.g., "market_cap", "sector", "price") - `operator: string` Comparison operator (e.g., "eq", "gte", "lte", "in") - `value: unknown` Filter value - `field_filter?: Array | null` Optional field/column selection for screener results. - `page_size?: number | null` Optional page size. - `sort_by?: string | null` Optional sort field for screener rows. - `sort_direction?: string | null` Optional sort direction (`ASC` or `DESC`). - `OpenEntitlementConsent` Open entitlement consent flow - `open_entitlement_consent: OpenEntitlementConsentAction` Open entitlement consent flow - `agreement_key: EntitlementAgreementKey` Stable entitlement agreement family key. - `"omni_account_data_access"` - `reason: string` - `requested_entitlement_codes: Array` - `"omni.account_data"` - `trading_account_ids: Array` - `action_id: string` ### Content Part Suggested Actions Payload - `ContentPartSuggestedActionsPayload` Suggested actions payload content part. - `payload: SuggestedActionsPayload` Suggested follow-up buttons rendered at the end of an assistant message. - `actionButtons?: Array` Ordered message-level buttons. - `buttonId: string` Stable button identifier within the content part. - `label: string` User-visible label. - `prompt?: PromptButtonAction | null` Follow-up prompt to submit as the next user message. - `prompt: string` Prompt text to submit as the next user turn. - `structuredAction?: StructuredActionButtonAction | null` Structured action in the same message to execute on click. - `actionId?: string | null` UUID of a `structured_action` content part in the same message. ### Content Part Text Payload - `ContentPartTextPayload` Text content part. - `text: string` ### Content Part Thinking Payload - `ContentPartThinkingPayload` Thinking content part shown on dynamic response polling. - `thoughts: Array` ### Data Chart - `DataChart` Chart represented by explicit data series. - `series?: Array` - `name: string` - `points?: Array` - `x: string` - `y: number` ### Open Chart Action - `OpenChartAction` Action to open a chart for a symbol. - `symbol: string` Trading symbol to chart - `extras?: unknown` Additional chart configuration (indicators, overlays, etc.) - `timeframe?: string | null` Chart timeframe (e.g., "1D", "1W", "1M", "3M", "1Y", "5Y") ### Open Entitlement Consent Action - `OpenEntitlementConsentAction` Action to open entitlement consent flow for one or more accounts. - `agreement_key: EntitlementAgreementKey` Stable entitlement agreement family key. - `"omni_account_data_access"` - `reason: string` - `requested_entitlement_codes: Array` - `"omni.account_data"` - `trading_account_ids: Array` ### Open Screener Action - `OpenScreenerAction` Action to open a stock screener with filters. - `filters: Array` Filter criteria for the screener - `field: string` Field to filter on (e.g., "market_cap", "sector", "price") - `operator: string` Comparison operator (e.g., "eq", "gte", "lte", "in") - `value: unknown` Filter value - `field_filter?: Array | null` Optional field/column selection for screener results. - `page_size?: number | null` Optional page size. - `sort_by?: string | null` Optional sort field for screener rows. - `sort_direction?: string | null` Optional sort direction (`ASC` or `DESC`). ### Prefill Cancel Order Action - `PrefillCancelOrderAction` Cancel-order prefill action. - `orders: Array` Orders to cancel using the same identifiers required by the cancel-order API. - `account_id: number` Account ID (from path parameter) - `order_id: string` Order ID to cancel (from path parameter) ### Prefill New Order Action - `PrefillNewOrderAction` New-order prefill action. - `orders: Array` Orders to prefill using the same shape accepted by the orders API. - `instrument_type: SecurityType` Type of security - `"COMMON_STOCK"` - `"PREFERRED_STOCK"` - `"OPTION"` - `"CASH"` - `"OTHER"` - `order_type: RequestOrderType` Type of order - `"MARKET"` - `"LIMIT"` - `"STOP"` - `"STOP_LIMIT"` - `"TRAILING_STOP"` - `"TRAILING_STOP_LIMIT"` - `quantity: string` Quantity to trade. For COMMON_STOCK: shares (may be fractional if supported). For OPTION (single-leg): contracts (must be an integer) - `side: Side` Side of the order - `"BUY"` - `"SELL"` - `"SELL_SHORT"` - `"OTHER"` - `time_in_force: RequestTimeInForce` Time in force - `"DAY"` - `"GOOD_TILL_CANCEL"` - `"IMMEDIATE_OR_CANCEL"` - `"FILL_OR_KILL"` - `"GOOD_TILL_DATE"` - `"AT_THE_OPENING"` - `"AT_THE_CLOSE"` - `"GOOD_TILL_CROSSING"` - `"GOOD_THROUGH_CROSSING"` - `"AT_CROSSING"` - `id?: string | null` Optional client-provided unique ID (idempotency). Required to be unique per account. - `expires_at?: string | null` The timestamp when the order should expire (UTC). Required when time_in_force is GOOD_TILL_DATE. - `extended_hours?: boolean | null` Allow trading outside regular trading hours. Some brokers disallow options outside RTH. - `instrument_id?: InstrumentIDOrSymbol | null` OEMS instrument UUID - `limit_offset?: string | null` Limit offset for trailing stop-limit orders (signed) - `limit_price?: string | null` Limit price (required for LIMIT and STOP_LIMIT orders) - `position_effect?: PositionEffect` Required when instrument_type is OPTION. Specifies whether the order opens or closes a position. - `"OPEN"` - `"CLOSE"` - `stop_price?: string | null` Stop price (required for STOP and STOP_LIMIT orders) - `symbol?: string | null` Trading symbol. For equities, use the ticker symbol (e.g., "AAPL"). For options, use the OSI symbol (e.g., "AAPL 250117C00190000"). Either `symbol` or `instrument_id` must be provided. - `trailing_offset?: string | null` Trailing offset amount (required for trailing orders) - `trailing_offset_type?: TrailingOffsetType | null` Trailing offset type (PRICE or PERCENT_BPS) - `"PRICE"` - `"BPS"` ### Prefill Order Action - `PrefillOrderAction = PrefillNewOrderAction | PrefillCancelOrderAction` Action to prefill order details for user confirmation. The user must review and authorize the order before submission to the trading API. This action provides parsed order data that can be used to prefill an order ticket UI or submitted directly via the orders API after user confirmation. - `PrefillNewOrderAction extends PrefillNewOrderAction` Create one or more new orders. - `action_type: "NEW"` - `"NEW"` - `PrefillCancelOrderAction extends PrefillCancelOrderAction` Cancel one or more existing orders. - `action_type: "CANCEL"` - `"CANCEL"` ### Prompt Button Action - `PromptButtonAction` Prompt-style button behavior. - `prompt: string` Prompt text to submit as the next user turn. ### Screener Filter - `ScreenerFilter` A single filter criterion for the screener. - `field: string` Field to filter on (e.g., "market_cap", "sector", "price") - `operator: string` Comparison operator (e.g., "eq", "gte", "lte", "in") - `value: unknown` Filter value ### Structured Action - `StructuredAction = PrefillOrder | OpenChart | OpenScreener | OpenEntitlementConsent` Structured actions that Omni AI can return to clients. These actions provide machine-readable instructions for the client to execute, such as prefilling an order ticket, opening a chart, or navigating to a route. - `PrefillOrder` Prefill an order ticket for user confirmation - `prefill_order: PrefillOrderAction` Prefill an order ticket for user confirmation - `PrefillNewOrderAction extends PrefillNewOrderAction` Create one or more new orders. - `action_type: "NEW"` - `"NEW"` - `PrefillCancelOrderAction extends PrefillCancelOrderAction` Cancel one or more existing orders. - `action_type: "CANCEL"` - `"CANCEL"` - `OpenChart` Open a chart for a symbol - `open_chart: OpenChartAction` Open a chart for a symbol - `symbol: string` Trading symbol to chart - `extras?: unknown` Additional chart configuration (indicators, overlays, etc.) - `timeframe?: string | null` Chart timeframe (e.g., "1D", "1W", "1M", "3M", "1Y", "5Y") - `OpenScreener` Open a stock screener with filters - `open_screener: OpenScreenerAction` Open a stock screener with filters - `filters: Array` Filter criteria for the screener - `field: string` Field to filter on (e.g., "market_cap", "sector", "price") - `operator: string` Comparison operator (e.g., "eq", "gte", "lte", "in") - `value: unknown` Filter value - `field_filter?: Array | null` Optional field/column selection for screener results. - `page_size?: number | null` Optional page size. - `sort_by?: string | null` Optional sort field for screener rows. - `sort_direction?: string | null` Optional sort direction (`ASC` or `DESC`). - `OpenEntitlementConsent` Open entitlement consent flow - `open_entitlement_consent: OpenEntitlementConsentAction` Open entitlement consent flow - `agreement_key: EntitlementAgreementKey` Stable entitlement agreement family key. - `"omni_account_data_access"` - `reason: string` - `requested_entitlement_codes: Array` - `"omni.account_data"` - `trading_account_ids: Array` ### Structured Action Button Action - `StructuredActionButtonAction` Structured-action button behavior. - `actionId?: string | null` UUID of a `structured_action` content part in the same message. ### Suggested Actions Payload - `SuggestedActionsPayload` Suggested follow-up buttons rendered at the end of an assistant message. - `actionButtons?: Array` Ordered message-level buttons. - `buttonId: string` Stable button identifier within the content part. - `label: string` User-visible label. - `prompt?: PromptButtonAction | null` Follow-up prompt to submit as the next user message. - `prompt: string` Prompt text to submit as the next user turn. - `structuredAction?: StructuredActionButtonAction | null` Structured action in the same message to execute on click. - `actionId?: string | null` UUID of a `structured_action` content part in the same message. ### Symbol Chart - `SymbolChart` Chart for a single symbol and timeframe. - `symbol: string` - `timeframe?: string | null` # Entitlements ## Get Entitlements `client.v1.omniAI.entitlements.getEntitlements(EntitlementGetEntitlementsParamsquery?, RequestOptionsoptions?): EntitlementGetEntitlementsResponse` **get** `/v1/omni-ai/entitlements` List caller's active entitlement grants. ### Parameters - `query: EntitlementGetEntitlementsParams` - `trading_account_id?: number` ### Returns - `EntitlementGetEntitlementsResponse extends BaseResponse` - `data: EntitlementResourceList` - `agreement_id: string` - `entitlement_code: EntitlementCode` Stable entitlement code granted by an agreement. - `"omni.account_data"` - `entitlement_id: string` - `granted_at: string` - `trading_account_id: number` ### Example ```typescript import ClearStreet from '@clear-street-internal/sdk'; const client = new ClearStreet({ apiKey: 'My API Key', }); const response = await client.v1.omniAI.entitlements.getEntitlements(); console.log(response); ``` #### Response ```json { "metadata": { "request_id": "request_id", "next_page_token": "U3RhaW5sZXNzIHJvY2tz", "page_number": 0, "previous_page_token": "U3RhaW5sZXNzIHJvY2tz", "total_items": 0, "total_pages": 0 }, "error": { "code": 400, "message": "Order quantity must be greater than zero", "details": [ { "foo": "bar" } ] }, "data": [ { "agreement_id": "agreement_id", "entitlement_code": "omni.account_data", "entitlement_id": "entitlement_id", "granted_at": "granted_at", "trading_account_id": 0 } ] } ``` ## Create Entitlements `client.v1.omniAI.entitlements.createEntitlements(EntitlementCreateEntitlementsParamsbody, RequestOptionsoptions?): EntitlementCreateEntitlementsResponse` **post** `/v1/omni-ai/entitlements` Record consent and upsert one-or-more active grants. ### Parameters - `body: EntitlementCreateEntitlementsParams` - `agreement_id: string` - `requested_entitlement_codes: Array` - `"omni.account_data"` - `trading_account_ids: Array` ### Returns - `EntitlementCreateEntitlementsResponse extends BaseResponse` - `data: EntitlementResourceList` - `agreement_id: string` - `entitlement_code: EntitlementCode` Stable entitlement code granted by an agreement. - `"omni.account_data"` - `entitlement_id: string` - `granted_at: string` - `trading_account_id: number` ### Example ```typescript import ClearStreet from '@clear-street-internal/sdk'; const client = new ClearStreet({ apiKey: 'My API Key', }); const response = await client.v1.omniAI.entitlements.createEntitlements({ agreement_id: '01JZ0000000000000000000000', requested_entitlement_codes: ['omni.account_data'], trading_account_ids: [100019, 100021], }); console.log(response); ``` #### Response ```json { "metadata": { "request_id": "request_id", "next_page_token": "U3RhaW5sZXNzIHJvY2tz", "page_number": 0, "previous_page_token": "U3RhaW5sZXNzIHJvY2tz", "total_items": 0, "total_pages": 0 }, "error": { "code": 400, "message": "Order quantity must be greater than zero", "details": [ { "foo": "bar" } ] }, "data": [ { "agreement_id": "agreement_id", "entitlement_code": "omni.account_data", "entitlement_id": "entitlement_id", "granted_at": "granted_at", "trading_account_id": 0 } ] } ``` ## Delete Entitlement `client.v1.omniAI.entitlements.deleteEntitlement(stringentitlementID, RequestOptionsoptions?): EntitlementDeleteEntitlementResponse` **delete** `/v1/omni-ai/entitlements/{entitlement_id}` Revoke one entitlement grant by id. ### Parameters - `entitlementID: string` ### Returns - `EntitlementDeleteEntitlementResponse extends BaseResponse` - `data: DeleteEntitlementResponse` - `entitlement_id: string` - `revoked: boolean` ### Example ```typescript import ClearStreet from '@clear-street-internal/sdk'; const client = new ClearStreet({ apiKey: 'My API Key', }); const response = await client.v1.omniAI.entitlements.deleteEntitlement('entitlement_id'); console.log(response); ``` #### Response ```json { "metadata": { "request_id": "request_id", "next_page_token": "U3RhaW5sZXNzIHJvY2tz", "page_number": 0, "previous_page_token": "U3RhaW5sZXNzIHJvY2tz", "total_items": 0, "total_pages": 0 }, "error": { "code": 400, "message": "Order quantity must be greater than zero", "details": [ { "foo": "bar" } ] }, "data": { "entitlement_id": "entitlement_id", "revoked": true } } ``` ## Get Entitlement Agreements `client.v1.omniAI.entitlements.getEntitlementAgreements(RequestOptionsoptions?): EntitlementGetEntitlementAgreementsResponse` **get** `/v1/omni-ai/entitlement-agreements` List current signable entitlement agreements for consent UX. ### Returns - `EntitlementGetEntitlementAgreementsResponse extends BaseResponse` - `data: EntitlementAgreementResourceList` - `agreement_id: string` - `agreement_key: EntitlementAgreementKey` Stable entitlement agreement family key. - `"omni_account_data_access"` - `document_content: string` - `document_sha256: string` - `entitlement_codes: Array` - `"omni.account_data"` - `title: string` - `version: number` ### Example ```typescript import ClearStreet from '@clear-street-internal/sdk'; const client = new ClearStreet({ apiKey: 'My API Key', }); const response = await client.v1.omniAI.entitlements.getEntitlementAgreements(); console.log(response); ``` #### Response ```json { "metadata": { "request_id": "request_id", "next_page_token": "U3RhaW5sZXNzIHJvY2tz", "page_number": 0, "previous_page_token": "U3RhaW5sZXNzIHJvY2tz", "total_items": 0, "total_pages": 0 }, "error": { "code": 400, "message": "Order quantity must be greater than zero", "details": [ { "foo": "bar" } ] }, "data": [ { "agreement_id": "agreement_id", "agreement_key": "omni_account_data_access", "document_content": "document_content", "document_sha256": "document_sha256", "entitlement_codes": [ "omni.account_data" ], "title": "title", "version": 0 } ] } ``` ## Domain Types ### Delete Entitlement Response - `DeleteEntitlementResponse` - `entitlement_id: string` - `revoked: boolean` ### Entitlement Agreement Key - `EntitlementAgreementKey = "omni_account_data_access"` Stable entitlement agreement family key. - `"omni_account_data_access"` ### Entitlement Agreement Resource - `EntitlementAgreementResource` - `agreement_id: string` - `agreement_key: EntitlementAgreementKey` Stable entitlement agreement family key. - `"omni_account_data_access"` - `document_content: string` - `document_sha256: string` - `entitlement_codes: Array` - `"omni.account_data"` - `title: string` - `version: number` ### Entitlement Agreement Resource List - `EntitlementAgreementResourceList = Array` - `agreement_id: string` - `agreement_key: EntitlementAgreementKey` Stable entitlement agreement family key. - `"omni_account_data_access"` - `document_content: string` - `document_sha256: string` - `entitlement_codes: Array` - `"omni.account_data"` - `title: string` - `version: number` ### Entitlement Code - `EntitlementCode = "omni.account_data"` Stable entitlement code granted by an agreement. - `"omni.account_data"` ### Entitlement Resource - `EntitlementResource` - `agreement_id: string` - `entitlement_code: EntitlementCode` Stable entitlement code granted by an agreement. - `"omni.account_data"` - `entitlement_id: string` - `granted_at: string` - `trading_account_id: number` ### Entitlement Resource List - `EntitlementResourceList = Array` - `agreement_id: string` - `entitlement_code: EntitlementCode` Stable entitlement code granted by an agreement. - `"omni.account_data"` - `entitlement_id: string` - `granted_at: string` - `trading_account_id: number` ### Entitlement Get Entitlements Response - `EntitlementGetEntitlementsResponse extends BaseResponse` - `data: EntitlementResourceList` - `agreement_id: string` - `entitlement_code: EntitlementCode` Stable entitlement code granted by an agreement. - `"omni.account_data"` - `entitlement_id: string` - `granted_at: string` - `trading_account_id: number` ### Entitlement Create Entitlements Response - `EntitlementCreateEntitlementsResponse extends BaseResponse` - `data: EntitlementResourceList` - `agreement_id: string` - `entitlement_code: EntitlementCode` Stable entitlement code granted by an agreement. - `"omni.account_data"` - `entitlement_id: string` - `granted_at: string` - `trading_account_id: number` ### Entitlement Delete Entitlement Response - `EntitlementDeleteEntitlementResponse extends BaseResponse` - `data: DeleteEntitlementResponse` - `entitlement_id: string` - `revoked: boolean` ### Entitlement Get Entitlement Agreements Response - `EntitlementGetEntitlementAgreementsResponse extends BaseResponse` - `data: EntitlementAgreementResourceList` - `agreement_id: string` - `agreement_key: EntitlementAgreementKey` Stable entitlement agreement family key. - `"omni_account_data_access"` - `document_content: string` - `document_sha256: string` - `entitlement_codes: Array` - `"omni.account_data"` - `title: string` - `version: number` # Messages ## Get Message By ID `client.v1.omniAI.messages.getMessageByID(stringmessageID, MessageGetMessageByIDParamsquery, RequestOptionsoptions?): MessageGetMessageByIDResponse` **get** `/v1/omni-ai/messages/{message_id}` Get a finalized message by ID. Returns a single finalized message. Returns **404** if the message belongs to an in-progress assistant turn (use the response endpoint for live output). Once the turn completes, the message becomes available here. ### Parameters - `messageID: string` - `query: MessageGetMessageByIDParams` - `account_id: number` Account ID for the request ### Returns - `MessageGetMessageByIDResponse extends BaseResponse` - `data: Message` Final immutable message. - `id: string` - `content: MessageContent` Finalized immutable message content container. Never includes thinking parts. - `parts: Array` - `UnionMember0 extends ContentPartTextPayload` Text content part. - `type: "text"` - `"text"` - `UnionMember1 extends ContentPartStructuredActionPayload` Structured action content part. - `type: "structured_action"` - `"structured_action"` - `UnionMember2 extends ContentPartChartPayload` Chart payload content part. - `type: "chart"` - `"chart"` - `UnionMember3 extends ContentPartSuggestedActionsPayload` Suggested actions payload content part. - `type: "suggested_actions"` - `"suggested_actions"` - `UnionMember4 extends ContentPartCustomPayload` Escape-hatch custom payload content part. - `type: "custom"` - `"custom"` - `created_at: string` - `outcome: MessageOutcome` Immutable terminal outcome for a finalized assistant message. - `"completed"` - `"errored"` - `"canceled"` - `role: MessageRole` Finalized message role in the public contract. - `"USER"` - `"ASSISTANT"` - `seq: number` - `thread_id: string` - `error?: ErrorStatus | null` Shared sanitized error payload. - `code: string` - `message: string` - `details?: unknown` ### Example ```typescript import ClearStreet from '@clear-street-internal/sdk'; const client = new ClearStreet({ apiKey: 'My API Key', }); const response = await client.v1.omniAI.messages.getMessageByID( '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { account_id: 0 }, ); console.log(response); ``` #### Response ```json { "data": { "content": { "parts": [ { "text": "**Pre-market as of 7:30 AM ET**\n\n ...", "type": "text" }, { "payload": { "actionButtons": [ { "buttonId": "btn_followup_0", "label": "Check my positions", "prompt": { "prompt": "What are my current positions?" } } ] }, "type": "suggested_actions" } ] }, "created_at": "2026-04-16T09:20:17.309212+00:00", "id": "019d9597-599c-7132-a7de-e5c21eaaab77", "outcome": "completed", "role": "ASSISTANT", "seq": 2, "thread_id": "019d9597-597c-7571-a0c9-a49c0e51f6eb" }, "metadata": { "request_id": "0f991501-757d-4051-bf00-6d7f452d6fcf" } } ``` ## Submit Feedback `client.v1.omniAI.messages.submitFeedback(stringmessageID, MessageSubmitFeedbackParamsbody, RequestOptionsoptions?): MessageSubmitFeedbackResponse` **post** `/v1/omni-ai/messages/{message_id}/feedback` Submit feedback on a finalized assistant message. Attaches a score and optional comment to a finalized assistant message. Feedback is only valid for messages with role `ASSISTANT` that have reached a terminal outcome. ### Parameters - `messageID: string` - `body: MessageSubmitFeedbackParams` - `account_id: number` Account ID for the request - `score: number` Feedback score (-1, 0, +1 or 1-5) - `comment?: string` Optional feedback comment - `metadata?: unknown` Optional metadata ### Returns - `MessageSubmitFeedbackResponse extends BaseResponse` - `data: CreateFeedbackResponse` - `created_at: string` - `feedback_id?: string | null` ### Example ```typescript import ClearStreet from '@clear-street-internal/sdk'; const client = new ClearStreet({ apiKey: 'My API Key', }); const response = await client.v1.omniAI.messages.submitFeedback( '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { account_id: 0, score: 0 }, ); console.log(response); ``` #### Response ```json { "data": { "created_at": "2026-04-23T16:09:51.746912+00:00", "feedback_id": "019dbb1a-d782-7f42-8dd8-a1a7ca5d48e3" }, "metadata": { "request_id": "372a359a-fd4f-4c69-8f11-d80831aa5f23" } } ``` ## Domain Types ### Create Feedback Response - `CreateFeedbackResponse` - `created_at: string` - `feedback_id?: string | null` ### Message Get Message By ID Response - `MessageGetMessageByIDResponse extends BaseResponse` - `data: Message` Final immutable message. - `id: string` - `content: MessageContent` Finalized immutable message content container. Never includes thinking parts. - `parts: Array` - `UnionMember0 extends ContentPartTextPayload` Text content part. - `type: "text"` - `"text"` - `UnionMember1 extends ContentPartStructuredActionPayload` Structured action content part. - `type: "structured_action"` - `"structured_action"` - `UnionMember2 extends ContentPartChartPayload` Chart payload content part. - `type: "chart"` - `"chart"` - `UnionMember3 extends ContentPartSuggestedActionsPayload` Suggested actions payload content part. - `type: "suggested_actions"` - `"suggested_actions"` - `UnionMember4 extends ContentPartCustomPayload` Escape-hatch custom payload content part. - `type: "custom"` - `"custom"` - `created_at: string` - `outcome: MessageOutcome` Immutable terminal outcome for a finalized assistant message. - `"completed"` - `"errored"` - `"canceled"` - `role: MessageRole` Finalized message role in the public contract. - `"USER"` - `"ASSISTANT"` - `seq: number` - `thread_id: string` - `error?: ErrorStatus | null` Shared sanitized error payload. - `code: string` - `message: string` - `details?: unknown` ### Message Submit Feedback Response - `MessageSubmitFeedbackResponse extends BaseResponse` - `data: CreateFeedbackResponse` - `created_at: string` - `feedback_id?: string | null` # Responses ## Get Response By ID `client.v1.omniAI.responses.getResponseByID(stringresponseID, ResponseGetResponseByIDParamsquery, RequestOptionsoptions?): ResponseGetResponseByIDResponse` **get** `/v1/omni-ai/responses/{response_id}` Poll a response for assistant output. Returns the current snapshot of an in-progress or completed response. While the status is `queued` or `running`, the content may be partial and may include `thinking` parts. Poll this endpoint periodically until the status reaches a terminal value (`succeeded`, `failed`, or `canceled`). Once terminal, the finalized assistant message is available in thread history via `GET /omni-ai/threads/{thread_id}/messages`. ### Parameters - `responseID: string` - `query: ResponseGetResponseByIDParams` - `account_id: number` Account ID for the request ### Returns - `ResponseGetResponseByIDResponse extends BaseResponse` - `data: Response` Dynamic pollable response. - `id: string` - `status: ResponseStatus` Dynamic lifecycle status for a pollable response. - `"queued"` - `"running"` - `"succeeded"` - `"failed"` - `"canceled"` - `thread_id: string` - `user_message_id: string` - `content?: ResponseContent | null` Dynamic response content container. May include thinking parts. - `parts: Array` - `UnionMember0 extends ContentPartTextPayload` Text content part. - `type: "text"` - `"text"` - `UnionMember1 extends ContentPartThinkingPayload` Thinking content part shown on dynamic response polling. - `type: "thinking"` - `"thinking"` - `UnionMember2 extends ContentPartStructuredActionPayload` Structured action content part. - `type: "structured_action"` - `"structured_action"` - `UnionMember3 extends ContentPartChartPayload` Chart payload content part. - `type: "chart"` - `"chart"` - `UnionMember4 extends ContentPartSuggestedActionsPayload` Suggested actions payload content part. - `type: "suggested_actions"` - `"suggested_actions"` - `UnionMember5 extends ContentPartCustomPayload` Escape-hatch custom payload content part. - `type: "custom"` - `"custom"` - `error?: ErrorStatus | null` Shared sanitized error payload. - `code: string` - `message: string` - `details?: unknown` - `output_message_id?: string | null` ### Example ```typescript import ClearStreet from '@clear-street-internal/sdk'; const client = new ClearStreet({ apiKey: 'My API Key', }); const response = await client.v1.omniAI.responses.getResponseByID( '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { account_id: 0 }, ); console.log(response); ``` #### Response ```json { "data": { "content": { "parts": [ { "text": "AAPL is currently trading at ...", "type": "text" }, { "thoughts": [ "Fetching current market data for AAPL..." ], "type": "thinking" } ] }, "id": "019dbafd-db54-7523-a412-ec9195cc5d99", "output_message_id": "019dbafd-db61-73a0-8bd9-d4034d132f81", "status": "succeeded", "thread_id": "019dbafd-db54-7523-a412-ec8a292246ad", "user_message_id": "019dbafd-db56-78a2-8a91-d54a39f44174" }, "metadata": { "request_id": "abc16101-2cbc-475a-84ef-98c8c588dcbb" } } ``` ## Cancel Response `client.v1.omniAI.responses.cancelResponse(stringresponseID, ResponseCancelResponseParamsparams, RequestOptionsoptions?): ResponseCancelResponseResponse` **delete** `/v1/omni-ai/responses/{response_id}` Cancel a response. Requests cancellation of a queued or running response. If the response has already reached a terminal status, this is an idempotent success. A canceled turn still produces a final assistant message with outcome `canceled` in the thread history. ### Parameters - `responseID: string` - `params: ResponseCancelResponseParams` - `account_id: number` Account ID for the request ### Returns - `ResponseCancelResponseResponse extends BaseResponse` - `data: CancelResponsePayload` - `canceled: boolean` ### Example ```typescript import ClearStreet from '@clear-street-internal/sdk'; const client = new ClearStreet({ apiKey: 'My API Key', }); const response = await client.v1.omniAI.responses.cancelResponse( '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { account_id: 0 }, ); console.log(response); ``` #### Response ```json { "data": { "canceled": false }, "metadata": { "request_id": "fa26a786-f5d3-48b0-80eb-778e17af4964" } } ``` ## Domain Types ### Cancel Response Payload - `CancelResponsePayload` - `canceled: boolean` ### Error Status - `ErrorStatus` Shared sanitized error payload. - `code: string` - `message: string` - `details?: unknown` ### Response - `Response` Dynamic pollable response. - `id: string` - `status: ResponseStatus` Dynamic lifecycle status for a pollable response. - `"queued"` - `"running"` - `"succeeded"` - `"failed"` - `"canceled"` - `thread_id: string` - `user_message_id: string` - `content?: ResponseContent | null` Dynamic response content container. May include thinking parts. - `parts: Array` - `UnionMember0 extends ContentPartTextPayload` Text content part. - `type: "text"` - `"text"` - `UnionMember1 extends ContentPartThinkingPayload` Thinking content part shown on dynamic response polling. - `type: "thinking"` - `"thinking"` - `UnionMember2 extends ContentPartStructuredActionPayload` Structured action content part. - `type: "structured_action"` - `"structured_action"` - `UnionMember3 extends ContentPartChartPayload` Chart payload content part. - `type: "chart"` - `"chart"` - `UnionMember4 extends ContentPartSuggestedActionsPayload` Suggested actions payload content part. - `type: "suggested_actions"` - `"suggested_actions"` - `UnionMember5 extends ContentPartCustomPayload` Escape-hatch custom payload content part. - `type: "custom"` - `"custom"` - `error?: ErrorStatus | null` Shared sanitized error payload. - `code: string` - `message: string` - `details?: unknown` - `output_message_id?: string | null` ### Response Content - `ResponseContent` Dynamic response content container. May include thinking parts. - `parts: Array` - `UnionMember0 extends ContentPartTextPayload` Text content part. - `type: "text"` - `"text"` - `UnionMember1 extends ContentPartThinkingPayload` Thinking content part shown on dynamic response polling. - `type: "thinking"` - `"thinking"` - `UnionMember2 extends ContentPartStructuredActionPayload` Structured action content part. - `type: "structured_action"` - `"structured_action"` - `UnionMember3 extends ContentPartChartPayload` Chart payload content part. - `type: "chart"` - `"chart"` - `UnionMember4 extends ContentPartSuggestedActionsPayload` Suggested actions payload content part. - `type: "suggested_actions"` - `"suggested_actions"` - `UnionMember5 extends ContentPartCustomPayload` Escape-hatch custom payload content part. - `type: "custom"` - `"custom"` ### Response Content Part - `ResponseContentPart = UnionMember0 | UnionMember1 | UnionMember2 | 3 more` Dynamic content part visible on a pollable response. - `UnionMember0 extends ContentPartTextPayload` Text content part. - `type: "text"` - `"text"` - `UnionMember1 extends ContentPartThinkingPayload` Thinking content part shown on dynamic response polling. - `type: "thinking"` - `"thinking"` - `UnionMember2 extends ContentPartStructuredActionPayload` Structured action content part. - `type: "structured_action"` - `"structured_action"` - `UnionMember3 extends ContentPartChartPayload` Chart payload content part. - `type: "chart"` - `"chart"` - `UnionMember4 extends ContentPartSuggestedActionsPayload` Suggested actions payload content part. - `type: "suggested_actions"` - `"suggested_actions"` - `UnionMember5 extends ContentPartCustomPayload` Escape-hatch custom payload content part. - `type: "custom"` - `"custom"` ### Response Status - `ResponseStatus = "queued" | "running" | "succeeded" | 2 more` Dynamic lifecycle status for a pollable response. - `"queued"` - `"running"` - `"succeeded"` - `"failed"` - `"canceled"` ### Response Get Response By ID Response - `ResponseGetResponseByIDResponse extends BaseResponse` - `data: Response` Dynamic pollable response. - `id: string` - `status: ResponseStatus` Dynamic lifecycle status for a pollable response. - `"queued"` - `"running"` - `"succeeded"` - `"failed"` - `"canceled"` - `thread_id: string` - `user_message_id: string` - `content?: ResponseContent | null` Dynamic response content container. May include thinking parts. - `parts: Array` - `UnionMember0 extends ContentPartTextPayload` Text content part. - `type: "text"` - `"text"` - `UnionMember1 extends ContentPartThinkingPayload` Thinking content part shown on dynamic response polling. - `type: "thinking"` - `"thinking"` - `UnionMember2 extends ContentPartStructuredActionPayload` Structured action content part. - `type: "structured_action"` - `"structured_action"` - `UnionMember3 extends ContentPartChartPayload` Chart payload content part. - `type: "chart"` - `"chart"` - `UnionMember4 extends ContentPartSuggestedActionsPayload` Suggested actions payload content part. - `type: "suggested_actions"` - `"suggested_actions"` - `UnionMember5 extends ContentPartCustomPayload` Escape-hatch custom payload content part. - `type: "custom"` - `"custom"` - `error?: ErrorStatus | null` Shared sanitized error payload. - `code: string` - `message: string` - `details?: unknown` - `output_message_id?: string | null` ### Response Cancel Response Response - `ResponseCancelResponseResponse extends BaseResponse` - `data: CancelResponsePayload` - `canceled: boolean` # Threads ## Get Threads `client.v1.omniAI.threads.getThreads(ThreadGetThreadsParamsquery, RequestOptionsoptions?): ThreadGetThreadsResponse` **get** `/v1/omni-ai/threads` List conversation threads. Returns thread metadata ordered by most recently created first. Use `page_size` and `page_token` for pagination. Thread objects contain only metadata (title, timestamps) — use the messages endpoint for conversation history. ### Parameters - `query: ThreadGetThreadsParams` - `account_id: number` Account ID for the request - `page_size?: number` The number of items to return per page. Only used when page_token is not provided. - `page_token?: string` Token for retrieving the next or previous page of results. Contains encoded pagination state; when provided, page_size is ignored. ### Returns - `ThreadGetThreadsResponse extends BaseResponse` - `data: ThreadList` - `id: string` - `created_at: string` - `title: string` - `updated_at: string` ### Example ```typescript import ClearStreet from '@clear-street-internal/sdk'; const client = new ClearStreet({ apiKey: 'My API Key', }); const response = await client.v1.omniAI.threads.getThreads({ account_id: 0 }); console.log(response); ``` #### Response ```json { "data": [ { "created_at": "2026-04-23T15:15:54.929830+00:00", "id": "019dbae9-73b3-7fe0-bd14-25fe57e91475", "title": "What is current price of AAPL?", "updated_at": "2026-04-23T15:15:54.929830+00:00" } ], "metadata": { "request_id": "eb95e1b8-d245-41b1-bbd0-cc1073e68bfd" } } ``` ## Get Thread By ID `client.v1.omniAI.threads.getThreadByID(stringthreadID, ThreadGetThreadByIDParamsquery, RequestOptionsoptions?): ThreadGetThreadByIDResponse` **get** `/v1/omni-ai/threads/{thread_id}` Get a specific thread. Returns metadata (title, timestamps) for a single thread. Does not include messages — use `GET /omni-ai/threads/{thread_id}/messages` for conversation history. ### Parameters - `threadID: string` - `query: ThreadGetThreadByIDParams` - `account_id: number` Account ID for the request ### Returns - `ThreadGetThreadByIDResponse extends BaseResponse` - `data: Thread` Thread metadata returned by list/get thread endpoints. - `id: string` - `created_at: string` - `title: string` - `updated_at: string` ### Example ```typescript import ClearStreet from '@clear-street-internal/sdk'; const client = new ClearStreet({ apiKey: 'My API Key', }); const response = await client.v1.omniAI.threads.getThreadByID( '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { account_id: 0 }, ); console.log(response); ``` #### Response ```json { "data": { "created_at": "2026-04-23T15:15:54.929830+00:00", "id": "019dbae9-73b3-7fe0-bd14-25fe57e91475", "title": "What is current price of AAPL?", "updated_at": "2026-04-23T15:15:54.929830+00:00" }, "metadata": { "request_id": "5683a394-6dd1-4843-8591-f102ced2e636" } } ``` ## Create Thread `client.v1.omniAI.threads.createThread(ThreadCreateThreadParamsbody, RequestOptionsoptions?): ThreadCreateThreadResponse` **post** `/v1/omni-ai/threads` Create a new conversation thread. Atomically creates a new thread and submits the first user turn. The response contains a `response_id` that should be polled via `GET /omni-ai/responses/{response_id}` for assistant output. Two creation modes are supported: - **instant** — provide `text` with a natural-language prompt. - **deep\_insights** — provide a `target` ticker and optional `thesis` for long-form research. ### Parameters - `body: ThreadCreateThreadParams` - `account_id: number` - `type: "instant" | "deep_insights"` Thread creation mode. - `"instant"` - `"deep_insights"` - `capabilities?: Array<"PREFILL_ORDER" | "OPEN_CHART" | "OPEN_SCREENER" | "OPEN_ENTITLEMENT_CONSENT">` - `"PREFILL_ORDER"` - `"OPEN_CHART"` - `"OPEN_SCREENER"` - `"OPEN_ENTITLEMENT_CONSENT"` - `target?: Target | null` Deep-insights target payload. - `ticker: string` - `type: "ticker"` Deep-insights target type. Launch supports ticker-only. - `"ticker"` - `text?: string | null` - `thesis?: string | null` ### Returns - `ThreadCreateThreadResponse extends BaseResponse` - `data: CreateThreadResponse` Response payload for thread creation. - `response_id: string` - `thread_id: string` - `user_message_id: string` ### Example ```typescript import ClearStreet from '@clear-street-internal/sdk'; const client = new ClearStreet({ apiKey: 'My API Key', }); const response = await client.v1.omniAI.threads.createThread({ account_id: 19816, type: 'instant', }); console.log(response); ``` #### Response ```json { "data": { "response_id": "019dbae9-73b4-7760-a947-8b4bcab57c49", "thread_id": "019dbae9-73b3-7fe0-bd14-25fe57e91475", "user_message_id": "019dbae9-73b8-75b2-9c06-ac348927696d" }, "metadata": { "request_id": "f7a9ad4d-753a-403e-aa0e-ca151f991a81" } } ``` ## Get Thread Response `client.v1.omniAI.threads.getThreadResponse(stringthreadID, ThreadGetThreadResponseParamsquery, RequestOptionsoptions?): ThreadGetThreadResponseResponse` **get** `/v1/omni-ai/threads/{thread_id}/response` Get the active response for a thread. Convenience endpoint to look up the currently active response for a thread without knowing the `response_id`. Useful when reloading a thread whose last finalized message is a `USER` message — this indicates an assistant turn is likely in progress. Returns **404** if no active response exists (the thread is idle). ### Parameters - `threadID: string` - `query: ThreadGetThreadResponseParams` - `account_id: number` Account ID for the request ### Returns - `ThreadGetThreadResponseResponse extends BaseResponse` - `data: Response` Dynamic pollable response. - `id: string` - `status: ResponseStatus` Dynamic lifecycle status for a pollable response. - `"queued"` - `"running"` - `"succeeded"` - `"failed"` - `"canceled"` - `thread_id: string` - `user_message_id: string` - `content?: ResponseContent | null` Dynamic response content container. May include thinking parts. - `parts: Array` - `UnionMember0 extends ContentPartTextPayload` Text content part. - `type: "text"` - `"text"` - `UnionMember1 extends ContentPartThinkingPayload` Thinking content part shown on dynamic response polling. - `type: "thinking"` - `"thinking"` - `UnionMember2 extends ContentPartStructuredActionPayload` Structured action content part. - `type: "structured_action"` - `"structured_action"` - `UnionMember3 extends ContentPartChartPayload` Chart payload content part. - `type: "chart"` - `"chart"` - `UnionMember4 extends ContentPartSuggestedActionsPayload` Suggested actions payload content part. - `type: "suggested_actions"` - `"suggested_actions"` - `UnionMember5 extends ContentPartCustomPayload` Escape-hatch custom payload content part. - `type: "custom"` - `"custom"` - `error?: ErrorStatus | null` Shared sanitized error payload. - `code: string` - `message: string` - `details?: unknown` - `output_message_id?: string | null` ### Example ```typescript import ClearStreet from '@clear-street-internal/sdk'; const client = new ClearStreet({ apiKey: 'My API Key', }); const response = await client.v1.omniAI.threads.getThreadResponse( '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { account_id: 0 }, ); console.log(response); ``` #### Response ```json { "data": { "content": { "parts": [ { "text": "", "type": "text" }, { "thoughts": [ "[1/4] Running parallel analysis on AAPL -- fundamentals, technicals, sentiment, and macro..." ], "type": "thinking" } ] }, "id": "019dbb03-cf23-74e1-9c31-ef0136ff7fed", "output_message_id": "019dbb03-cf32-74d1-906b-a148d4be3da9", "status": "running", "thread_id": "019dbb03-cf22-7da0-a663-f51c756efa07", "user_message_id": "019dbb03-cf24-7b03-8286-5bfc2411b052" }, "metadata": { "request_id": "927a85a6-b11b-4cc5-a2cd-3f46ae64e85d" } } ``` ## Get Messages `client.v1.omniAI.threads.getMessages(stringthreadID, ThreadGetMessagesParamsquery, RequestOptionsoptions?): ThreadGetMessagesResponse` **get** `/v1/omni-ai/threads/{thread_id}/messages` List finalized messages in a thread. Returns **finalized** messages in chronological order. Messages from in-progress assistant turns are excluded — use `GET /omni-ai/threads/{thread_id}/response` or `GET /omni-ai/responses/{response_id}` for live output. If the last finalized message has role `USER`, an active response likely exists and should be polled separately. ### Parameters - `threadID: string` - `query: ThreadGetMessagesParams` - `account_id: number` Account ID for the request - `page_size?: number` The number of items to return per page. Only used when page_token is not provided. - `page_token?: string` Token for retrieving the next or previous page of results. Contains encoded pagination state; when provided, page_size is ignored. ### Returns - `ThreadGetMessagesResponse extends BaseResponse` - `data: MessageList` - `id: string` - `content: MessageContent` Finalized immutable message content container. Never includes thinking parts. - `parts: Array` - `UnionMember0 extends ContentPartTextPayload` Text content part. - `type: "text"` - `"text"` - `UnionMember1 extends ContentPartStructuredActionPayload` Structured action content part. - `type: "structured_action"` - `"structured_action"` - `UnionMember2 extends ContentPartChartPayload` Chart payload content part. - `type: "chart"` - `"chart"` - `UnionMember3 extends ContentPartSuggestedActionsPayload` Suggested actions payload content part. - `type: "suggested_actions"` - `"suggested_actions"` - `UnionMember4 extends ContentPartCustomPayload` Escape-hatch custom payload content part. - `type: "custom"` - `"custom"` - `created_at: string` - `outcome: MessageOutcome` Immutable terminal outcome for a finalized assistant message. - `"completed"` - `"errored"` - `"canceled"` - `role: MessageRole` Finalized message role in the public contract. - `"USER"` - `"ASSISTANT"` - `seq: number` - `thread_id: string` - `error?: ErrorStatus | null` Shared sanitized error payload. - `code: string` - `message: string` - `details?: unknown` ### Example ```typescript import ClearStreet from '@clear-street-internal/sdk'; const client = new ClearStreet({ apiKey: 'My API Key', }); const response = await client.v1.omniAI.threads.getMessages( '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { account_id: 0 }, ); console.log(response); ``` #### Response ```json { "data": [ { "content": { "parts": [ { "text": "How are the markets doing today?", "type": "text" } ] }, "created_at": "2026-04-16T09:20:17.274943+00:00", "id": "019d9597-5983-7691-8281-7ce264127740", "outcome": "completed", "role": "USER", "seq": 1, "thread_id": "019d9597-597c-7571-a0c9-a49c0e51f6eb" }, { "content": { "parts": [ { "text": "**Pre-market as of 7:30 AM ET**\n\n ...", "type": "text" }, { "payload": { "actionButtons": [ { "buttonId": "btn_followup_0", "label": "Check my positions", "prompt": { "prompt": "What are my current positions?" } } ] }, "type": "suggested_actions" } ] }, "created_at": "2026-04-16T09:20:17.309212+00:00", "id": "019d9597-599c-7132-a7de-e5c21eaaab77", "outcome": "completed", "role": "ASSISTANT", "seq": 2, "thread_id": "019d9597-597c-7571-a0c9-a49c0e51f6eb" } ], "metadata": { "request_id": "664c0f85-cdab-4fac-afe3-8ecc0148cd4a" } } ``` ## Create Message `client.v1.omniAI.threads.createMessage(stringthreadID, ThreadCreateMessageParamsbody, RequestOptionsoptions?): ThreadCreateMessageResponse` **post** `/v1/omni-ai/threads/{thread_id}/messages` Continue an existing conversation thread. Appends a new user message to the thread and starts an assistant response. Only one response may be active per thread at a time — if the previous turn is still in progress, this endpoint returns **409 Conflict**. Wait for the active response to reach a terminal status before submitting the next turn. Poll the returned `response_id` via `GET /omni-ai/responses/{response_id}` for assistant output. ### Parameters - `threadID: string` - `body: ThreadCreateMessageParams` - `account_id: number` - `text: string` - `capabilities?: Array<"PREFILL_ORDER" | "OPEN_CHART" | "OPEN_SCREENER" | "OPEN_ENTITLEMENT_CONSENT">` - `"PREFILL_ORDER"` - `"OPEN_CHART"` - `"OPEN_SCREENER"` - `"OPEN_ENTITLEMENT_CONSENT"` ### Returns - `ThreadCreateMessageResponse extends BaseResponse` - `data: CreateMessageResponse` Response payload for continuing a thread with a new message. - `response_id: string` - `thread_id: string` - `user_message_id: string` ### Example ```typescript import ClearStreet from '@clear-street-internal/sdk'; const client = new ClearStreet({ apiKey: 'My API Key', }); const response = await client.v1.omniAI.threads.createMessage( '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { account_id: 19816, text: 'Compare that to AMD.' }, ); console.log(response); ``` #### Response ```json { "data": { "response_id": "019dbaec-8dd3-7fa3-89d0-5303609f125f", "thread_id": "019dbae9-73b3-7fe0-bd14-25fe57e91475", "user_message_id": "019dbaec-8dd4-7f91-bce2-3ec8fba79eb7" }, "metadata": { "request_id": "48775400-61f4-4c6c-bc6d-8f4996c571c7" } } ``` ## Domain Types ### Create Message Response - `CreateMessageResponse` Response payload for continuing a thread with a new message. - `response_id: string` - `thread_id: string` - `user_message_id: string` ### Create Thread Response - `CreateThreadResponse` Response payload for thread creation. - `response_id: string` - `thread_id: string` - `user_message_id: string` ### Message - `Message` Final immutable message. - `id: string` - `content: MessageContent` Finalized immutable message content container. Never includes thinking parts. - `parts: Array` - `UnionMember0 extends ContentPartTextPayload` Text content part. - `type: "text"` - `"text"` - `UnionMember1 extends ContentPartStructuredActionPayload` Structured action content part. - `type: "structured_action"` - `"structured_action"` - `UnionMember2 extends ContentPartChartPayload` Chart payload content part. - `type: "chart"` - `"chart"` - `UnionMember3 extends ContentPartSuggestedActionsPayload` Suggested actions payload content part. - `type: "suggested_actions"` - `"suggested_actions"` - `UnionMember4 extends ContentPartCustomPayload` Escape-hatch custom payload content part. - `type: "custom"` - `"custom"` - `created_at: string` - `outcome: MessageOutcome` Immutable terminal outcome for a finalized assistant message. - `"completed"` - `"errored"` - `"canceled"` - `role: MessageRole` Finalized message role in the public contract. - `"USER"` - `"ASSISTANT"` - `seq: number` - `thread_id: string` - `error?: ErrorStatus | null` Shared sanitized error payload. - `code: string` - `message: string` - `details?: unknown` ### Message Content - `MessageContent` Finalized immutable message content container. Never includes thinking parts. - `parts: Array` - `UnionMember0 extends ContentPartTextPayload` Text content part. - `type: "text"` - `"text"` - `UnionMember1 extends ContentPartStructuredActionPayload` Structured action content part. - `type: "structured_action"` - `"structured_action"` - `UnionMember2 extends ContentPartChartPayload` Chart payload content part. - `type: "chart"` - `"chart"` - `UnionMember3 extends ContentPartSuggestedActionsPayload` Suggested actions payload content part. - `type: "suggested_actions"` - `"suggested_actions"` - `UnionMember4 extends ContentPartCustomPayload` Escape-hatch custom payload content part. - `type: "custom"` - `"custom"` ### Message Content Part - `MessageContentPart = UnionMember0 | UnionMember1 | UnionMember2 | 2 more` Final immutable content part visible on persisted messages. - `UnionMember0 extends ContentPartTextPayload` Text content part. - `type: "text"` - `"text"` - `UnionMember1 extends ContentPartStructuredActionPayload` Structured action content part. - `type: "structured_action"` - `"structured_action"` - `UnionMember2 extends ContentPartChartPayload` Chart payload content part. - `type: "chart"` - `"chart"` - `UnionMember3 extends ContentPartSuggestedActionsPayload` Suggested actions payload content part. - `type: "suggested_actions"` - `"suggested_actions"` - `UnionMember4 extends ContentPartCustomPayload` Escape-hatch custom payload content part. - `type: "custom"` - `"custom"` ### Message List - `MessageList = Array` - `id: string` - `content: MessageContent` Finalized immutable message content container. Never includes thinking parts. - `parts: Array` - `UnionMember0 extends ContentPartTextPayload` Text content part. - `type: "text"` - `"text"` - `UnionMember1 extends ContentPartStructuredActionPayload` Structured action content part. - `type: "structured_action"` - `"structured_action"` - `UnionMember2 extends ContentPartChartPayload` Chart payload content part. - `type: "chart"` - `"chart"` - `UnionMember3 extends ContentPartSuggestedActionsPayload` Suggested actions payload content part. - `type: "suggested_actions"` - `"suggested_actions"` - `UnionMember4 extends ContentPartCustomPayload` Escape-hatch custom payload content part. - `type: "custom"` - `"custom"` - `created_at: string` - `outcome: MessageOutcome` Immutable terminal outcome for a finalized assistant message. - `"completed"` - `"errored"` - `"canceled"` - `role: MessageRole` Finalized message role in the public contract. - `"USER"` - `"ASSISTANT"` - `seq: number` - `thread_id: string` - `error?: ErrorStatus | null` Shared sanitized error payload. - `code: string` - `message: string` - `details?: unknown` ### Message Outcome - `MessageOutcome = "completed" | "errored" | "canceled"` Immutable terminal outcome for a finalized assistant message. - `"completed"` - `"errored"` - `"canceled"` ### Message Role - `MessageRole = "USER" | "ASSISTANT"` Finalized message role in the public contract. - `"USER"` - `"ASSISTANT"` ### Thread - `Thread` Thread metadata returned by list/get thread endpoints. - `id: string` - `created_at: string` - `title: string` - `updated_at: string` ### Thread List - `ThreadList = Array` - `id: string` - `created_at: string` - `title: string` - `updated_at: string` ### Thread Get Threads Response - `ThreadGetThreadsResponse extends BaseResponse` - `data: ThreadList` - `id: string` - `created_at: string` - `title: string` - `updated_at: string` ### Thread Get Thread By ID Response - `ThreadGetThreadByIDResponse extends BaseResponse` - `data: Thread` Thread metadata returned by list/get thread endpoints. - `id: string` - `created_at: string` - `title: string` - `updated_at: string` ### Thread Create Thread Response - `ThreadCreateThreadResponse extends BaseResponse` - `data: CreateThreadResponse` Response payload for thread creation. - `response_id: string` - `thread_id: string` - `user_message_id: string` ### Thread Get Thread Response Response - `ThreadGetThreadResponseResponse extends BaseResponse` - `data: Response` Dynamic pollable response. - `id: string` - `status: ResponseStatus` Dynamic lifecycle status for a pollable response. - `"queued"` - `"running"` - `"succeeded"` - `"failed"` - `"canceled"` - `thread_id: string` - `user_message_id: string` - `content?: ResponseContent | null` Dynamic response content container. May include thinking parts. - `parts: Array` - `UnionMember0 extends ContentPartTextPayload` Text content part. - `type: "text"` - `"text"` - `UnionMember1 extends ContentPartThinkingPayload` Thinking content part shown on dynamic response polling. - `type: "thinking"` - `"thinking"` - `UnionMember2 extends ContentPartStructuredActionPayload` Structured action content part. - `type: "structured_action"` - `"structured_action"` - `UnionMember3 extends ContentPartChartPayload` Chart payload content part. - `type: "chart"` - `"chart"` - `UnionMember4 extends ContentPartSuggestedActionsPayload` Suggested actions payload content part. - `type: "suggested_actions"` - `"suggested_actions"` - `UnionMember5 extends ContentPartCustomPayload` Escape-hatch custom payload content part. - `type: "custom"` - `"custom"` - `error?: ErrorStatus | null` Shared sanitized error payload. - `code: string` - `message: string` - `details?: unknown` - `output_message_id?: string | null` ### Thread Get Messages Response - `ThreadGetMessagesResponse extends BaseResponse` - `data: MessageList` - `id: string` - `content: MessageContent` Finalized immutable message content container. Never includes thinking parts. - `parts: Array` - `UnionMember0 extends ContentPartTextPayload` Text content part. - `type: "text"` - `"text"` - `UnionMember1 extends ContentPartStructuredActionPayload` Structured action content part. - `type: "structured_action"` - `"structured_action"` - `UnionMember2 extends ContentPartChartPayload` Chart payload content part. - `type: "chart"` - `"chart"` - `UnionMember3 extends ContentPartSuggestedActionsPayload` Suggested actions payload content part. - `type: "suggested_actions"` - `"suggested_actions"` - `UnionMember4 extends ContentPartCustomPayload` Escape-hatch custom payload content part. - `type: "custom"` - `"custom"` - `created_at: string` - `outcome: MessageOutcome` Immutable terminal outcome for a finalized assistant message. - `"completed"` - `"errored"` - `"canceled"` - `role: MessageRole` Finalized message role in the public contract. - `"USER"` - `"ASSISTANT"` - `seq: number` - `thread_id: string` - `error?: ErrorStatus | null` Shared sanitized error payload. - `code: string` - `message: string` - `details?: unknown` ### Thread Create Message Response - `ThreadCreateMessageResponse extends BaseResponse` - `data: CreateMessageResponse` Response payload for continuing a thread with a new message. - `response_id: string` - `thread_id: string` - `user_message_id: string` # Orders ## Get Orders `client.v1.orders.getOrders(numberaccountID, OrderGetOrdersParamsquery?, RequestOptionsoptions?): OrderGetOrdersResponse` **get** `/v1/accounts/{account_id}/orders` List orders for an account with optional filtering ### Parameters - `accountID: number` - `query: OrderGetOrdersParams` - `from?: string` The start date and time for the query range, inclusive (ISO 8601 format) - `instrument_ids?: Array` Comma-separated OEMS instrument UUIDs - `instrument_type?: "COMMON_STOCK" | "PREFERRED_STOCK" | "OPTION" | 2 more` Instrument type filter (e.g., COMMON_STOCK, OPTION) - `"COMMON_STOCK"` - `"PREFERRED_STOCK"` - `"OPTION"` - `"CASH"` - `"OTHER"` - `page_size?: number` The number of items to return per page. Only used when page_token is not provided. - `page_token?: string` Token for retrieving the next or previous page of results. Contains encoded pagination state; when provided, page_size is ignored. - `status?: Array<"PENDING_NEW" | "NEW" | "PARTIALLY_FILLED" | 12 more>` Comma-separated order statuses to filter by - `"PENDING_NEW"` - `"NEW"` - `"PARTIALLY_FILLED"` - `"FILLED"` - `"CANCELED"` - `"REJECTED"` - `"EXPIRED"` - `"PENDING_CANCEL"` - `"PENDING_REPLACE"` - `"REPLACED"` - `"DONE_FOR_DAY"` - `"STOPPED"` - `"SUSPENDED"` - `"CALCULATED"` - `"OTHER"` - `symbol?: string` Filter by symbol - `to?: string` The end date and time for the query range, inclusive (ISO 8601 format) - `underlying_instrument_ids?: string` Comma-separated OEMS instrument UUIDs. Matches options orders whose resolved underlier is any of the given IDs. ### Returns - `OrderGetOrdersResponse extends BaseResponse` - `data: OrderList` - `id: string` Engine-assigned unique identifier for this order (UUID). - `account_id: number` Account placing the order - `client_order_id: string` Client-provided identifier echoed back (FIX tag 11). - `created_at: string` Timestamp when order was created (UTC) - `filled_quantity: string` Cumulative filled quantity - `instrument_id: string` OEMS instrument UUID for the traded instrument. - `instrument_type: SecurityType` Type of security - `"COMMON_STOCK"` - `"PREFERRED_STOCK"` - `"OPTION"` - `"CASH"` - `"OTHER"` - `leaves_quantity: string` Remaining unfilled quantity - `order_type: OrderType` Type of order (MARKET, LIMIT, etc.) - `"MARKET"` - `"LIMIT"` - `"STOP"` - `"STOP_LIMIT"` - `"TRAILING_STOP"` - `"TRAILING_STOP_LIMIT"` - `"OTHER"` - `quantity: string` Total order quantity - `side: Side` Side of the order (BUY, SELL, SELL_SHORT) - `"BUY"` - `"SELL"` - `"SELL_SHORT"` - `"OTHER"` - `status: OrderStatus` Current status of the order - `"PENDING_NEW"` - `"NEW"` - `"PARTIALLY_FILLED"` - `"FILLED"` - `"CANCELED"` - `"REJECTED"` - `"EXPIRED"` - `"PENDING_CANCEL"` - `"PENDING_REPLACE"` - `"REPLACED"` - `"DONE_FOR_DAY"` - `"STOPPED"` - `"SUSPENDED"` - `"CALCULATED"` - `"OTHER"` - `symbol: string` Trading symbol - `time_in_force: TimeInForce` Time in force instruction - `"DAY"` - `"GOOD_TILL_CANCEL"` - `"IMMEDIATE_OR_CANCEL"` - `"FILL_OR_KILL"` - `"GOOD_TILL_DATE"` - `"AT_THE_OPENING"` - `"AT_THE_CLOSE"` - `"GOOD_TILL_CROSSING"` - `"GOOD_THROUGH_CROSSING"` - `"AT_CROSSING"` - `"OTHER"` - `updated_at: string` Timestamp of the most recent update (UTC) - `venue: string` MIC code of the venue where the order is routed - `average_fill_price?: string | null` Average fill price across all executions - `details?: Array` Contains execution, rejection or cancellation details, if any - `expires_at?: string | null` Timestamp when the order will expire (UTC). Present when time_in_force is GOOD_TILL_DATE. - `extended_hours?: boolean | null` Whether the order is eligible for extended-hours trading. - `limit_offset?: string | null` Limit offset for trailing stop-limit orders (signed) - `limit_price?: string | null` Limit price (for LIMIT and STOP_LIMIT orders) - `queue_state?: QueueState | null` Parent order queue state, present when the order is awaiting release or released. - `"AWAITING_RELEASE"` - `"RELEASED"` - `releases_at?: string | null` Scheduled release time for orders awaiting release. - `stop_price?: string | null` Stop price (for STOP and STOP_LIMIT orders) - `trailing_limit_px?: string | null` Current trailing limit price computed by the trailing strategy - `trailing_offset?: string | null` Trailing offset amount for trailing orders - `trailing_offset_type?: TrailingOffsetType | null` Trailing offset type for trailing orders - `"PRICE"` - `"BPS"` - `trailing_stop_px?: string | null` Current trailing stop price computed by the trailing strategy - `trailing_watermark_px?: string | null` Trailing watermark price for trailing orders - `trailing_watermark_ts?: string | null` Trailing watermark timestamp for trailing orders - `underlying_instrument_id?: string | null` OEMS instrument ID of the option's underlying instrument. Populated only for OPTIONS orders; `null` for non-options and for options whose underlier cannot be resolved from the instrument cache. ### Example ```typescript import ClearStreet from '@clear-street-internal/sdk'; const client = new ClearStreet({ apiKey: 'My API Key', }); const response = await client.v1.orders.getOrders(0); console.log(response); ``` #### Response ```json { "data": [ { "account_id": 19816, "average_fill_price": "149.95", "client_order_id": "my-ref-id-20251001-001", "created_at": "2025-10-31T13:30:00.000000000Z", "filled_quantity": "50", "id": "0195f6c7-4f64-7e3c-8b0a-1d8e4f5e6a7b", "instrument_id": "a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8", "instrument_type": "COMMON_STOCK", "leaves_quantity": "50", "limit_price": "150.00", "order_type": "LIMIT", "quantity": "100", "side": "BUY", "status": "PARTIALLY_FILLED", "stop_price": null, "symbol": "AAPL", "time_in_force": "DAY", "updated_at": "2025-10-31T13:35:10.000000000Z" }, { "account_id": 19816, "average_fill_price": "450.75", "client_order_id": "my-ref-id-20251001-002", "created_at": "2025-10-31T14:00:00.000000000Z", "filled_quantity": "200", "id": "0195f6c8-1a2b-7c3d-8e4f-5a6b7c8d9e0f", "instrument_id": "b2b3b4b5-c2c3-d2d3-e2e3-e4e5e6e7e8e9", "instrument_type": "COMMON_STOCK", "leaves_quantity": "0", "limit_price": null, "order_type": "MARKET", "quantity": "200", "side": "SELL", "status": "FILLED", "stop_price": null, "symbol": "MSFT", "time_in_force": "DAY", "updated_at": "2025-10-31T14:00:05.000000000Z" } ], "error": null, "metadata": { "next_page_token": "cGFnZT0yJmxhc3RfaWQ9b3JkXzRjRDVlNkY3ZzhIOWkwSjE=", "page_number": 1, "request_id": "d9a4f5b6-c3d4-6e5f-0a1b-7c8d9e0f1a2b", "total_items": 25, "total_pages": 3 } } ``` ## Get Order By ID `client.v1.orders.getOrderByID(stringorderID, OrderGetOrderByIDParamsparams, RequestOptionsoptions?): OrderGetOrderByIDResponse` **get** `/v1/accounts/{account_id}/orders/{order_id}` Get Order By ID ### Parameters - `orderID: string` - `params: OrderGetOrderByIDParams` - `account_id: number` Account identifier ### Returns - `OrderGetOrderByIDResponse extends BaseResponse` - `data: Order` A trading order with its current state and execution details. This is the unified API representation of an order across its lifecycle, combining data from execution reports, order status queries, and parent/child tracking. - `id: string` Engine-assigned unique identifier for this order (UUID). - `account_id: number` Account placing the order - `client_order_id: string` Client-provided identifier echoed back (FIX tag 11). - `created_at: string` Timestamp when order was created (UTC) - `filled_quantity: string` Cumulative filled quantity - `instrument_id: string` OEMS instrument UUID for the traded instrument. - `instrument_type: SecurityType` Type of security - `"COMMON_STOCK"` - `"PREFERRED_STOCK"` - `"OPTION"` - `"CASH"` - `"OTHER"` - `leaves_quantity: string` Remaining unfilled quantity - `order_type: OrderType` Type of order (MARKET, LIMIT, etc.) - `"MARKET"` - `"LIMIT"` - `"STOP"` - `"STOP_LIMIT"` - `"TRAILING_STOP"` - `"TRAILING_STOP_LIMIT"` - `"OTHER"` - `quantity: string` Total order quantity - `side: Side` Side of the order (BUY, SELL, SELL_SHORT) - `"BUY"` - `"SELL"` - `"SELL_SHORT"` - `"OTHER"` - `status: OrderStatus` Current status of the order - `"PENDING_NEW"` - `"NEW"` - `"PARTIALLY_FILLED"` - `"FILLED"` - `"CANCELED"` - `"REJECTED"` - `"EXPIRED"` - `"PENDING_CANCEL"` - `"PENDING_REPLACE"` - `"REPLACED"` - `"DONE_FOR_DAY"` - `"STOPPED"` - `"SUSPENDED"` - `"CALCULATED"` - `"OTHER"` - `symbol: string` Trading symbol - `time_in_force: TimeInForce` Time in force instruction - `"DAY"` - `"GOOD_TILL_CANCEL"` - `"IMMEDIATE_OR_CANCEL"` - `"FILL_OR_KILL"` - `"GOOD_TILL_DATE"` - `"AT_THE_OPENING"` - `"AT_THE_CLOSE"` - `"GOOD_TILL_CROSSING"` - `"GOOD_THROUGH_CROSSING"` - `"AT_CROSSING"` - `"OTHER"` - `updated_at: string` Timestamp of the most recent update (UTC) - `venue: string` MIC code of the venue where the order is routed - `average_fill_price?: string | null` Average fill price across all executions - `details?: Array` Contains execution, rejection or cancellation details, if any - `expires_at?: string | null` Timestamp when the order will expire (UTC). Present when time_in_force is GOOD_TILL_DATE. - `extended_hours?: boolean | null` Whether the order is eligible for extended-hours trading. - `limit_offset?: string | null` Limit offset for trailing stop-limit orders (signed) - `limit_price?: string | null` Limit price (for LIMIT and STOP_LIMIT orders) - `queue_state?: QueueState | null` Parent order queue state, present when the order is awaiting release or released. - `"AWAITING_RELEASE"` - `"RELEASED"` - `releases_at?: string | null` Scheduled release time for orders awaiting release. - `stop_price?: string | null` Stop price (for STOP and STOP_LIMIT orders) - `trailing_limit_px?: string | null` Current trailing limit price computed by the trailing strategy - `trailing_offset?: string | null` Trailing offset amount for trailing orders - `trailing_offset_type?: TrailingOffsetType | null` Trailing offset type for trailing orders - `"PRICE"` - `"BPS"` - `trailing_stop_px?: string | null` Current trailing stop price computed by the trailing strategy - `trailing_watermark_px?: string | null` Trailing watermark price for trailing orders - `trailing_watermark_ts?: string | null` Trailing watermark timestamp for trailing orders - `underlying_instrument_id?: string | null` OEMS instrument ID of the option's underlying instrument. Populated only for OPTIONS orders; `null` for non-options and for options whose underlier cannot be resolved from the instrument cache. ### Example ```typescript import ClearStreet from '@clear-street-internal/sdk'; const client = new ClearStreet({ apiKey: 'My API Key', }); const response = await client.v1.orders.getOrderByID('order_id', { account_id: 0 }); console.log(response); ``` #### Response ```json { "data": { "account_id": 19816, "average_fill_price": "149.95", "created_at": "2025-10-31T13:30:00.000000000Z", "filled_quantity": "50", "id": "my-ref-id-20251001-001", "instrument_id": "a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8", "instrument_type": "COMMON_STOCK", "leaves_quantity": "50", "limit_price": "150.00", "order_type": "LIMIT", "quantity": "100", "side": "BUY", "status": "PARTIALLY_FILLED", "stop_price": null, "symbol": "AAPL", "time_in_force": "DAY", "updated_at": "2025-10-31T13:35:10.000000000Z" }, "error": null, "metadata": { "request_id": "0c1d2e3f-4a5b-6c7d-8e9f-0a1b2c3d4e5f" } } ``` ## Submit Orders `client.v1.orders.submitOrders(numberaccountID, OrderSubmitOrdersParamsparams, RequestOptionsoptions?): OrderSubmitOrdersResponse` **post** `/v1/accounts/{account_id}/orders` Submit new orders ### Parameters - `accountID: number` - `params: OrderSubmitOrdersParams` - `orders: Array` - `NewOrderMultilegRequest` Multileg strategy order request - `legs: Array` Legs that compose the strategy. - `instrument_type: SecurityType` Security type for the leg. - `"COMMON_STOCK"` - `"PREFERRED_STOCK"` - `"OPTION"` - `"CASH"` - `"OTHER"` - `ratio: string` Ratio for the leg. - `security: string` Trading symbol (e.g. "AAPL" or OSI symbol for options) - `side: Side` Leg side. - `"BUY"` - `"SELL"` - `"SELL_SHORT"` - `"OTHER"` - `id?: string | null` Optional leg reference identifier. - `position_effect?: PositionEffect | null` Optional leg position effect. - `"OPEN"` - `"CLOSE"` - `order_type: RequestOrderType` Type of order (currently MARKET or LIMIT for multileg strategy submission) - `"MARKET"` - `"LIMIT"` - `"STOP"` - `"STOP_LIMIT"` - `"TRAILING_STOP"` - `"TRAILING_STOP_LIMIT"` - `time_in_force: RequestTimeInForce` Time in force - `"DAY"` - `"GOOD_TILL_CANCEL"` - `"IMMEDIATE_OR_CANCEL"` - `"FILL_OR_KILL"` - `"GOOD_TILL_DATE"` - `"AT_THE_OPENING"` - `"AT_THE_CLOSE"` - `"GOOD_TILL_CROSSING"` - `"GOOD_THROUGH_CROSSING"` - `"AT_CROSSING"` - `id?: string | null` Optional client-provided unique ID (idempotency). Required to be unique per account. - `limit_price?: string | null` Strategy price, required for LIMIT orders. - `quantity?: string` Optional strategy-level quantity. Multiplies leg quantities. Defaults to 1. - `NewOrderRequest` Request to submit a new order (PlaceOrderRequest from spec) - `instrument_type: SecurityType` Type of security - `order_type: RequestOrderType` Type of order - `quantity: string` Quantity to trade. For COMMON_STOCK: shares (may be fractional if supported). For OPTION (single-leg): contracts (must be an integer) - `side: Side` Side of the order - `time_in_force: RequestTimeInForce` Time in force - `id?: string | null` Optional client-provided unique ID (idempotency). Required to be unique per account. - `expires_at?: string | null` The timestamp when the order should expire (UTC). Required when time_in_force is GOOD_TILL_DATE. - `extended_hours?: boolean | null` Allow trading outside regular trading hours. Some brokers disallow options outside RTH. - `instrument_id?: InstrumentIDOrSymbol | null` OEMS instrument UUID - `limit_offset?: string | null` Limit offset for trailing stop-limit orders (signed) - `limit_price?: string | null` Limit price (required for LIMIT and STOP_LIMIT orders) - `position_effect?: PositionEffect` Required when instrument_type is OPTION. Specifies whether the order opens or closes a position. - `stop_price?: string | null` Stop price (required for STOP and STOP_LIMIT orders) - `symbol?: string | null` Trading symbol. For equities, use the ticker symbol (e.g., "AAPL"). For options, use the OSI symbol (e.g., "AAPL 250117C00190000"). Either `symbol` or `instrument_id` must be provided. - `trailing_offset?: string | null` Trailing offset amount (required for trailing orders) - `trailing_offset_type?: TrailingOffsetType | null` Trailing offset type (PRICE or PERCENT_BPS) - `"PRICE"` - `"BPS"` ### Returns - `OrderSubmitOrdersResponse extends BaseResponse` - `data: OrderList` - `id: string` Engine-assigned unique identifier for this order (UUID). - `account_id: number` Account placing the order - `client_order_id: string` Client-provided identifier echoed back (FIX tag 11). - `created_at: string` Timestamp when order was created (UTC) - `filled_quantity: string` Cumulative filled quantity - `instrument_id: string` OEMS instrument UUID for the traded instrument. - `instrument_type: SecurityType` Type of security - `"COMMON_STOCK"` - `"PREFERRED_STOCK"` - `"OPTION"` - `"CASH"` - `"OTHER"` - `leaves_quantity: string` Remaining unfilled quantity - `order_type: OrderType` Type of order (MARKET, LIMIT, etc.) - `"MARKET"` - `"LIMIT"` - `"STOP"` - `"STOP_LIMIT"` - `"TRAILING_STOP"` - `"TRAILING_STOP_LIMIT"` - `"OTHER"` - `quantity: string` Total order quantity - `side: Side` Side of the order (BUY, SELL, SELL_SHORT) - `"BUY"` - `"SELL"` - `"SELL_SHORT"` - `"OTHER"` - `status: OrderStatus` Current status of the order - `"PENDING_NEW"` - `"NEW"` - `"PARTIALLY_FILLED"` - `"FILLED"` - `"CANCELED"` - `"REJECTED"` - `"EXPIRED"` - `"PENDING_CANCEL"` - `"PENDING_REPLACE"` - `"REPLACED"` - `"DONE_FOR_DAY"` - `"STOPPED"` - `"SUSPENDED"` - `"CALCULATED"` - `"OTHER"` - `symbol: string` Trading symbol - `time_in_force: TimeInForce` Time in force instruction - `"DAY"` - `"GOOD_TILL_CANCEL"` - `"IMMEDIATE_OR_CANCEL"` - `"FILL_OR_KILL"` - `"GOOD_TILL_DATE"` - `"AT_THE_OPENING"` - `"AT_THE_CLOSE"` - `"GOOD_TILL_CROSSING"` - `"GOOD_THROUGH_CROSSING"` - `"AT_CROSSING"` - `"OTHER"` - `updated_at: string` Timestamp of the most recent update (UTC) - `venue: string` MIC code of the venue where the order is routed - `average_fill_price?: string | null` Average fill price across all executions - `details?: Array` Contains execution, rejection or cancellation details, if any - `expires_at?: string | null` Timestamp when the order will expire (UTC). Present when time_in_force is GOOD_TILL_DATE. - `extended_hours?: boolean | null` Whether the order is eligible for extended-hours trading. - `limit_offset?: string | null` Limit offset for trailing stop-limit orders (signed) - `limit_price?: string | null` Limit price (for LIMIT and STOP_LIMIT orders) - `queue_state?: QueueState | null` Parent order queue state, present when the order is awaiting release or released. - `"AWAITING_RELEASE"` - `"RELEASED"` - `releases_at?: string | null` Scheduled release time for orders awaiting release. - `stop_price?: string | null` Stop price (for STOP and STOP_LIMIT orders) - `trailing_limit_px?: string | null` Current trailing limit price computed by the trailing strategy - `trailing_offset?: string | null` Trailing offset amount for trailing orders - `trailing_offset_type?: TrailingOffsetType | null` Trailing offset type for trailing orders - `"PRICE"` - `"BPS"` - `trailing_stop_px?: string | null` Current trailing stop price computed by the trailing strategy - `trailing_watermark_px?: string | null` Trailing watermark price for trailing orders - `trailing_watermark_ts?: string | null` Trailing watermark timestamp for trailing orders - `underlying_instrument_id?: string | null` OEMS instrument ID of the option's underlying instrument. Populated only for OPTIONS orders; `null` for non-options and for options whose underlier cannot be resolved from the instrument cache. ### Example ```typescript import ClearStreet from '@clear-street-internal/sdk'; const client = new ClearStreet({ apiKey: 'My API Key', }); const response = await client.v1.orders.submitOrders(0, { orders: [ { legs: [ { instrument_type: 'OPTION', ratio: 'ratio', security: '0193bb84-447a-706f-996f-097254663f02', side: 'BUY', }, { instrument_type: 'OPTION', ratio: 'ratio', security: '0193bb84-4db4-78ec-b4fd-cba8be61cf8a', side: 'SELL', }, { instrument_type: 'OPTION', ratio: 'ratio', security: '0193bb84-5264-7f20-8fd3-35df82cd6ef0', side: 'BUY', }, ], order_type: 'LIMIT', time_in_force: 'DAY', }, ], }); console.log(response); ``` #### Response ```json { "data": [ { "account_id": 19816, "average_fill_price": null, "client_order_id": "my-ref-id-20251003-001", "created_at": "2025-10-03T14:01:15.000000000Z", "filled_quantity": "0", "id": "0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e01", "instrument_id": "c3c4c5c6-d3d4-e3e4-f3f4-f5f6f7f8f9fa", "instrument_type": "COMMON_STOCK", "leaves_quantity": "25", "limit_price": null, "order_type": "MARKET", "quantity": "25", "side": "SELL", "status": "PENDING_NEW", "stop_price": null, "symbol": "GOOG", "time_in_force": "DAY", "updated_at": "2025-10-03T14:01:15.000000000Z", "venue": "XNAS" }, { "account_id": 19816, "average_fill_price": null, "client_order_id": "my-ref-id-20251003-002", "created_at": "2025-10-03T14:01:15.000000000Z", "filled_quantity": "0", "id": "0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e02", "instrument_id": "d4d5d6d7-e4e5-f4f5-a4a5-a6a7a8a9aaab", "instrument_type": "COMMON_STOCK", "leaves_quantity": "50", "limit_price": "180.00", "order_type": "LIMIT", "quantity": "50", "side": "BUY", "status": "PENDING_NEW", "stop_price": null, "symbol": "TSLA", "time_in_force": "DAY", "updated_at": "2025-10-03T14:01:15.000000000Z", "venue": "XNAS" } ], "error": null, "metadata": { "request_id": "ea0b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d" } } ``` ## Replace Order `client.v1.orders.replaceOrder(stringorderID, OrderReplaceOrderParamsparams, RequestOptionsoptions?): OrderReplaceOrderResponse` **patch** `/v1/accounts/{account_id}/orders/{order_id}` Replace an order with new parameters ### Parameters - `orderID: string` - `params: OrderReplaceOrderParams` - `account_id: number` Path param: Account identifier - `limit_price?: string | null` Body param: New limit price for the order - `quantity?: string | null` Body param: New quantity for the order - `stop_price?: string | null` Body param: New stop price for the order - `time_in_force?: RequestTimeInForce` Body param: New time in force for the order - `"DAY"` - `"GOOD_TILL_CANCEL"` - `"IMMEDIATE_OR_CANCEL"` - `"FILL_OR_KILL"` - `"GOOD_TILL_DATE"` - `"AT_THE_OPENING"` - `"AT_THE_CLOSE"` - `"GOOD_TILL_CROSSING"` - `"GOOD_THROUGH_CROSSING"` - `"AT_CROSSING"` ### Returns - `OrderReplaceOrderResponse extends BaseResponse` - `data: Order` A trading order with its current state and execution details. This is the unified API representation of an order across its lifecycle, combining data from execution reports, order status queries, and parent/child tracking. - `id: string` Engine-assigned unique identifier for this order (UUID). - `account_id: number` Account placing the order - `client_order_id: string` Client-provided identifier echoed back (FIX tag 11). - `created_at: string` Timestamp when order was created (UTC) - `filled_quantity: string` Cumulative filled quantity - `instrument_id: string` OEMS instrument UUID for the traded instrument. - `instrument_type: SecurityType` Type of security - `"COMMON_STOCK"` - `"PREFERRED_STOCK"` - `"OPTION"` - `"CASH"` - `"OTHER"` - `leaves_quantity: string` Remaining unfilled quantity - `order_type: OrderType` Type of order (MARKET, LIMIT, etc.) - `"MARKET"` - `"LIMIT"` - `"STOP"` - `"STOP_LIMIT"` - `"TRAILING_STOP"` - `"TRAILING_STOP_LIMIT"` - `"OTHER"` - `quantity: string` Total order quantity - `side: Side` Side of the order (BUY, SELL, SELL_SHORT) - `"BUY"` - `"SELL"` - `"SELL_SHORT"` - `"OTHER"` - `status: OrderStatus` Current status of the order - `"PENDING_NEW"` - `"NEW"` - `"PARTIALLY_FILLED"` - `"FILLED"` - `"CANCELED"` - `"REJECTED"` - `"EXPIRED"` - `"PENDING_CANCEL"` - `"PENDING_REPLACE"` - `"REPLACED"` - `"DONE_FOR_DAY"` - `"STOPPED"` - `"SUSPENDED"` - `"CALCULATED"` - `"OTHER"` - `symbol: string` Trading symbol - `time_in_force: TimeInForce` Time in force instruction - `"DAY"` - `"GOOD_TILL_CANCEL"` - `"IMMEDIATE_OR_CANCEL"` - `"FILL_OR_KILL"` - `"GOOD_TILL_DATE"` - `"AT_THE_OPENING"` - `"AT_THE_CLOSE"` - `"GOOD_TILL_CROSSING"` - `"GOOD_THROUGH_CROSSING"` - `"AT_CROSSING"` - `"OTHER"` - `updated_at: string` Timestamp of the most recent update (UTC) - `venue: string` MIC code of the venue where the order is routed - `average_fill_price?: string | null` Average fill price across all executions - `details?: Array` Contains execution, rejection or cancellation details, if any - `expires_at?: string | null` Timestamp when the order will expire (UTC). Present when time_in_force is GOOD_TILL_DATE. - `extended_hours?: boolean | null` Whether the order is eligible for extended-hours trading. - `limit_offset?: string | null` Limit offset for trailing stop-limit orders (signed) - `limit_price?: string | null` Limit price (for LIMIT and STOP_LIMIT orders) - `queue_state?: QueueState | null` Parent order queue state, present when the order is awaiting release or released. - `"AWAITING_RELEASE"` - `"RELEASED"` - `releases_at?: string | null` Scheduled release time for orders awaiting release. - `stop_price?: string | null` Stop price (for STOP and STOP_LIMIT orders) - `trailing_limit_px?: string | null` Current trailing limit price computed by the trailing strategy - `trailing_offset?: string | null` Trailing offset amount for trailing orders - `trailing_offset_type?: TrailingOffsetType | null` Trailing offset type for trailing orders - `"PRICE"` - `"BPS"` - `trailing_stop_px?: string | null` Current trailing stop price computed by the trailing strategy - `trailing_watermark_px?: string | null` Trailing watermark price for trailing orders - `trailing_watermark_ts?: string | null` Trailing watermark timestamp for trailing orders - `underlying_instrument_id?: string | null` OEMS instrument ID of the option's underlying instrument. Populated only for OPTIONS orders; `null` for non-options and for options whose underlier cannot be resolved from the instrument cache. ### Example ```typescript import ClearStreet from '@clear-street-internal/sdk'; const client = new ClearStreet({ apiKey: 'My API Key', }); const response = await client.v1.orders.replaceOrder('order_id', { account_id: 0 }); console.log(response); ``` #### Response ```json { "data": { "account_id": 19816, "average_fill_price": "149.95", "created_at": "2025-10-31T13:30:00.000000000Z", "filled_quantity": "50", "id": "my-ref-id-20251001-001", "instrument_id": "a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8", "instrument_type": "COMMON_STOCK", "leaves_quantity": "50", "limit_price": "150.50", "order_type": "LIMIT", "quantity": "125", "side": "BUY", "status": "PENDING_REPLACE", "stop_price": null, "symbol": "AAPL", "time_in_force": "DAY", "updated_at": "2025-10-31T14:10:00.000000000Z" }, "error": null, "metadata": { "request_id": "1d2e3f4a-5b6c-7d8e-9f0a-1b2c3d4e5f6a" } } ``` ## Cancel Open Order `client.v1.orders.cancelOpenOrder(stringorderID, OrderCancelOpenOrderParamsparams, RequestOptionsoptions?): OrderCancelOpenOrderResponse` **delete** `/v1/accounts/{account_id}/orders/{order_id}` Cancel a specific order ### Parameters - `orderID: string` - `params: OrderCancelOpenOrderParams` - `account_id: number` Account identifier ### Returns - `OrderCancelOpenOrderResponse extends BaseResponse` - `data: Order` A trading order with its current state and execution details. This is the unified API representation of an order across its lifecycle, combining data from execution reports, order status queries, and parent/child tracking. - `id: string` Engine-assigned unique identifier for this order (UUID). - `account_id: number` Account placing the order - `client_order_id: string` Client-provided identifier echoed back (FIX tag 11). - `created_at: string` Timestamp when order was created (UTC) - `filled_quantity: string` Cumulative filled quantity - `instrument_id: string` OEMS instrument UUID for the traded instrument. - `instrument_type: SecurityType` Type of security - `"COMMON_STOCK"` - `"PREFERRED_STOCK"` - `"OPTION"` - `"CASH"` - `"OTHER"` - `leaves_quantity: string` Remaining unfilled quantity - `order_type: OrderType` Type of order (MARKET, LIMIT, etc.) - `"MARKET"` - `"LIMIT"` - `"STOP"` - `"STOP_LIMIT"` - `"TRAILING_STOP"` - `"TRAILING_STOP_LIMIT"` - `"OTHER"` - `quantity: string` Total order quantity - `side: Side` Side of the order (BUY, SELL, SELL_SHORT) - `"BUY"` - `"SELL"` - `"SELL_SHORT"` - `"OTHER"` - `status: OrderStatus` Current status of the order - `"PENDING_NEW"` - `"NEW"` - `"PARTIALLY_FILLED"` - `"FILLED"` - `"CANCELED"` - `"REJECTED"` - `"EXPIRED"` - `"PENDING_CANCEL"` - `"PENDING_REPLACE"` - `"REPLACED"` - `"DONE_FOR_DAY"` - `"STOPPED"` - `"SUSPENDED"` - `"CALCULATED"` - `"OTHER"` - `symbol: string` Trading symbol - `time_in_force: TimeInForce` Time in force instruction - `"DAY"` - `"GOOD_TILL_CANCEL"` - `"IMMEDIATE_OR_CANCEL"` - `"FILL_OR_KILL"` - `"GOOD_TILL_DATE"` - `"AT_THE_OPENING"` - `"AT_THE_CLOSE"` - `"GOOD_TILL_CROSSING"` - `"GOOD_THROUGH_CROSSING"` - `"AT_CROSSING"` - `"OTHER"` - `updated_at: string` Timestamp of the most recent update (UTC) - `venue: string` MIC code of the venue where the order is routed - `average_fill_price?: string | null` Average fill price across all executions - `details?: Array` Contains execution, rejection or cancellation details, if any - `expires_at?: string | null` Timestamp when the order will expire (UTC). Present when time_in_force is GOOD_TILL_DATE. - `extended_hours?: boolean | null` Whether the order is eligible for extended-hours trading. - `limit_offset?: string | null` Limit offset for trailing stop-limit orders (signed) - `limit_price?: string | null` Limit price (for LIMIT and STOP_LIMIT orders) - `queue_state?: QueueState | null` Parent order queue state, present when the order is awaiting release or released. - `"AWAITING_RELEASE"` - `"RELEASED"` - `releases_at?: string | null` Scheduled release time for orders awaiting release. - `stop_price?: string | null` Stop price (for STOP and STOP_LIMIT orders) - `trailing_limit_px?: string | null` Current trailing limit price computed by the trailing strategy - `trailing_offset?: string | null` Trailing offset amount for trailing orders - `trailing_offset_type?: TrailingOffsetType | null` Trailing offset type for trailing orders - `"PRICE"` - `"BPS"` - `trailing_stop_px?: string | null` Current trailing stop price computed by the trailing strategy - `trailing_watermark_px?: string | null` Trailing watermark price for trailing orders - `trailing_watermark_ts?: string | null` Trailing watermark timestamp for trailing orders - `underlying_instrument_id?: string | null` OEMS instrument ID of the option's underlying instrument. Populated only for OPTIONS orders; `null` for non-options and for options whose underlier cannot be resolved from the instrument cache. ### Example ```typescript import ClearStreet from '@clear-street-internal/sdk'; const client = new ClearStreet({ apiKey: 'My API Key', }); const response = await client.v1.orders.cancelOpenOrder('order_id', { account_id: 0 }); console.log(response); ``` #### Response ```json { "data": { "account_id": 19816, "average_fill_price": "149.95", "created_at": "2025-10-31T13:30:00.000000000Z", "filled_quantity": "50", "id": "my-ref-id-20251001-001", "instrument_id": "a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8", "instrument_type": "COMMON_STOCK", "leaves_quantity": "50", "limit_price": "150.50", "order_type": "LIMIT", "quantity": "125", "side": "BUY", "status": "PENDING_CANCEL", "stop_price": null, "symbol": "AAPL", "time_in_force": "DAY", "updated_at": "2025-10-31T14:15:00.000000000Z" }, "error": null, "metadata": { "request_id": "2e3f4a5b-6c7d-8e9f-0a1b-2c3d4e5f6a7b" } } ``` ## Cancel All Open Orders `client.v1.orders.cancelAllOpenOrders(numberaccountID, OrderCancelAllOpenOrdersParamsparams?, RequestOptionsoptions?): OrderCancelAllOpenOrdersResponse` **delete** `/v1/accounts/{account_id}/orders` Cancel all orders for an account ### Parameters - `accountID: number` - `params: OrderCancelAllOpenOrdersParams` - `instrument_ids?: Array` Comma-separated OEMS instrument UUIDs - `instrument_type?: "COMMON_STOCK" | "PREFERRED_STOCK" | "OPTION" | 2 more` Filter by instrument type (e.g., COMMON_STOCK, OPTION) - `"COMMON_STOCK"` - `"PREFERRED_STOCK"` - `"OPTION"` - `"CASH"` - `"OTHER"` - `side?: "BUY" | "SELL" | "SELL_SHORT" | "OTHER"` Filter by order side (BUY or SELL) - `"BUY"` - `"SELL"` - `"SELL_SHORT"` - `"OTHER"` - `type?: "MARKET" | "LIMIT" | "STOP" | 4 more` Filter by order type (e.g., MARKET, LIMIT) - `"MARKET"` - `"LIMIT"` - `"STOP"` - `"STOP_LIMIT"` - `"TRAILING_STOP"` - `"TRAILING_STOP_LIMIT"` - `"OTHER"` ### Returns - `OrderCancelAllOpenOrdersResponse extends BaseResponse` - `data: OrderList` - `id: string` Engine-assigned unique identifier for this order (UUID). - `account_id: number` Account placing the order - `client_order_id: string` Client-provided identifier echoed back (FIX tag 11). - `created_at: string` Timestamp when order was created (UTC) - `filled_quantity: string` Cumulative filled quantity - `instrument_id: string` OEMS instrument UUID for the traded instrument. - `instrument_type: SecurityType` Type of security - `"COMMON_STOCK"` - `"PREFERRED_STOCK"` - `"OPTION"` - `"CASH"` - `"OTHER"` - `leaves_quantity: string` Remaining unfilled quantity - `order_type: OrderType` Type of order (MARKET, LIMIT, etc.) - `"MARKET"` - `"LIMIT"` - `"STOP"` - `"STOP_LIMIT"` - `"TRAILING_STOP"` - `"TRAILING_STOP_LIMIT"` - `"OTHER"` - `quantity: string` Total order quantity - `side: Side` Side of the order (BUY, SELL, SELL_SHORT) - `"BUY"` - `"SELL"` - `"SELL_SHORT"` - `"OTHER"` - `status: OrderStatus` Current status of the order - `"PENDING_NEW"` - `"NEW"` - `"PARTIALLY_FILLED"` - `"FILLED"` - `"CANCELED"` - `"REJECTED"` - `"EXPIRED"` - `"PENDING_CANCEL"` - `"PENDING_REPLACE"` - `"REPLACED"` - `"DONE_FOR_DAY"` - `"STOPPED"` - `"SUSPENDED"` - `"CALCULATED"` - `"OTHER"` - `symbol: string` Trading symbol - `time_in_force: TimeInForce` Time in force instruction - `"DAY"` - `"GOOD_TILL_CANCEL"` - `"IMMEDIATE_OR_CANCEL"` - `"FILL_OR_KILL"` - `"GOOD_TILL_DATE"` - `"AT_THE_OPENING"` - `"AT_THE_CLOSE"` - `"GOOD_TILL_CROSSING"` - `"GOOD_THROUGH_CROSSING"` - `"AT_CROSSING"` - `"OTHER"` - `updated_at: string` Timestamp of the most recent update (UTC) - `venue: string` MIC code of the venue where the order is routed - `average_fill_price?: string | null` Average fill price across all executions - `details?: Array` Contains execution, rejection or cancellation details, if any - `expires_at?: string | null` Timestamp when the order will expire (UTC). Present when time_in_force is GOOD_TILL_DATE. - `extended_hours?: boolean | null` Whether the order is eligible for extended-hours trading. - `limit_offset?: string | null` Limit offset for trailing stop-limit orders (signed) - `limit_price?: string | null` Limit price (for LIMIT and STOP_LIMIT orders) - `queue_state?: QueueState | null` Parent order queue state, present when the order is awaiting release or released. - `"AWAITING_RELEASE"` - `"RELEASED"` - `releases_at?: string | null` Scheduled release time for orders awaiting release. - `stop_price?: string | null` Stop price (for STOP and STOP_LIMIT orders) - `trailing_limit_px?: string | null` Current trailing limit price computed by the trailing strategy - `trailing_offset?: string | null` Trailing offset amount for trailing orders - `trailing_offset_type?: TrailingOffsetType | null` Trailing offset type for trailing orders - `"PRICE"` - `"BPS"` - `trailing_stop_px?: string | null` Current trailing stop price computed by the trailing strategy - `trailing_watermark_px?: string | null` Trailing watermark price for trailing orders - `trailing_watermark_ts?: string | null` Trailing watermark timestamp for trailing orders - `underlying_instrument_id?: string | null` OEMS instrument ID of the option's underlying instrument. Populated only for OPTIONS orders; `null` for non-options and for options whose underlier cannot be resolved from the instrument cache. ### Example ```typescript import ClearStreet from '@clear-street-internal/sdk'; const client = new ClearStreet({ apiKey: 'My API Key', }); const response = await client.v1.orders.cancelAllOpenOrders(0); console.log(response); ``` #### Response ```json { "data": [ { "account_id": 19816, "average_fill_price": "149.95", "created_at": "2025-10-31T13:30:00.000000000Z", "filled_quantity": "50", "id": "019c0b48-b8fb-700d-8c5e-931d54555f54", "instrument_id": "a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8", "instrument_type": "COMMON_STOCK", "leaves_quantity": "50", "limit_price": "150.00", "order_type": "LIMIT", "quantity": "100", "side": "BUY", "status": "PENDING_CANCEL", "stop_price": null, "symbol": "AAPL", "time_in_force": "DAY", "updated_at": "2025-10-31T14:15:00.000000000Z" }, { "account_id": 19816, "average_fill_price": null, "created_at": "2025-10-31T14:00:00.000000000Z", "filled_quantity": "0", "id": "019c0b49-03af-70d1-8eeb-d69836c9840b", "instrument_id": "b2b3b4b5-c2c3-d2d3-e2e3-e4e5e6e7e8e9", "instrument_type": "COMMON_STOCK", "leaves_quantity": "200", "limit_price": "450.00", "order_type": "LIMIT", "quantity": "200", "side": "SELL", "status": "PENDING_CANCEL", "stop_price": null, "symbol": "MSFT", "time_in_force": "DAY", "updated_at": "2025-10-31T14:15:00.000000000Z" } ], "error": null, "metadata": { "request_id": "fb1c2d3e-4f5a-6b7c-8d9e-0f1a2b3c4d5e" } } ``` ## Domain Types ### Cancel Order Request - `CancelOrderRequest` Request to cancel an existing order Note: In the API, order cancellation is done via DELETE request without a body. The order_id and account_id come from the URL path parameters. - `account_id: number` Account ID (from path parameter) - `order_id: string` Order ID to cancel (from path parameter) ### Instrument ID Or Symbol - `InstrumentIDOrSymbol = string` OEMS instrument UUID ### New Order Request - `NewOrderRequest` Request to submit a new order (PlaceOrderRequest from spec) - `instrument_type: SecurityType` Type of security - `"COMMON_STOCK"` - `"PREFERRED_STOCK"` - `"OPTION"` - `"CASH"` - `"OTHER"` - `order_type: RequestOrderType` Type of order - `"MARKET"` - `"LIMIT"` - `"STOP"` - `"STOP_LIMIT"` - `"TRAILING_STOP"` - `"TRAILING_STOP_LIMIT"` - `quantity: string` Quantity to trade. For COMMON_STOCK: shares (may be fractional if supported). For OPTION (single-leg): contracts (must be an integer) - `side: Side` Side of the order - `"BUY"` - `"SELL"` - `"SELL_SHORT"` - `"OTHER"` - `time_in_force: RequestTimeInForce` Time in force - `"DAY"` - `"GOOD_TILL_CANCEL"` - `"IMMEDIATE_OR_CANCEL"` - `"FILL_OR_KILL"` - `"GOOD_TILL_DATE"` - `"AT_THE_OPENING"` - `"AT_THE_CLOSE"` - `"GOOD_TILL_CROSSING"` - `"GOOD_THROUGH_CROSSING"` - `"AT_CROSSING"` - `id?: string | null` Optional client-provided unique ID (idempotency). Required to be unique per account. - `expires_at?: string | null` The timestamp when the order should expire (UTC). Required when time_in_force is GOOD_TILL_DATE. - `extended_hours?: boolean | null` Allow trading outside regular trading hours. Some brokers disallow options outside RTH. - `instrument_id?: InstrumentIDOrSymbol | null` OEMS instrument UUID - `limit_offset?: string | null` Limit offset for trailing stop-limit orders (signed) - `limit_price?: string | null` Limit price (required for LIMIT and STOP_LIMIT orders) - `position_effect?: PositionEffect` Required when instrument_type is OPTION. Specifies whether the order opens or closes a position. - `"OPEN"` - `"CLOSE"` - `stop_price?: string | null` Stop price (required for STOP and STOP_LIMIT orders) - `symbol?: string | null` Trading symbol. For equities, use the ticker symbol (e.g., "AAPL"). For options, use the OSI symbol (e.g., "AAPL 250117C00190000"). Either `symbol` or `instrument_id` must be provided. - `trailing_offset?: string | null` Trailing offset amount (required for trailing orders) - `trailing_offset_type?: TrailingOffsetType | null` Trailing offset type (PRICE or PERCENT_BPS) - `"PRICE"` - `"BPS"` ### Order - `Order` A trading order with its current state and execution details. This is the unified API representation of an order across its lifecycle, combining data from execution reports, order status queries, and parent/child tracking. - `id: string` Engine-assigned unique identifier for this order (UUID). - `account_id: number` Account placing the order - `client_order_id: string` Client-provided identifier echoed back (FIX tag 11). - `created_at: string` Timestamp when order was created (UTC) - `filled_quantity: string` Cumulative filled quantity - `instrument_id: string` OEMS instrument UUID for the traded instrument. - `instrument_type: SecurityType` Type of security - `"COMMON_STOCK"` - `"PREFERRED_STOCK"` - `"OPTION"` - `"CASH"` - `"OTHER"` - `leaves_quantity: string` Remaining unfilled quantity - `order_type: OrderType` Type of order (MARKET, LIMIT, etc.) - `"MARKET"` - `"LIMIT"` - `"STOP"` - `"STOP_LIMIT"` - `"TRAILING_STOP"` - `"TRAILING_STOP_LIMIT"` - `"OTHER"` - `quantity: string` Total order quantity - `side: Side` Side of the order (BUY, SELL, SELL_SHORT) - `"BUY"` - `"SELL"` - `"SELL_SHORT"` - `"OTHER"` - `status: OrderStatus` Current status of the order - `"PENDING_NEW"` - `"NEW"` - `"PARTIALLY_FILLED"` - `"FILLED"` - `"CANCELED"` - `"REJECTED"` - `"EXPIRED"` - `"PENDING_CANCEL"` - `"PENDING_REPLACE"` - `"REPLACED"` - `"DONE_FOR_DAY"` - `"STOPPED"` - `"SUSPENDED"` - `"CALCULATED"` - `"OTHER"` - `symbol: string` Trading symbol - `time_in_force: TimeInForce` Time in force instruction - `"DAY"` - `"GOOD_TILL_CANCEL"` - `"IMMEDIATE_OR_CANCEL"` - `"FILL_OR_KILL"` - `"GOOD_TILL_DATE"` - `"AT_THE_OPENING"` - `"AT_THE_CLOSE"` - `"GOOD_TILL_CROSSING"` - `"GOOD_THROUGH_CROSSING"` - `"AT_CROSSING"` - `"OTHER"` - `updated_at: string` Timestamp of the most recent update (UTC) - `venue: string` MIC code of the venue where the order is routed - `average_fill_price?: string | null` Average fill price across all executions - `details?: Array` Contains execution, rejection or cancellation details, if any - `expires_at?: string | null` Timestamp when the order will expire (UTC). Present when time_in_force is GOOD_TILL_DATE. - `extended_hours?: boolean | null` Whether the order is eligible for extended-hours trading. - `limit_offset?: string | null` Limit offset for trailing stop-limit orders (signed) - `limit_price?: string | null` Limit price (for LIMIT and STOP_LIMIT orders) - `queue_state?: QueueState | null` Parent order queue state, present when the order is awaiting release or released. - `"AWAITING_RELEASE"` - `"RELEASED"` - `releases_at?: string | null` Scheduled release time for orders awaiting release. - `stop_price?: string | null` Stop price (for STOP and STOP_LIMIT orders) - `trailing_limit_px?: string | null` Current trailing limit price computed by the trailing strategy - `trailing_offset?: string | null` Trailing offset amount for trailing orders - `trailing_offset_type?: TrailingOffsetType | null` Trailing offset type for trailing orders - `"PRICE"` - `"BPS"` - `trailing_stop_px?: string | null` Current trailing stop price computed by the trailing strategy - `trailing_watermark_px?: string | null` Trailing watermark price for trailing orders - `trailing_watermark_ts?: string | null` Trailing watermark timestamp for trailing orders - `underlying_instrument_id?: string | null` OEMS instrument ID of the option's underlying instrument. Populated only for OPTIONS orders; `null` for non-options and for options whose underlier cannot be resolved from the instrument cache. ### Order List - `OrderList = Array` - `id: string` Engine-assigned unique identifier for this order (UUID). - `account_id: number` Account placing the order - `client_order_id: string` Client-provided identifier echoed back (FIX tag 11). - `created_at: string` Timestamp when order was created (UTC) - `filled_quantity: string` Cumulative filled quantity - `instrument_id: string` OEMS instrument UUID for the traded instrument. - `instrument_type: SecurityType` Type of security - `"COMMON_STOCK"` - `"PREFERRED_STOCK"` - `"OPTION"` - `"CASH"` - `"OTHER"` - `leaves_quantity: string` Remaining unfilled quantity - `order_type: OrderType` Type of order (MARKET, LIMIT, etc.) - `"MARKET"` - `"LIMIT"` - `"STOP"` - `"STOP_LIMIT"` - `"TRAILING_STOP"` - `"TRAILING_STOP_LIMIT"` - `"OTHER"` - `quantity: string` Total order quantity - `side: Side` Side of the order (BUY, SELL, SELL_SHORT) - `"BUY"` - `"SELL"` - `"SELL_SHORT"` - `"OTHER"` - `status: OrderStatus` Current status of the order - `"PENDING_NEW"` - `"NEW"` - `"PARTIALLY_FILLED"` - `"FILLED"` - `"CANCELED"` - `"REJECTED"` - `"EXPIRED"` - `"PENDING_CANCEL"` - `"PENDING_REPLACE"` - `"REPLACED"` - `"DONE_FOR_DAY"` - `"STOPPED"` - `"SUSPENDED"` - `"CALCULATED"` - `"OTHER"` - `symbol: string` Trading symbol - `time_in_force: TimeInForce` Time in force instruction - `"DAY"` - `"GOOD_TILL_CANCEL"` - `"IMMEDIATE_OR_CANCEL"` - `"FILL_OR_KILL"` - `"GOOD_TILL_DATE"` - `"AT_THE_OPENING"` - `"AT_THE_CLOSE"` - `"GOOD_TILL_CROSSING"` - `"GOOD_THROUGH_CROSSING"` - `"AT_CROSSING"` - `"OTHER"` - `updated_at: string` Timestamp of the most recent update (UTC) - `venue: string` MIC code of the venue where the order is routed - `average_fill_price?: string | null` Average fill price across all executions - `details?: Array` Contains execution, rejection or cancellation details, if any - `expires_at?: string | null` Timestamp when the order will expire (UTC). Present when time_in_force is GOOD_TILL_DATE. - `extended_hours?: boolean | null` Whether the order is eligible for extended-hours trading. - `limit_offset?: string | null` Limit offset for trailing stop-limit orders (signed) - `limit_price?: string | null` Limit price (for LIMIT and STOP_LIMIT orders) - `queue_state?: QueueState | null` Parent order queue state, present when the order is awaiting release or released. - `"AWAITING_RELEASE"` - `"RELEASED"` - `releases_at?: string | null` Scheduled release time for orders awaiting release. - `stop_price?: string | null` Stop price (for STOP and STOP_LIMIT orders) - `trailing_limit_px?: string | null` Current trailing limit price computed by the trailing strategy - `trailing_offset?: string | null` Trailing offset amount for trailing orders - `trailing_offset_type?: TrailingOffsetType | null` Trailing offset type for trailing orders - `"PRICE"` - `"BPS"` - `trailing_stop_px?: string | null` Current trailing stop price computed by the trailing strategy - `trailing_watermark_px?: string | null` Trailing watermark price for trailing orders - `trailing_watermark_ts?: string | null` Trailing watermark timestamp for trailing orders - `underlying_instrument_id?: string | null` OEMS instrument ID of the option's underlying instrument. Populated only for OPTIONS orders; `null` for non-options and for options whose underlier cannot be resolved from the instrument cache. ### Order Status - `OrderStatus = "PENDING_NEW" | "NEW" | "PARTIALLY_FILLED" | 12 more` Order status - `"PENDING_NEW"` - `"NEW"` - `"PARTIALLY_FILLED"` - `"FILLED"` - `"CANCELED"` - `"REJECTED"` - `"EXPIRED"` - `"PENDING_CANCEL"` - `"PENDING_REPLACE"` - `"REPLACED"` - `"DONE_FOR_DAY"` - `"STOPPED"` - `"SUSPENDED"` - `"CALCULATED"` - `"OTHER"` ### Order Type - `OrderType = "MARKET" | "LIMIT" | "STOP" | 4 more` Order type - `"MARKET"` - `"LIMIT"` - `"STOP"` - `"STOP_LIMIT"` - `"TRAILING_STOP"` - `"TRAILING_STOP_LIMIT"` - `"OTHER"` ### Position Effect - `PositionEffect = "OPEN" | "CLOSE"` Position effect for options orders - `"OPEN"` - `"CLOSE"` ### Queue State - `QueueState = "AWAITING_RELEASE" | "RELEASED"` Parent order queue or hold state. - `"AWAITING_RELEASE"` - `"RELEASED"` ### Request Order Type - `RequestOrderType = "MARKET" | "LIMIT" | "STOP" | 3 more` Strict order-type enum for order submission/replacement requests. - `"MARKET"` - `"LIMIT"` - `"STOP"` - `"STOP_LIMIT"` - `"TRAILING_STOP"` - `"TRAILING_STOP_LIMIT"` ### Request Time In Force - `RequestTimeInForce = "DAY" | "GOOD_TILL_CANCEL" | "IMMEDIATE_OR_CANCEL" | 7 more` Strict time-in-force enum for order submission/replacement requests. - `"DAY"` - `"GOOD_TILL_CANCEL"` - `"IMMEDIATE_OR_CANCEL"` - `"FILL_OR_KILL"` - `"GOOD_TILL_DATE"` - `"AT_THE_OPENING"` - `"AT_THE_CLOSE"` - `"GOOD_TILL_CROSSING"` - `"GOOD_THROUGH_CROSSING"` - `"AT_CROSSING"` ### Side - `Side = "BUY" | "SELL" | "SELL_SHORT" | "OTHER"` Side of an order - `"BUY"` - `"SELL"` - `"SELL_SHORT"` - `"OTHER"` ### Time In Force - `TimeInForce = "DAY" | "GOOD_TILL_CANCEL" | "IMMEDIATE_OR_CANCEL" | 8 more` Time in force - `"DAY"` - `"GOOD_TILL_CANCEL"` - `"IMMEDIATE_OR_CANCEL"` - `"FILL_OR_KILL"` - `"GOOD_TILL_DATE"` - `"AT_THE_OPENING"` - `"AT_THE_CLOSE"` - `"GOOD_TILL_CROSSING"` - `"GOOD_THROUGH_CROSSING"` - `"AT_CROSSING"` - `"OTHER"` ### Trailing Offset Type - `TrailingOffsetType = "PRICE" | "BPS"` Trailing offset type for trailing stop orders. - `"PRICE"` - `"BPS"` ### Order Get Orders Response - `OrderGetOrdersResponse extends BaseResponse` - `data: OrderList` - `id: string` Engine-assigned unique identifier for this order (UUID). - `account_id: number` Account placing the order - `client_order_id: string` Client-provided identifier echoed back (FIX tag 11). - `created_at: string` Timestamp when order was created (UTC) - `filled_quantity: string` Cumulative filled quantity - `instrument_id: string` OEMS instrument UUID for the traded instrument. - `instrument_type: SecurityType` Type of security - `"COMMON_STOCK"` - `"PREFERRED_STOCK"` - `"OPTION"` - `"CASH"` - `"OTHER"` - `leaves_quantity: string` Remaining unfilled quantity - `order_type: OrderType` Type of order (MARKET, LIMIT, etc.) - `"MARKET"` - `"LIMIT"` - `"STOP"` - `"STOP_LIMIT"` - `"TRAILING_STOP"` - `"TRAILING_STOP_LIMIT"` - `"OTHER"` - `quantity: string` Total order quantity - `side: Side` Side of the order (BUY, SELL, SELL_SHORT) - `"BUY"` - `"SELL"` - `"SELL_SHORT"` - `"OTHER"` - `status: OrderStatus` Current status of the order - `"PENDING_NEW"` - `"NEW"` - `"PARTIALLY_FILLED"` - `"FILLED"` - `"CANCELED"` - `"REJECTED"` - `"EXPIRED"` - `"PENDING_CANCEL"` - `"PENDING_REPLACE"` - `"REPLACED"` - `"DONE_FOR_DAY"` - `"STOPPED"` - `"SUSPENDED"` - `"CALCULATED"` - `"OTHER"` - `symbol: string` Trading symbol - `time_in_force: TimeInForce` Time in force instruction - `"DAY"` - `"GOOD_TILL_CANCEL"` - `"IMMEDIATE_OR_CANCEL"` - `"FILL_OR_KILL"` - `"GOOD_TILL_DATE"` - `"AT_THE_OPENING"` - `"AT_THE_CLOSE"` - `"GOOD_TILL_CROSSING"` - `"GOOD_THROUGH_CROSSING"` - `"AT_CROSSING"` - `"OTHER"` - `updated_at: string` Timestamp of the most recent update (UTC) - `venue: string` MIC code of the venue where the order is routed - `average_fill_price?: string | null` Average fill price across all executions - `details?: Array` Contains execution, rejection or cancellation details, if any - `expires_at?: string | null` Timestamp when the order will expire (UTC). Present when time_in_force is GOOD_TILL_DATE. - `extended_hours?: boolean | null` Whether the order is eligible for extended-hours trading. - `limit_offset?: string | null` Limit offset for trailing stop-limit orders (signed) - `limit_price?: string | null` Limit price (for LIMIT and STOP_LIMIT orders) - `queue_state?: QueueState | null` Parent order queue state, present when the order is awaiting release or released. - `"AWAITING_RELEASE"` - `"RELEASED"` - `releases_at?: string | null` Scheduled release time for orders awaiting release. - `stop_price?: string | null` Stop price (for STOP and STOP_LIMIT orders) - `trailing_limit_px?: string | null` Current trailing limit price computed by the trailing strategy - `trailing_offset?: string | null` Trailing offset amount for trailing orders - `trailing_offset_type?: TrailingOffsetType | null` Trailing offset type for trailing orders - `"PRICE"` - `"BPS"` - `trailing_stop_px?: string | null` Current trailing stop price computed by the trailing strategy - `trailing_watermark_px?: string | null` Trailing watermark price for trailing orders - `trailing_watermark_ts?: string | null` Trailing watermark timestamp for trailing orders - `underlying_instrument_id?: string | null` OEMS instrument ID of the option's underlying instrument. Populated only for OPTIONS orders; `null` for non-options and for options whose underlier cannot be resolved from the instrument cache. ### Order Get Order By ID Response - `OrderGetOrderByIDResponse extends BaseResponse` - `data: Order` A trading order with its current state and execution details. This is the unified API representation of an order across its lifecycle, combining data from execution reports, order status queries, and parent/child tracking. - `id: string` Engine-assigned unique identifier for this order (UUID). - `account_id: number` Account placing the order - `client_order_id: string` Client-provided identifier echoed back (FIX tag 11). - `created_at: string` Timestamp when order was created (UTC) - `filled_quantity: string` Cumulative filled quantity - `instrument_id: string` OEMS instrument UUID for the traded instrument. - `instrument_type: SecurityType` Type of security - `"COMMON_STOCK"` - `"PREFERRED_STOCK"` - `"OPTION"` - `"CASH"` - `"OTHER"` - `leaves_quantity: string` Remaining unfilled quantity - `order_type: OrderType` Type of order (MARKET, LIMIT, etc.) - `"MARKET"` - `"LIMIT"` - `"STOP"` - `"STOP_LIMIT"` - `"TRAILING_STOP"` - `"TRAILING_STOP_LIMIT"` - `"OTHER"` - `quantity: string` Total order quantity - `side: Side` Side of the order (BUY, SELL, SELL_SHORT) - `"BUY"` - `"SELL"` - `"SELL_SHORT"` - `"OTHER"` - `status: OrderStatus` Current status of the order - `"PENDING_NEW"` - `"NEW"` - `"PARTIALLY_FILLED"` - `"FILLED"` - `"CANCELED"` - `"REJECTED"` - `"EXPIRED"` - `"PENDING_CANCEL"` - `"PENDING_REPLACE"` - `"REPLACED"` - `"DONE_FOR_DAY"` - `"STOPPED"` - `"SUSPENDED"` - `"CALCULATED"` - `"OTHER"` - `symbol: string` Trading symbol - `time_in_force: TimeInForce` Time in force instruction - `"DAY"` - `"GOOD_TILL_CANCEL"` - `"IMMEDIATE_OR_CANCEL"` - `"FILL_OR_KILL"` - `"GOOD_TILL_DATE"` - `"AT_THE_OPENING"` - `"AT_THE_CLOSE"` - `"GOOD_TILL_CROSSING"` - `"GOOD_THROUGH_CROSSING"` - `"AT_CROSSING"` - `"OTHER"` - `updated_at: string` Timestamp of the most recent update (UTC) - `venue: string` MIC code of the venue where the order is routed - `average_fill_price?: string | null` Average fill price across all executions - `details?: Array` Contains execution, rejection or cancellation details, if any - `expires_at?: string | null` Timestamp when the order will expire (UTC). Present when time_in_force is GOOD_TILL_DATE. - `extended_hours?: boolean | null` Whether the order is eligible for extended-hours trading. - `limit_offset?: string | null` Limit offset for trailing stop-limit orders (signed) - `limit_price?: string | null` Limit price (for LIMIT and STOP_LIMIT orders) - `queue_state?: QueueState | null` Parent order queue state, present when the order is awaiting release or released. - `"AWAITING_RELEASE"` - `"RELEASED"` - `releases_at?: string | null` Scheduled release time for orders awaiting release. - `stop_price?: string | null` Stop price (for STOP and STOP_LIMIT orders) - `trailing_limit_px?: string | null` Current trailing limit price computed by the trailing strategy - `trailing_offset?: string | null` Trailing offset amount for trailing orders - `trailing_offset_type?: TrailingOffsetType | null` Trailing offset type for trailing orders - `"PRICE"` - `"BPS"` - `trailing_stop_px?: string | null` Current trailing stop price computed by the trailing strategy - `trailing_watermark_px?: string | null` Trailing watermark price for trailing orders - `trailing_watermark_ts?: string | null` Trailing watermark timestamp for trailing orders - `underlying_instrument_id?: string | null` OEMS instrument ID of the option's underlying instrument. Populated only for OPTIONS orders; `null` for non-options and for options whose underlier cannot be resolved from the instrument cache. ### Order Submit Orders Response - `OrderSubmitOrdersResponse extends BaseResponse` - `data: OrderList` - `id: string` Engine-assigned unique identifier for this order (UUID). - `account_id: number` Account placing the order - `client_order_id: string` Client-provided identifier echoed back (FIX tag 11). - `created_at: string` Timestamp when order was created (UTC) - `filled_quantity: string` Cumulative filled quantity - `instrument_id: string` OEMS instrument UUID for the traded instrument. - `instrument_type: SecurityType` Type of security - `"COMMON_STOCK"` - `"PREFERRED_STOCK"` - `"OPTION"` - `"CASH"` - `"OTHER"` - `leaves_quantity: string` Remaining unfilled quantity - `order_type: OrderType` Type of order (MARKET, LIMIT, etc.) - `"MARKET"` - `"LIMIT"` - `"STOP"` - `"STOP_LIMIT"` - `"TRAILING_STOP"` - `"TRAILING_STOP_LIMIT"` - `"OTHER"` - `quantity: string` Total order quantity - `side: Side` Side of the order (BUY, SELL, SELL_SHORT) - `"BUY"` - `"SELL"` - `"SELL_SHORT"` - `"OTHER"` - `status: OrderStatus` Current status of the order - `"PENDING_NEW"` - `"NEW"` - `"PARTIALLY_FILLED"` - `"FILLED"` - `"CANCELED"` - `"REJECTED"` - `"EXPIRED"` - `"PENDING_CANCEL"` - `"PENDING_REPLACE"` - `"REPLACED"` - `"DONE_FOR_DAY"` - `"STOPPED"` - `"SUSPENDED"` - `"CALCULATED"` - `"OTHER"` - `symbol: string` Trading symbol - `time_in_force: TimeInForce` Time in force instruction - `"DAY"` - `"GOOD_TILL_CANCEL"` - `"IMMEDIATE_OR_CANCEL"` - `"FILL_OR_KILL"` - `"GOOD_TILL_DATE"` - `"AT_THE_OPENING"` - `"AT_THE_CLOSE"` - `"GOOD_TILL_CROSSING"` - `"GOOD_THROUGH_CROSSING"` - `"AT_CROSSING"` - `"OTHER"` - `updated_at: string` Timestamp of the most recent update (UTC) - `venue: string` MIC code of the venue where the order is routed - `average_fill_price?: string | null` Average fill price across all executions - `details?: Array` Contains execution, rejection or cancellation details, if any - `expires_at?: string | null` Timestamp when the order will expire (UTC). Present when time_in_force is GOOD_TILL_DATE. - `extended_hours?: boolean | null` Whether the order is eligible for extended-hours trading. - `limit_offset?: string | null` Limit offset for trailing stop-limit orders (signed) - `limit_price?: string | null` Limit price (for LIMIT and STOP_LIMIT orders) - `queue_state?: QueueState | null` Parent order queue state, present when the order is awaiting release or released. - `"AWAITING_RELEASE"` - `"RELEASED"` - `releases_at?: string | null` Scheduled release time for orders awaiting release. - `stop_price?: string | null` Stop price (for STOP and STOP_LIMIT orders) - `trailing_limit_px?: string | null` Current trailing limit price computed by the trailing strategy - `trailing_offset?: string | null` Trailing offset amount for trailing orders - `trailing_offset_type?: TrailingOffsetType | null` Trailing offset type for trailing orders - `"PRICE"` - `"BPS"` - `trailing_stop_px?: string | null` Current trailing stop price computed by the trailing strategy - `trailing_watermark_px?: string | null` Trailing watermark price for trailing orders - `trailing_watermark_ts?: string | null` Trailing watermark timestamp for trailing orders - `underlying_instrument_id?: string | null` OEMS instrument ID of the option's underlying instrument. Populated only for OPTIONS orders; `null` for non-options and for options whose underlier cannot be resolved from the instrument cache. ### Order Replace Order Response - `OrderReplaceOrderResponse extends BaseResponse` - `data: Order` A trading order with its current state and execution details. This is the unified API representation of an order across its lifecycle, combining data from execution reports, order status queries, and parent/child tracking. - `id: string` Engine-assigned unique identifier for this order (UUID). - `account_id: number` Account placing the order - `client_order_id: string` Client-provided identifier echoed back (FIX tag 11). - `created_at: string` Timestamp when order was created (UTC) - `filled_quantity: string` Cumulative filled quantity - `instrument_id: string` OEMS instrument UUID for the traded instrument. - `instrument_type: SecurityType` Type of security - `"COMMON_STOCK"` - `"PREFERRED_STOCK"` - `"OPTION"` - `"CASH"` - `"OTHER"` - `leaves_quantity: string` Remaining unfilled quantity - `order_type: OrderType` Type of order (MARKET, LIMIT, etc.) - `"MARKET"` - `"LIMIT"` - `"STOP"` - `"STOP_LIMIT"` - `"TRAILING_STOP"` - `"TRAILING_STOP_LIMIT"` - `"OTHER"` - `quantity: string` Total order quantity - `side: Side` Side of the order (BUY, SELL, SELL_SHORT) - `"BUY"` - `"SELL"` - `"SELL_SHORT"` - `"OTHER"` - `status: OrderStatus` Current status of the order - `"PENDING_NEW"` - `"NEW"` - `"PARTIALLY_FILLED"` - `"FILLED"` - `"CANCELED"` - `"REJECTED"` - `"EXPIRED"` - `"PENDING_CANCEL"` - `"PENDING_REPLACE"` - `"REPLACED"` - `"DONE_FOR_DAY"` - `"STOPPED"` - `"SUSPENDED"` - `"CALCULATED"` - `"OTHER"` - `symbol: string` Trading symbol - `time_in_force: TimeInForce` Time in force instruction - `"DAY"` - `"GOOD_TILL_CANCEL"` - `"IMMEDIATE_OR_CANCEL"` - `"FILL_OR_KILL"` - `"GOOD_TILL_DATE"` - `"AT_THE_OPENING"` - `"AT_THE_CLOSE"` - `"GOOD_TILL_CROSSING"` - `"GOOD_THROUGH_CROSSING"` - `"AT_CROSSING"` - `"OTHER"` - `updated_at: string` Timestamp of the most recent update (UTC) - `venue: string` MIC code of the venue where the order is routed - `average_fill_price?: string | null` Average fill price across all executions - `details?: Array` Contains execution, rejection or cancellation details, if any - `expires_at?: string | null` Timestamp when the order will expire (UTC). Present when time_in_force is GOOD_TILL_DATE. - `extended_hours?: boolean | null` Whether the order is eligible for extended-hours trading. - `limit_offset?: string | null` Limit offset for trailing stop-limit orders (signed) - `limit_price?: string | null` Limit price (for LIMIT and STOP_LIMIT orders) - `queue_state?: QueueState | null` Parent order queue state, present when the order is awaiting release or released. - `"AWAITING_RELEASE"` - `"RELEASED"` - `releases_at?: string | null` Scheduled release time for orders awaiting release. - `stop_price?: string | null` Stop price (for STOP and STOP_LIMIT orders) - `trailing_limit_px?: string | null` Current trailing limit price computed by the trailing strategy - `trailing_offset?: string | null` Trailing offset amount for trailing orders - `trailing_offset_type?: TrailingOffsetType | null` Trailing offset type for trailing orders - `"PRICE"` - `"BPS"` - `trailing_stop_px?: string | null` Current trailing stop price computed by the trailing strategy - `trailing_watermark_px?: string | null` Trailing watermark price for trailing orders - `trailing_watermark_ts?: string | null` Trailing watermark timestamp for trailing orders - `underlying_instrument_id?: string | null` OEMS instrument ID of the option's underlying instrument. Populated only for OPTIONS orders; `null` for non-options and for options whose underlier cannot be resolved from the instrument cache. ### Order Cancel Open Order Response - `OrderCancelOpenOrderResponse extends BaseResponse` - `data: Order` A trading order with its current state and execution details. This is the unified API representation of an order across its lifecycle, combining data from execution reports, order status queries, and parent/child tracking. - `id: string` Engine-assigned unique identifier for this order (UUID). - `account_id: number` Account placing the order - `client_order_id: string` Client-provided identifier echoed back (FIX tag 11). - `created_at: string` Timestamp when order was created (UTC) - `filled_quantity: string` Cumulative filled quantity - `instrument_id: string` OEMS instrument UUID for the traded instrument. - `instrument_type: SecurityType` Type of security - `"COMMON_STOCK"` - `"PREFERRED_STOCK"` - `"OPTION"` - `"CASH"` - `"OTHER"` - `leaves_quantity: string` Remaining unfilled quantity - `order_type: OrderType` Type of order (MARKET, LIMIT, etc.) - `"MARKET"` - `"LIMIT"` - `"STOP"` - `"STOP_LIMIT"` - `"TRAILING_STOP"` - `"TRAILING_STOP_LIMIT"` - `"OTHER"` - `quantity: string` Total order quantity - `side: Side` Side of the order (BUY, SELL, SELL_SHORT) - `"BUY"` - `"SELL"` - `"SELL_SHORT"` - `"OTHER"` - `status: OrderStatus` Current status of the order - `"PENDING_NEW"` - `"NEW"` - `"PARTIALLY_FILLED"` - `"FILLED"` - `"CANCELED"` - `"REJECTED"` - `"EXPIRED"` - `"PENDING_CANCEL"` - `"PENDING_REPLACE"` - `"REPLACED"` - `"DONE_FOR_DAY"` - `"STOPPED"` - `"SUSPENDED"` - `"CALCULATED"` - `"OTHER"` - `symbol: string` Trading symbol - `time_in_force: TimeInForce` Time in force instruction - `"DAY"` - `"GOOD_TILL_CANCEL"` - `"IMMEDIATE_OR_CANCEL"` - `"FILL_OR_KILL"` - `"GOOD_TILL_DATE"` - `"AT_THE_OPENING"` - `"AT_THE_CLOSE"` - `"GOOD_TILL_CROSSING"` - `"GOOD_THROUGH_CROSSING"` - `"AT_CROSSING"` - `"OTHER"` - `updated_at: string` Timestamp of the most recent update (UTC) - `venue: string` MIC code of the venue where the order is routed - `average_fill_price?: string | null` Average fill price across all executions - `details?: Array` Contains execution, rejection or cancellation details, if any - `expires_at?: string | null` Timestamp when the order will expire (UTC). Present when time_in_force is GOOD_TILL_DATE. - `extended_hours?: boolean | null` Whether the order is eligible for extended-hours trading. - `limit_offset?: string | null` Limit offset for trailing stop-limit orders (signed) - `limit_price?: string | null` Limit price (for LIMIT and STOP_LIMIT orders) - `queue_state?: QueueState | null` Parent order queue state, present when the order is awaiting release or released. - `"AWAITING_RELEASE"` - `"RELEASED"` - `releases_at?: string | null` Scheduled release time for orders awaiting release. - `stop_price?: string | null` Stop price (for STOP and STOP_LIMIT orders) - `trailing_limit_px?: string | null` Current trailing limit price computed by the trailing strategy - `trailing_offset?: string | null` Trailing offset amount for trailing orders - `trailing_offset_type?: TrailingOffsetType | null` Trailing offset type for trailing orders - `"PRICE"` - `"BPS"` - `trailing_stop_px?: string | null` Current trailing stop price computed by the trailing strategy - `trailing_watermark_px?: string | null` Trailing watermark price for trailing orders - `trailing_watermark_ts?: string | null` Trailing watermark timestamp for trailing orders - `underlying_instrument_id?: string | null` OEMS instrument ID of the option's underlying instrument. Populated only for OPTIONS orders; `null` for non-options and for options whose underlier cannot be resolved from the instrument cache. ### Order Cancel All Open Orders Response - `OrderCancelAllOpenOrdersResponse extends BaseResponse` - `data: OrderList` - `id: string` Engine-assigned unique identifier for this order (UUID). - `account_id: number` Account placing the order - `client_order_id: string` Client-provided identifier echoed back (FIX tag 11). - `created_at: string` Timestamp when order was created (UTC) - `filled_quantity: string` Cumulative filled quantity - `instrument_id: string` OEMS instrument UUID for the traded instrument. - `instrument_type: SecurityType` Type of security - `"COMMON_STOCK"` - `"PREFERRED_STOCK"` - `"OPTION"` - `"CASH"` - `"OTHER"` - `leaves_quantity: string` Remaining unfilled quantity - `order_type: OrderType` Type of order (MARKET, LIMIT, etc.) - `"MARKET"` - `"LIMIT"` - `"STOP"` - `"STOP_LIMIT"` - `"TRAILING_STOP"` - `"TRAILING_STOP_LIMIT"` - `"OTHER"` - `quantity: string` Total order quantity - `side: Side` Side of the order (BUY, SELL, SELL_SHORT) - `"BUY"` - `"SELL"` - `"SELL_SHORT"` - `"OTHER"` - `status: OrderStatus` Current status of the order - `"PENDING_NEW"` - `"NEW"` - `"PARTIALLY_FILLED"` - `"FILLED"` - `"CANCELED"` - `"REJECTED"` - `"EXPIRED"` - `"PENDING_CANCEL"` - `"PENDING_REPLACE"` - `"REPLACED"` - `"DONE_FOR_DAY"` - `"STOPPED"` - `"SUSPENDED"` - `"CALCULATED"` - `"OTHER"` - `symbol: string` Trading symbol - `time_in_force: TimeInForce` Time in force instruction - `"DAY"` - `"GOOD_TILL_CANCEL"` - `"IMMEDIATE_OR_CANCEL"` - `"FILL_OR_KILL"` - `"GOOD_TILL_DATE"` - `"AT_THE_OPENING"` - `"AT_THE_CLOSE"` - `"GOOD_TILL_CROSSING"` - `"GOOD_THROUGH_CROSSING"` - `"AT_CROSSING"` - `"OTHER"` - `updated_at: string` Timestamp of the most recent update (UTC) - `venue: string` MIC code of the venue where the order is routed - `average_fill_price?: string | null` Average fill price across all executions - `details?: Array` Contains execution, rejection or cancellation details, if any - `expires_at?: string | null` Timestamp when the order will expire (UTC). Present when time_in_force is GOOD_TILL_DATE. - `extended_hours?: boolean | null` Whether the order is eligible for extended-hours trading. - `limit_offset?: string | null` Limit offset for trailing stop-limit orders (signed) - `limit_price?: string | null` Limit price (for LIMIT and STOP_LIMIT orders) - `queue_state?: QueueState | null` Parent order queue state, present when the order is awaiting release or released. - `"AWAITING_RELEASE"` - `"RELEASED"` - `releases_at?: string | null` Scheduled release time for orders awaiting release. - `stop_price?: string | null` Stop price (for STOP and STOP_LIMIT orders) - `trailing_limit_px?: string | null` Current trailing limit price computed by the trailing strategy - `trailing_offset?: string | null` Trailing offset amount for trailing orders - `trailing_offset_type?: TrailingOffsetType | null` Trailing offset type for trailing orders - `"PRICE"` - `"BPS"` - `trailing_stop_px?: string | null` Current trailing stop price computed by the trailing strategy - `trailing_watermark_px?: string | null` Trailing watermark price for trailing orders - `trailing_watermark_ts?: string | null` Trailing watermark timestamp for trailing orders - `underlying_instrument_id?: string | null` OEMS instrument ID of the option's underlying instrument. Populated only for OPTIONS orders; `null` for non-options and for options whose underlier cannot be resolved from the instrument cache. # Positions ## Get Positions `client.v1.positions.getPositions(numberaccountID, PositionGetPositionsParamsquery?, RequestOptionsoptions?): PositionGetPositionsResponse` **get** `/v1/accounts/{account_id}/positions` Retrieves all positions for the specified trading account. ### Parameters - `accountID: number` - `query: PositionGetPositionsParams` - `instrument_ids?: Array` Comma-separated OEMS instrument UUIDs - `page_size?: number` The number of items to return per page. Only used when page_token is not provided. - `page_token?: string` Token for retrieving the next or previous page of results. Contains encoded pagination state; when provided, page_size is ignored. - `sort_by?: "SYMBOL" | "INSTRUMENT_TYPE" | "QUANTITY" | 4 more` Field to sort by - `"SYMBOL"` - `"INSTRUMENT_TYPE"` - `"QUANTITY"` - `"MARKET_VALUE"` - `"POSITION_TYPE"` - `"UNREALIZED_PNL"` - `"DAILY_UNREALIZED_PNL"` - `sort_direction?: "ASC" | "DESC"` Sort direction - `"ASC"` - `"DESC"` ### Returns - `PositionGetPositionsResponse extends BaseResponse` - `data: PositionList` - `account_id: number` The account this position belongs to - `available_quantity: string` The quantity of a position that is free to be operated on. - `instrument_id: string` OEMS instrument UUID - `instrument_type: SecurityType` Type of security - `"COMMON_STOCK"` - `"PREFERRED_STOCK"` - `"OPTION"` - `"CASH"` - `"OTHER"` - `market_value: string` The current market value of the position - `position_type: PositionType` The type of position - `"LONG"` - `"SHORT"` - `"LONG_CALL"` - `"SHORT_CALL"` - `"LONG_PUT"` - `"SHORT_PUT"` - `quantity: string` The number of shares or contracts. Can be positive (long) or negative (short) - `symbol: string` The trading symbol for the instrument - `avg_price?: string | null` The average price paid per share or contract for this position - `closing_price?: string | null` The closing price used to value the position for the last trading day - `closing_price_date?: string | null` The market date associated with `closing_price` - `cost_basis?: string | null` The total cost basis for this position - `daily_unrealized_pnl?: string | null` The unrealized profit or loss for this position relative to the previous close - `daily_unrealized_pnl_pct?: string | null` The unrealized profit/loss for the position for the current day, expressed as a percentage of the baseline value (range: 0-100). - `instrument_price?: string | null` The current market price of the instrument - `underlying_instrument_id?: string | null` OEMS instrument identifier of the underlying instrument, if resolvable - `unrealized_pnl?: string | null` The total unrealized profit or loss for this position based on current market value - `unrealized_pnl_pct?: string | null` The unrealized profit/loss for the position, expressed as a percentage of the position's cost basis (range: 0-100). ### Example ```typescript import ClearStreet from '@clear-street-internal/sdk'; const client = new ClearStreet({ apiKey: 'My API Key', }); const response = await client.v1.positions.getPositions(0); console.log(response); ``` #### Response ```json { "data": [ { "account_id": 19816, "available_quantity": "100", "avg_price": "145.00", "closing_price": "150.50", "closing_price_date": "2025-10-31", "cost_basis": "14500.00", "instrument_id": "a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8", "instrument_price": "151.00", "instrument_type": "COMMON_STOCK", "market_value": "15050.00", "position_type": "LONG", "quantity": "100", "symbol": "AAPL", "unrealized_pnl": "550.00" }, { "account_id": 19816, "available_quantity": "100", "avg_price": "180.00", "closing_price": "180.00", "closing_price_date": "2025-10-30", "cost_basis": "-9000.00", "instrument_id": "d4d5d6d7-e4e5-f4f5-a4a5-a6a7a8a9aaab", "instrument_price": "178.50", "instrument_type": "COMMON_STOCK", "market_value": "-9000.00", "position_type": "SHORT", "quantity": "-50", "symbol": "TSLA", "unrealized_pnl": "75.00" }, { "account_id": 19816, "available_quantity": "100", "avg_price": "2.50", "closing_price": "2.70", "closing_price_date": "2025-10-30", "cost_basis": "2500.00", "instrument_id": "e5e6e7e8-f5f6-a5a6-b5b6-b7b8b9babcbe", "instrument_price": "2.72", "instrument_type": "OPTION", "market_value": "2700.00", "position_type": "LONG_CALL", "quantity": "10", "symbol": "AAPL250117C00190000", "underlying_instrument_id": "a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8", "unrealized_pnl": "200.00" } ], "error": null, "metadata": { "next_page_token": "cGFnZT0yJmxhc3Rfc3ltYm9sPVRTM0E=", "page_number": 1, "request_id": "3f4a5b6c-7d8e-9f0a-1b2c-3d4e5f6a7b8c", "total_items": 25, "total_pages": 3 } } ``` ## Close Positions `client.v1.positions.closePositions(numberaccountID, PositionClosePositionsParamsbody?, RequestOptionsoptions?): PositionClosePositionsResponse` **delete** `/v1/accounts/{account_id}/positions` Delete all positions within an account. Closes all positions for the specified trading account. ### Parameters - `accountID: number` - `body: PositionClosePositionsParams` - `cancel_orders?: boolean | null` Whether to cancel existing open orders for the position before submitting closing orders. ### Returns - `PositionClosePositionsResponse extends BaseResponse` - `data: OrderList` - `id: string` Engine-assigned unique identifier for this order (UUID). - `account_id: number` Account placing the order - `client_order_id: string` Client-provided identifier echoed back (FIX tag 11). - `created_at: string` Timestamp when order was created (UTC) - `filled_quantity: string` Cumulative filled quantity - `instrument_id: string` OEMS instrument UUID for the traded instrument. - `instrument_type: SecurityType` Type of security - `"COMMON_STOCK"` - `"PREFERRED_STOCK"` - `"OPTION"` - `"CASH"` - `"OTHER"` - `leaves_quantity: string` Remaining unfilled quantity - `order_type: OrderType` Type of order (MARKET, LIMIT, etc.) - `"MARKET"` - `"LIMIT"` - `"STOP"` - `"STOP_LIMIT"` - `"TRAILING_STOP"` - `"TRAILING_STOP_LIMIT"` - `"OTHER"` - `quantity: string` Total order quantity - `side: Side` Side of the order (BUY, SELL, SELL_SHORT) - `"BUY"` - `"SELL"` - `"SELL_SHORT"` - `"OTHER"` - `status: OrderStatus` Current status of the order - `"PENDING_NEW"` - `"NEW"` - `"PARTIALLY_FILLED"` - `"FILLED"` - `"CANCELED"` - `"REJECTED"` - `"EXPIRED"` - `"PENDING_CANCEL"` - `"PENDING_REPLACE"` - `"REPLACED"` - `"DONE_FOR_DAY"` - `"STOPPED"` - `"SUSPENDED"` - `"CALCULATED"` - `"OTHER"` - `symbol: string` Trading symbol - `time_in_force: TimeInForce` Time in force instruction - `"DAY"` - `"GOOD_TILL_CANCEL"` - `"IMMEDIATE_OR_CANCEL"` - `"FILL_OR_KILL"` - `"GOOD_TILL_DATE"` - `"AT_THE_OPENING"` - `"AT_THE_CLOSE"` - `"GOOD_TILL_CROSSING"` - `"GOOD_THROUGH_CROSSING"` - `"AT_CROSSING"` - `"OTHER"` - `updated_at: string` Timestamp of the most recent update (UTC) - `venue: string` MIC code of the venue where the order is routed - `average_fill_price?: string | null` Average fill price across all executions - `details?: Array` Contains execution, rejection or cancellation details, if any - `expires_at?: string | null` Timestamp when the order will expire (UTC). Present when time_in_force is GOOD_TILL_DATE. - `extended_hours?: boolean | null` Whether the order is eligible for extended-hours trading. - `limit_offset?: string | null` Limit offset for trailing stop-limit orders (signed) - `limit_price?: string | null` Limit price (for LIMIT and STOP_LIMIT orders) - `queue_state?: QueueState | null` Parent order queue state, present when the order is awaiting release or released. - `"AWAITING_RELEASE"` - `"RELEASED"` - `releases_at?: string | null` Scheduled release time for orders awaiting release. - `stop_price?: string | null` Stop price (for STOP and STOP_LIMIT orders) - `trailing_limit_px?: string | null` Current trailing limit price computed by the trailing strategy - `trailing_offset?: string | null` Trailing offset amount for trailing orders - `trailing_offset_type?: TrailingOffsetType | null` Trailing offset type for trailing orders - `"PRICE"` - `"BPS"` - `trailing_stop_px?: string | null` Current trailing stop price computed by the trailing strategy - `trailing_watermark_px?: string | null` Trailing watermark price for trailing orders - `trailing_watermark_ts?: string | null` Trailing watermark timestamp for trailing orders - `underlying_instrument_id?: string | null` OEMS instrument ID of the option's underlying instrument. Populated only for OPTIONS orders; `null` for non-options and for options whose underlier cannot be resolved from the instrument cache. ### Example ```typescript import ClearStreet from '@clear-street-internal/sdk'; const client = new ClearStreet({ apiKey: 'My API Key', }); const response = await client.v1.positions.closePositions(0); console.log(response); ``` #### Response ```json { "data": [ { "account_id": 19816, "average_fill_price": null, "created_at": "2025-10-03T14:01:15.000000000Z", "filled_quantity": "0", "id": "019c0b57-0850-7b0b-8a2c-5ee3fb5a5876", "instrument_id": "c3c4c5c6-d3d4-e3e4-f3f4-f5f6f7f8f9fa", "instrument_type": "COMMON_STOCK", "leaves_quantity": "25", "limit_price": null, "order_type": "MARKET", "quantity": "25", "side": "SELL", "status": "PENDING_NEW", "stop_price": null, "symbol": "GOOG", "time_in_force": "DAY", "updated_at": "2025-10-03T14:01:15.000000000Z", "venue": "XNMS" } ], "error": null, "metadata": { "request_id": "3f4a5b6c-7d8e-9f0a-1b2c-3d4e5f6a7b8c" } } ``` ## Close Position `client.v1.positions.closePosition(InstrumentIDOrSymbolinstrumentID, PositionClosePositionParamsparams, RequestOptionsoptions?): PositionClosePositionResponse` **delete** `/v1/accounts/{account_id}/positions/{instrument_id}` Delete a position within an account for an instrument. Retrieves orders generated to close the position. ### Parameters - `instrument_id: InstrumentIDOrSymbol` OEMS instrument UUID - `params: PositionClosePositionParams` - `account_id: number` Path param: Account identifier - `cancel_orders?: boolean | null` Body param: Whether to cancel existing open orders for the position before submitting closing orders. ### Returns - `PositionClosePositionResponse extends BaseResponse` - `data: OrderList` - `id: string` Engine-assigned unique identifier for this order (UUID). - `account_id: number` Account placing the order - `client_order_id: string` Client-provided identifier echoed back (FIX tag 11). - `created_at: string` Timestamp when order was created (UTC) - `filled_quantity: string` Cumulative filled quantity - `instrument_id: string` OEMS instrument UUID for the traded instrument. - `instrument_type: SecurityType` Type of security - `"COMMON_STOCK"` - `"PREFERRED_STOCK"` - `"OPTION"` - `"CASH"` - `"OTHER"` - `leaves_quantity: string` Remaining unfilled quantity - `order_type: OrderType` Type of order (MARKET, LIMIT, etc.) - `"MARKET"` - `"LIMIT"` - `"STOP"` - `"STOP_LIMIT"` - `"TRAILING_STOP"` - `"TRAILING_STOP_LIMIT"` - `"OTHER"` - `quantity: string` Total order quantity - `side: Side` Side of the order (BUY, SELL, SELL_SHORT) - `"BUY"` - `"SELL"` - `"SELL_SHORT"` - `"OTHER"` - `status: OrderStatus` Current status of the order - `"PENDING_NEW"` - `"NEW"` - `"PARTIALLY_FILLED"` - `"FILLED"` - `"CANCELED"` - `"REJECTED"` - `"EXPIRED"` - `"PENDING_CANCEL"` - `"PENDING_REPLACE"` - `"REPLACED"` - `"DONE_FOR_DAY"` - `"STOPPED"` - `"SUSPENDED"` - `"CALCULATED"` - `"OTHER"` - `symbol: string` Trading symbol - `time_in_force: TimeInForce` Time in force instruction - `"DAY"` - `"GOOD_TILL_CANCEL"` - `"IMMEDIATE_OR_CANCEL"` - `"FILL_OR_KILL"` - `"GOOD_TILL_DATE"` - `"AT_THE_OPENING"` - `"AT_THE_CLOSE"` - `"GOOD_TILL_CROSSING"` - `"GOOD_THROUGH_CROSSING"` - `"AT_CROSSING"` - `"OTHER"` - `updated_at: string` Timestamp of the most recent update (UTC) - `venue: string` MIC code of the venue where the order is routed - `average_fill_price?: string | null` Average fill price across all executions - `details?: Array` Contains execution, rejection or cancellation details, if any - `expires_at?: string | null` Timestamp when the order will expire (UTC). Present when time_in_force is GOOD_TILL_DATE. - `extended_hours?: boolean | null` Whether the order is eligible for extended-hours trading. - `limit_offset?: string | null` Limit offset for trailing stop-limit orders (signed) - `limit_price?: string | null` Limit price (for LIMIT and STOP_LIMIT orders) - `queue_state?: QueueState | null` Parent order queue state, present when the order is awaiting release or released. - `"AWAITING_RELEASE"` - `"RELEASED"` - `releases_at?: string | null` Scheduled release time for orders awaiting release. - `stop_price?: string | null` Stop price (for STOP and STOP_LIMIT orders) - `trailing_limit_px?: string | null` Current trailing limit price computed by the trailing strategy - `trailing_offset?: string | null` Trailing offset amount for trailing orders - `trailing_offset_type?: TrailingOffsetType | null` Trailing offset type for trailing orders - `"PRICE"` - `"BPS"` - `trailing_stop_px?: string | null` Current trailing stop price computed by the trailing strategy - `trailing_watermark_px?: string | null` Trailing watermark price for trailing orders - `trailing_watermark_ts?: string | null` Trailing watermark timestamp for trailing orders - `underlying_instrument_id?: string | null` OEMS instrument ID of the option's underlying instrument. Populated only for OPTIONS orders; `null` for non-options and for options whose underlier cannot be resolved from the instrument cache. ### Example ```typescript import ClearStreet from '@clear-street-internal/sdk'; const client = new ClearStreet({ apiKey: 'My API Key', }); const response = await client.v1.positions.closePosition('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { account_id: 0, }); console.log(response); ``` #### Response ```json { "data": [ { "account_id": 19816, "average_fill_price": null, "created_at": "2025-10-03T14:01:15.000000000Z", "filled_quantity": "0", "id": "019c0b56-2119-7482-a80f-5a2a316524d9", "instrument_id": "c3c4c5c6-d3d4-e3e4-f3f4-f5f6f7f8f9fa", "instrument_type": "COMMON_STOCK", "leaves_quantity": "25", "limit_price": null, "order_type": "MARKET", "quantity": "25", "side": "SELL", "status": "PENDING_NEW", "stop_price": null, "symbol": "GOOG", "time_in_force": "DAY", "updated_at": "2025-10-03T14:01:15.000000000Z", "venue": "XNMS" } ], "error": null, "metadata": { "request_id": "3f4a5b6c-7d8e-9f0a-1b2c-3d4e5f6a7b8c" } } ``` ## List Position Instructions `client.v1.positions.getPositionInstructions(numberaccountID, PositionGetPositionInstructionsParamsquery?, RequestOptionsoptions?): PositionGetPositionInstructionsResponse` **get** `/v1/accounts/{account_id}/positions/instructions` Returns the current lifecycle state of the account's position instructions. Optionally filter by a specific contract. ### Parameters - `accountID: number` - `query: PositionGetPositionInstructionsParams` - `instrument_id?: InstrumentIDOrSymbol` Limit results to a single contract. Accepts the instrument id or the OSI symbol. ### Returns - `PositionGetPositionInstructionsResponse extends BaseResponse` - `data: PositionInstructionList` - `id: string` Server-assigned id. Used as the path parameter on cancel. - `account_id: number` Account the instruction belongs to. - `instruction_id: string` Caller-supplied idempotency key echoed from the submit request; the server-assigned fallback when none was supplied. - `instruction_type: PositionInstructionType` The action this instruction requests. - `"EXERCISE"` - `"DO_NOT_EXERCISE"` - `"CONTRARY_EXERCISE"` - `instrument_id: string` Identifier of the options contract this instruction acts on. - `quantity: string` Number of contracts included in the instruction. - `status: PositionInstructionStatus` Current lifecycle status. - `"SENT"` - `"ACCEPTED"` - `"REJECTED"` - `"ENGINE_REJECTED"` - `"CANCEL_REQUESTED"` - `"CANCELLED"` - `"CANCEL_FAILED"` - `"UNKNOWN"` - `symbol: string` Options symbol (OSI) for display. - `accepted_quantity?: string | null` Number of contracts accepted by the clearing venue. Populated once the instruction reaches `ACCEPTED`. - `created_at?: string | null` When the instruction was first accepted by the service. - `rejection_reason?: string | null` Human-readable explanation populated on any non-success terminal status — `REJECTED`, `ENGINE_REJECTED`, or `CANCEL_FAILED`. On a `207 Multi-Status` batch submit the top-level `error` field summarizes the batch; per-row detail continues to live here. - `updated_at?: string | null` When the instruction's lifecycle state last changed. ### Example ```typescript import ClearStreet from '@clear-street-internal/sdk'; const client = new ClearStreet({ apiKey: 'My API Key', }); const response = await client.v1.positions.getPositionInstructions(0); console.log(response); ``` #### Response ```json { "metadata": { "request_id": "request_id", "next_page_token": "U3RhaW5sZXNzIHJvY2tz", "page_number": 0, "previous_page_token": "U3RhaW5sZXNzIHJvY2tz", "total_items": 0, "total_pages": 0 }, "error": { "code": 400, "message": "Order quantity must be greater than zero", "details": [ { "foo": "bar" } ] }, "data": [ { "id": "0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e02", "account_id": 122503, "instruction_id": "ui-20260424-001", "instruction_type": "EXERCISE", "instrument_id": "0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e02", "quantity": "1", "status": "SENT", "symbol": "AAPL 280121C00195000", "accepted_quantity": null, "created_at": "2026-04-24T14:30:00Z", "rejection_reason": null, "updated_at": "2026-04-24T14:30:00Z" } ] } ``` ## Submit Position Instructions `client.v1.positions.submitPositionInstructions(numberaccountID, PositionSubmitPositionInstructionsParamsparams, RequestOptionsoptions?): PositionSubmitPositionInstructionsResponse` **post** `/v1/accounts/{account_id}/positions/instructions` Submit one or more position instructions (Exercise, Do-Not-Exercise, Contrary Exercise Advice) against the account. Batch semantics: - **All rows accepted** → `200 OK`. Every row is in `data` with `status = SENT`. - **Partial success** → `207 Multi-Status`. `data` contains every row; rejected rows carry `status = ENGINE_REJECTED` (or `REJECTED`) and `rejection_reason`. The top-level `error` summarizes the batch failure. - **All rows rejected** → `4xx`/`5xx` error response. The HTTP status reflects the underlying cause: `409` for duplicate `instruction_id`, `400` for validation failures such as DNE/CEA on a non-expiry day, `503` if the clearing service is unavailable. No `data` is returned. Pre-flight validation (unknown `instrument_id`, unencodable `quantity`) short-circuits the whole batch with a `4xx` before any row is submitted. ### Parameters - `accountID: number` - `params: PositionSubmitPositionInstructionsParams` - `instructions: Array` - `instruction_type: PositionInstructionType` The action to take. - `"EXERCISE"` - `"DO_NOT_EXERCISE"` - `"CONTRARY_EXERCISE"` - `instrument_id: string` Identifier of the options contract to act on. Unknown ids return 404. - `quantity: string` Number of contracts to include in the instruction. - `instruction_id?: string | null` Caller-supplied idempotency key. Echoed on the response. The server generates a unique id when omitted. ### Returns - `PositionSubmitPositionInstructionsResponse extends BaseResponse` - `data: PositionInstructionList` - `id: string` Server-assigned id. Used as the path parameter on cancel. - `account_id: number` Account the instruction belongs to. - `instruction_id: string` Caller-supplied idempotency key echoed from the submit request; the server-assigned fallback when none was supplied. - `instruction_type: PositionInstructionType` The action this instruction requests. - `"EXERCISE"` - `"DO_NOT_EXERCISE"` - `"CONTRARY_EXERCISE"` - `instrument_id: string` Identifier of the options contract this instruction acts on. - `quantity: string` Number of contracts included in the instruction. - `status: PositionInstructionStatus` Current lifecycle status. - `"SENT"` - `"ACCEPTED"` - `"REJECTED"` - `"ENGINE_REJECTED"` - `"CANCEL_REQUESTED"` - `"CANCELLED"` - `"CANCEL_FAILED"` - `"UNKNOWN"` - `symbol: string` Options symbol (OSI) for display. - `accepted_quantity?: string | null` Number of contracts accepted by the clearing venue. Populated once the instruction reaches `ACCEPTED`. - `created_at?: string | null` When the instruction was first accepted by the service. - `rejection_reason?: string | null` Human-readable explanation populated on any non-success terminal status — `REJECTED`, `ENGINE_REJECTED`, or `CANCEL_FAILED`. On a `207 Multi-Status` batch submit the top-level `error` field summarizes the batch; per-row detail continues to live here. - `updated_at?: string | null` When the instruction's lifecycle state last changed. ### Example ```typescript import ClearStreet from '@clear-street-internal/sdk'; const client = new ClearStreet({ apiKey: 'My API Key', }); const response = await client.v1.positions.submitPositionInstructions(0, { instructions: [ { instruction_type: 'EXERCISE', instrument_id: '0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e02', quantity: '1', }, ], }); console.log(response); ``` #### Response ```json { "data": [ { "account_id": 122503, "id": "0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e02", "instruction_id": "ui-20260424-001", "instruction_type": "EXERCISE", "instrument_id": "0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e01", "quantity": "1", "status": "SENT", "symbol": "AAPL 280121C00195000" } ], "metadata": { "request_id": "0a5c9ebf-a9a7-4f2d-9c7e-f2b5f0b1bd01" } } ``` ## Cancel Position Instruction `client.v1.positions.cancelPositionInstruction(stringinstructionID, PositionCancelPositionInstructionParamsparams, RequestOptionsoptions?): PositionCancelPositionInstructionResponse` **delete** `/v1/accounts/{account_id}/positions/instructions/{instruction_id}` Cancel an outstanding position instruction by its server-assigned `id`. Returns the updated instruction with status `CANCEL_REQUESTED`. The terminal `CANCELLED` or `CANCEL_FAILED` state arrives asynchronously and is observable via subsequent GETs. ### Parameters - `instructionID: string` - `params: PositionCancelPositionInstructionParams` - `account_id: number` Account identifier ### Returns - `PositionCancelPositionInstructionResponse extends BaseResponse` - `data: PositionInstruction` A position instruction and its current lifecycle state. - `id: string` Server-assigned id. Used as the path parameter on cancel. - `account_id: number` Account the instruction belongs to. - `instruction_id: string` Caller-supplied idempotency key echoed from the submit request; the server-assigned fallback when none was supplied. - `instruction_type: PositionInstructionType` The action this instruction requests. - `"EXERCISE"` - `"DO_NOT_EXERCISE"` - `"CONTRARY_EXERCISE"` - `instrument_id: string` Identifier of the options contract this instruction acts on. - `quantity: string` Number of contracts included in the instruction. - `status: PositionInstructionStatus` Current lifecycle status. - `"SENT"` - `"ACCEPTED"` - `"REJECTED"` - `"ENGINE_REJECTED"` - `"CANCEL_REQUESTED"` - `"CANCELLED"` - `"CANCEL_FAILED"` - `"UNKNOWN"` - `symbol: string` Options symbol (OSI) for display. - `accepted_quantity?: string | null` Number of contracts accepted by the clearing venue. Populated once the instruction reaches `ACCEPTED`. - `created_at?: string | null` When the instruction was first accepted by the service. - `rejection_reason?: string | null` Human-readable explanation populated on any non-success terminal status — `REJECTED`, `ENGINE_REJECTED`, or `CANCEL_FAILED`. On a `207 Multi-Status` batch submit the top-level `error` field summarizes the batch; per-row detail continues to live here. - `updated_at?: string | null` When the instruction's lifecycle state last changed. ### Example ```typescript import ClearStreet from '@clear-street-internal/sdk'; const client = new ClearStreet({ apiKey: 'My API Key', }); const response = await client.v1.positions.cancelPositionInstruction( '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { account_id: 0 }, ); console.log(response); ``` #### Response ```json { "metadata": { "request_id": "request_id", "next_page_token": "U3RhaW5sZXNzIHJvY2tz", "page_number": 0, "previous_page_token": "U3RhaW5sZXNzIHJvY2tz", "total_items": 0, "total_pages": 0 }, "error": { "code": 400, "message": "Order quantity must be greater than zero", "details": [ { "foo": "bar" } ] }, "data": { "id": "0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e02", "account_id": 122503, "instruction_id": "ui-20260424-001", "instruction_type": "EXERCISE", "instrument_id": "0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e02", "quantity": "1", "status": "SENT", "symbol": "AAPL 280121C00195000", "accepted_quantity": null, "created_at": "2026-04-24T14:30:00Z", "rejection_reason": null, "updated_at": "2026-04-24T14:30:00Z" } } ``` ## Domain Types ### Position - `Position` Represents a holding of a particular instrument in an account - `account_id: number` The account this position belongs to - `available_quantity: string` The quantity of a position that is free to be operated on. - `instrument_id: string` OEMS instrument UUID - `instrument_type: SecurityType` Type of security - `"COMMON_STOCK"` - `"PREFERRED_STOCK"` - `"OPTION"` - `"CASH"` - `"OTHER"` - `market_value: string` The current market value of the position - `position_type: PositionType` The type of position - `"LONG"` - `"SHORT"` - `"LONG_CALL"` - `"SHORT_CALL"` - `"LONG_PUT"` - `"SHORT_PUT"` - `quantity: string` The number of shares or contracts. Can be positive (long) or negative (short) - `symbol: string` The trading symbol for the instrument - `avg_price?: string | null` The average price paid per share or contract for this position - `closing_price?: string | null` The closing price used to value the position for the last trading day - `closing_price_date?: string | null` The market date associated with `closing_price` - `cost_basis?: string | null` The total cost basis for this position - `daily_unrealized_pnl?: string | null` The unrealized profit or loss for this position relative to the previous close - `daily_unrealized_pnl_pct?: string | null` The unrealized profit/loss for the position for the current day, expressed as a percentage of the baseline value (range: 0-100). - `instrument_price?: string | null` The current market price of the instrument - `underlying_instrument_id?: string | null` OEMS instrument identifier of the underlying instrument, if resolvable - `unrealized_pnl?: string | null` The total unrealized profit or loss for this position based on current market value - `unrealized_pnl_pct?: string | null` The unrealized profit/loss for the position, expressed as a percentage of the position's cost basis (range: 0-100). ### Position Instruction - `PositionInstruction` A position instruction and its current lifecycle state. - `id: string` Server-assigned id. Used as the path parameter on cancel. - `account_id: number` Account the instruction belongs to. - `instruction_id: string` Caller-supplied idempotency key echoed from the submit request; the server-assigned fallback when none was supplied. - `instruction_type: PositionInstructionType` The action this instruction requests. - `"EXERCISE"` - `"DO_NOT_EXERCISE"` - `"CONTRARY_EXERCISE"` - `instrument_id: string` Identifier of the options contract this instruction acts on. - `quantity: string` Number of contracts included in the instruction. - `status: PositionInstructionStatus` Current lifecycle status. - `"SENT"` - `"ACCEPTED"` - `"REJECTED"` - `"ENGINE_REJECTED"` - `"CANCEL_REQUESTED"` - `"CANCELLED"` - `"CANCEL_FAILED"` - `"UNKNOWN"` - `symbol: string` Options symbol (OSI) for display. - `accepted_quantity?: string | null` Number of contracts accepted by the clearing venue. Populated once the instruction reaches `ACCEPTED`. - `created_at?: string | null` When the instruction was first accepted by the service. - `rejection_reason?: string | null` Human-readable explanation populated on any non-success terminal status — `REJECTED`, `ENGINE_REJECTED`, or `CANCEL_FAILED`. On a `207 Multi-Status` batch submit the top-level `error` field summarizes the batch; per-row detail continues to live here. - `updated_at?: string | null` When the instruction's lifecycle state last changed. ### Position Instruction List - `PositionInstructionList = Array` - `id: string` Server-assigned id. Used as the path parameter on cancel. - `account_id: number` Account the instruction belongs to. - `instruction_id: string` Caller-supplied idempotency key echoed from the submit request; the server-assigned fallback when none was supplied. - `instruction_type: PositionInstructionType` The action this instruction requests. - `"EXERCISE"` - `"DO_NOT_EXERCISE"` - `"CONTRARY_EXERCISE"` - `instrument_id: string` Identifier of the options contract this instruction acts on. - `quantity: string` Number of contracts included in the instruction. - `status: PositionInstructionStatus` Current lifecycle status. - `"SENT"` - `"ACCEPTED"` - `"REJECTED"` - `"ENGINE_REJECTED"` - `"CANCEL_REQUESTED"` - `"CANCELLED"` - `"CANCEL_FAILED"` - `"UNKNOWN"` - `symbol: string` Options symbol (OSI) for display. - `accepted_quantity?: string | null` Number of contracts accepted by the clearing venue. Populated once the instruction reaches `ACCEPTED`. - `created_at?: string | null` When the instruction was first accepted by the service. - `rejection_reason?: string | null` Human-readable explanation populated on any non-success terminal status — `REJECTED`, `ENGINE_REJECTED`, or `CANCEL_FAILED`. On a `207 Multi-Status` batch submit the top-level `error` field summarizes the batch; per-row detail continues to live here. - `updated_at?: string | null` When the instruction's lifecycle state last changed. ### Position Instruction Status - `PositionInstructionStatus = "SENT" | "ACCEPTED" | "REJECTED" | 5 more` Lifecycle status of a position instruction. - `"SENT"` - `"ACCEPTED"` - `"REJECTED"` - `"ENGINE_REJECTED"` - `"CANCEL_REQUESTED"` - `"CANCELLED"` - `"CANCEL_FAILED"` - `"UNKNOWN"` ### Position Instruction Type - `PositionInstructionType = "EXERCISE" | "DO_NOT_EXERCISE" | "CONTRARY_EXERCISE"` The action to take against an options position. - `"EXERCISE"` - `"DO_NOT_EXERCISE"` - `"CONTRARY_EXERCISE"` ### Position List - `PositionList = Array` - `account_id: number` The account this position belongs to - `available_quantity: string` The quantity of a position that is free to be operated on. - `instrument_id: string` OEMS instrument UUID - `instrument_type: SecurityType` Type of security - `"COMMON_STOCK"` - `"PREFERRED_STOCK"` - `"OPTION"` - `"CASH"` - `"OTHER"` - `market_value: string` The current market value of the position - `position_type: PositionType` The type of position - `"LONG"` - `"SHORT"` - `"LONG_CALL"` - `"SHORT_CALL"` - `"LONG_PUT"` - `"SHORT_PUT"` - `quantity: string` The number of shares or contracts. Can be positive (long) or negative (short) - `symbol: string` The trading symbol for the instrument - `avg_price?: string | null` The average price paid per share or contract for this position - `closing_price?: string | null` The closing price used to value the position for the last trading day - `closing_price_date?: string | null` The market date associated with `closing_price` - `cost_basis?: string | null` The total cost basis for this position - `daily_unrealized_pnl?: string | null` The unrealized profit or loss for this position relative to the previous close - `daily_unrealized_pnl_pct?: string | null` The unrealized profit/loss for the position for the current day, expressed as a percentage of the baseline value (range: 0-100). - `instrument_price?: string | null` The current market price of the instrument - `underlying_instrument_id?: string | null` OEMS instrument identifier of the underlying instrument, if resolvable - `unrealized_pnl?: string | null` The total unrealized profit or loss for this position based on current market value - `unrealized_pnl_pct?: string | null` The unrealized profit/loss for the position, expressed as a percentage of the position's cost basis (range: 0-100). ### Position Type - `PositionType = "LONG" | "SHORT" | "LONG_CALL" | 3 more` Position type classification - `"LONG"` - `"SHORT"` - `"LONG_CALL"` - `"SHORT_CALL"` - `"LONG_PUT"` - `"SHORT_PUT"` ### Position Get Positions Response - `PositionGetPositionsResponse extends BaseResponse` - `data: PositionList` - `account_id: number` The account this position belongs to - `available_quantity: string` The quantity of a position that is free to be operated on. - `instrument_id: string` OEMS instrument UUID - `instrument_type: SecurityType` Type of security - `"COMMON_STOCK"` - `"PREFERRED_STOCK"` - `"OPTION"` - `"CASH"` - `"OTHER"` - `market_value: string` The current market value of the position - `position_type: PositionType` The type of position - `"LONG"` - `"SHORT"` - `"LONG_CALL"` - `"SHORT_CALL"` - `"LONG_PUT"` - `"SHORT_PUT"` - `quantity: string` The number of shares or contracts. Can be positive (long) or negative (short) - `symbol: string` The trading symbol for the instrument - `avg_price?: string | null` The average price paid per share or contract for this position - `closing_price?: string | null` The closing price used to value the position for the last trading day - `closing_price_date?: string | null` The market date associated with `closing_price` - `cost_basis?: string | null` The total cost basis for this position - `daily_unrealized_pnl?: string | null` The unrealized profit or loss for this position relative to the previous close - `daily_unrealized_pnl_pct?: string | null` The unrealized profit/loss for the position for the current day, expressed as a percentage of the baseline value (range: 0-100). - `instrument_price?: string | null` The current market price of the instrument - `underlying_instrument_id?: string | null` OEMS instrument identifier of the underlying instrument, if resolvable - `unrealized_pnl?: string | null` The total unrealized profit or loss for this position based on current market value - `unrealized_pnl_pct?: string | null` The unrealized profit/loss for the position, expressed as a percentage of the position's cost basis (range: 0-100). ### Position Close Positions Response - `PositionClosePositionsResponse extends BaseResponse` - `data: OrderList` - `id: string` Engine-assigned unique identifier for this order (UUID). - `account_id: number` Account placing the order - `client_order_id: string` Client-provided identifier echoed back (FIX tag 11). - `created_at: string` Timestamp when order was created (UTC) - `filled_quantity: string` Cumulative filled quantity - `instrument_id: string` OEMS instrument UUID for the traded instrument. - `instrument_type: SecurityType` Type of security - `"COMMON_STOCK"` - `"PREFERRED_STOCK"` - `"OPTION"` - `"CASH"` - `"OTHER"` - `leaves_quantity: string` Remaining unfilled quantity - `order_type: OrderType` Type of order (MARKET, LIMIT, etc.) - `"MARKET"` - `"LIMIT"` - `"STOP"` - `"STOP_LIMIT"` - `"TRAILING_STOP"` - `"TRAILING_STOP_LIMIT"` - `"OTHER"` - `quantity: string` Total order quantity - `side: Side` Side of the order (BUY, SELL, SELL_SHORT) - `"BUY"` - `"SELL"` - `"SELL_SHORT"` - `"OTHER"` - `status: OrderStatus` Current status of the order - `"PENDING_NEW"` - `"NEW"` - `"PARTIALLY_FILLED"` - `"FILLED"` - `"CANCELED"` - `"REJECTED"` - `"EXPIRED"` - `"PENDING_CANCEL"` - `"PENDING_REPLACE"` - `"REPLACED"` - `"DONE_FOR_DAY"` - `"STOPPED"` - `"SUSPENDED"` - `"CALCULATED"` - `"OTHER"` - `symbol: string` Trading symbol - `time_in_force: TimeInForce` Time in force instruction - `"DAY"` - `"GOOD_TILL_CANCEL"` - `"IMMEDIATE_OR_CANCEL"` - `"FILL_OR_KILL"` - `"GOOD_TILL_DATE"` - `"AT_THE_OPENING"` - `"AT_THE_CLOSE"` - `"GOOD_TILL_CROSSING"` - `"GOOD_THROUGH_CROSSING"` - `"AT_CROSSING"` - `"OTHER"` - `updated_at: string` Timestamp of the most recent update (UTC) - `venue: string` MIC code of the venue where the order is routed - `average_fill_price?: string | null` Average fill price across all executions - `details?: Array` Contains execution, rejection or cancellation details, if any - `expires_at?: string | null` Timestamp when the order will expire (UTC). Present when time_in_force is GOOD_TILL_DATE. - `extended_hours?: boolean | null` Whether the order is eligible for extended-hours trading. - `limit_offset?: string | null` Limit offset for trailing stop-limit orders (signed) - `limit_price?: string | null` Limit price (for LIMIT and STOP_LIMIT orders) - `queue_state?: QueueState | null` Parent order queue state, present when the order is awaiting release or released. - `"AWAITING_RELEASE"` - `"RELEASED"` - `releases_at?: string | null` Scheduled release time for orders awaiting release. - `stop_price?: string | null` Stop price (for STOP and STOP_LIMIT orders) - `trailing_limit_px?: string | null` Current trailing limit price computed by the trailing strategy - `trailing_offset?: string | null` Trailing offset amount for trailing orders - `trailing_offset_type?: TrailingOffsetType | null` Trailing offset type for trailing orders - `"PRICE"` - `"BPS"` - `trailing_stop_px?: string | null` Current trailing stop price computed by the trailing strategy - `trailing_watermark_px?: string | null` Trailing watermark price for trailing orders - `trailing_watermark_ts?: string | null` Trailing watermark timestamp for trailing orders - `underlying_instrument_id?: string | null` OEMS instrument ID of the option's underlying instrument. Populated only for OPTIONS orders; `null` for non-options and for options whose underlier cannot be resolved from the instrument cache. ### Position Close Position Response - `PositionClosePositionResponse extends BaseResponse` - `data: OrderList` - `id: string` Engine-assigned unique identifier for this order (UUID). - `account_id: number` Account placing the order - `client_order_id: string` Client-provided identifier echoed back (FIX tag 11). - `created_at: string` Timestamp when order was created (UTC) - `filled_quantity: string` Cumulative filled quantity - `instrument_id: string` OEMS instrument UUID for the traded instrument. - `instrument_type: SecurityType` Type of security - `"COMMON_STOCK"` - `"PREFERRED_STOCK"` - `"OPTION"` - `"CASH"` - `"OTHER"` - `leaves_quantity: string` Remaining unfilled quantity - `order_type: OrderType` Type of order (MARKET, LIMIT, etc.) - `"MARKET"` - `"LIMIT"` - `"STOP"` - `"STOP_LIMIT"` - `"TRAILING_STOP"` - `"TRAILING_STOP_LIMIT"` - `"OTHER"` - `quantity: string` Total order quantity - `side: Side` Side of the order (BUY, SELL, SELL_SHORT) - `"BUY"` - `"SELL"` - `"SELL_SHORT"` - `"OTHER"` - `status: OrderStatus` Current status of the order - `"PENDING_NEW"` - `"NEW"` - `"PARTIALLY_FILLED"` - `"FILLED"` - `"CANCELED"` - `"REJECTED"` - `"EXPIRED"` - `"PENDING_CANCEL"` - `"PENDING_REPLACE"` - `"REPLACED"` - `"DONE_FOR_DAY"` - `"STOPPED"` - `"SUSPENDED"` - `"CALCULATED"` - `"OTHER"` - `symbol: string` Trading symbol - `time_in_force: TimeInForce` Time in force instruction - `"DAY"` - `"GOOD_TILL_CANCEL"` - `"IMMEDIATE_OR_CANCEL"` - `"FILL_OR_KILL"` - `"GOOD_TILL_DATE"` - `"AT_THE_OPENING"` - `"AT_THE_CLOSE"` - `"GOOD_TILL_CROSSING"` - `"GOOD_THROUGH_CROSSING"` - `"AT_CROSSING"` - `"OTHER"` - `updated_at: string` Timestamp of the most recent update (UTC) - `venue: string` MIC code of the venue where the order is routed - `average_fill_price?: string | null` Average fill price across all executions - `details?: Array` Contains execution, rejection or cancellation details, if any - `expires_at?: string | null` Timestamp when the order will expire (UTC). Present when time_in_force is GOOD_TILL_DATE. - `extended_hours?: boolean | null` Whether the order is eligible for extended-hours trading. - `limit_offset?: string | null` Limit offset for trailing stop-limit orders (signed) - `limit_price?: string | null` Limit price (for LIMIT and STOP_LIMIT orders) - `queue_state?: QueueState | null` Parent order queue state, present when the order is awaiting release or released. - `"AWAITING_RELEASE"` - `"RELEASED"` - `releases_at?: string | null` Scheduled release time for orders awaiting release. - `stop_price?: string | null` Stop price (for STOP and STOP_LIMIT orders) - `trailing_limit_px?: string | null` Current trailing limit price computed by the trailing strategy - `trailing_offset?: string | null` Trailing offset amount for trailing orders - `trailing_offset_type?: TrailingOffsetType | null` Trailing offset type for trailing orders - `"PRICE"` - `"BPS"` - `trailing_stop_px?: string | null` Current trailing stop price computed by the trailing strategy - `trailing_watermark_px?: string | null` Trailing watermark price for trailing orders - `trailing_watermark_ts?: string | null` Trailing watermark timestamp for trailing orders - `underlying_instrument_id?: string | null` OEMS instrument ID of the option's underlying instrument. Populated only for OPTIONS orders; `null` for non-options and for options whose underlier cannot be resolved from the instrument cache. ### Position Get Position Instructions Response - `PositionGetPositionInstructionsResponse extends BaseResponse` - `data: PositionInstructionList` - `id: string` Server-assigned id. Used as the path parameter on cancel. - `account_id: number` Account the instruction belongs to. - `instruction_id: string` Caller-supplied idempotency key echoed from the submit request; the server-assigned fallback when none was supplied. - `instruction_type: PositionInstructionType` The action this instruction requests. - `"EXERCISE"` - `"DO_NOT_EXERCISE"` - `"CONTRARY_EXERCISE"` - `instrument_id: string` Identifier of the options contract this instruction acts on. - `quantity: string` Number of contracts included in the instruction. - `status: PositionInstructionStatus` Current lifecycle status. - `"SENT"` - `"ACCEPTED"` - `"REJECTED"` - `"ENGINE_REJECTED"` - `"CANCEL_REQUESTED"` - `"CANCELLED"` - `"CANCEL_FAILED"` - `"UNKNOWN"` - `symbol: string` Options symbol (OSI) for display. - `accepted_quantity?: string | null` Number of contracts accepted by the clearing venue. Populated once the instruction reaches `ACCEPTED`. - `created_at?: string | null` When the instruction was first accepted by the service. - `rejection_reason?: string | null` Human-readable explanation populated on any non-success terminal status — `REJECTED`, `ENGINE_REJECTED`, or `CANCEL_FAILED`. On a `207 Multi-Status` batch submit the top-level `error` field summarizes the batch; per-row detail continues to live here. - `updated_at?: string | null` When the instruction's lifecycle state last changed. ### Position Submit Position Instructions Response - `PositionSubmitPositionInstructionsResponse extends BaseResponse` - `data: PositionInstructionList` - `id: string` Server-assigned id. Used as the path parameter on cancel. - `account_id: number` Account the instruction belongs to. - `instruction_id: string` Caller-supplied idempotency key echoed from the submit request; the server-assigned fallback when none was supplied. - `instruction_type: PositionInstructionType` The action this instruction requests. - `"EXERCISE"` - `"DO_NOT_EXERCISE"` - `"CONTRARY_EXERCISE"` - `instrument_id: string` Identifier of the options contract this instruction acts on. - `quantity: string` Number of contracts included in the instruction. - `status: PositionInstructionStatus` Current lifecycle status. - `"SENT"` - `"ACCEPTED"` - `"REJECTED"` - `"ENGINE_REJECTED"` - `"CANCEL_REQUESTED"` - `"CANCELLED"` - `"CANCEL_FAILED"` - `"UNKNOWN"` - `symbol: string` Options symbol (OSI) for display. - `accepted_quantity?: string | null` Number of contracts accepted by the clearing venue. Populated once the instruction reaches `ACCEPTED`. - `created_at?: string | null` When the instruction was first accepted by the service. - `rejection_reason?: string | null` Human-readable explanation populated on any non-success terminal status — `REJECTED`, `ENGINE_REJECTED`, or `CANCEL_FAILED`. On a `207 Multi-Status` batch submit the top-level `error` field summarizes the batch; per-row detail continues to live here. - `updated_at?: string | null` When the instruction's lifecycle state last changed. ### Position Cancel Position Instruction Response - `PositionCancelPositionInstructionResponse extends BaseResponse` - `data: PositionInstruction` A position instruction and its current lifecycle state. - `id: string` Server-assigned id. Used as the path parameter on cancel. - `account_id: number` Account the instruction belongs to. - `instruction_id: string` Caller-supplied idempotency key echoed from the submit request; the server-assigned fallback when none was supplied. - `instruction_type: PositionInstructionType` The action this instruction requests. - `"EXERCISE"` - `"DO_NOT_EXERCISE"` - `"CONTRARY_EXERCISE"` - `instrument_id: string` Identifier of the options contract this instruction acts on. - `quantity: string` Number of contracts included in the instruction. - `status: PositionInstructionStatus` Current lifecycle status. - `"SENT"` - `"ACCEPTED"` - `"REJECTED"` - `"ENGINE_REJECTED"` - `"CANCEL_REQUESTED"` - `"CANCELLED"` - `"CANCEL_FAILED"` - `"UNKNOWN"` - `symbol: string` Options symbol (OSI) for display. - `accepted_quantity?: string | null` Number of contracts accepted by the clearing venue. Populated once the instruction reaches `ACCEPTED`. - `created_at?: string | null` When the instruction was first accepted by the service. - `rejection_reason?: string | null` Human-readable explanation populated on any non-success terminal status — `REJECTED`, `ENGINE_REJECTED`, or `CANCEL_FAILED`. On a `207 Multi-Status` batch submit the top-level `error` field summarizes the batch; per-row detail continues to live here. - `updated_at?: string | null` When the instruction's lifecycle state last changed. # Watchlist ## Get Watchlists `client.v1.watchlist.getWatchlists(WatchlistGetWatchlistsParamsquery?, RequestOptionsoptions?): WatchlistGetWatchlistsResponse` **get** `/v1/watchlists` List watchlists for the authenticated user ### Parameters - `query: WatchlistGetWatchlistsParams` - `page_size?: number` The number of items to return per page. Only used when page_token is not provided. - `page_token?: string` Token for retrieving the next or previous page of results. Contains encoded pagination state; when provided, page_size is ignored. ### Returns - `WatchlistGetWatchlistsResponse extends BaseResponse` - `data: WatchlistEntryList` - `id: string` The unique identifier for the watchlist. - `created_at: string` The timestamp when the watchlist was created. - `name: string` The user-provided watchlist name. ### Example ```typescript import ClearStreet from '@clear-street-internal/sdk'; const client = new ClearStreet({ apiKey: 'My API Key', }); const response = await client.v1.watchlist.getWatchlists(); console.log(response); ``` #### Response ```json { "data": [ { "created_at": "2025-01-15T10:00:00.000000000Z", "id": "550e8400-e29b-41d4-a716-446655440000", "name": "Tech Stocks" }, { "created_at": "2025-01-10T14:30:00.000000000Z", "id": "660e8400-e29b-41d4-a716-446655440001", "name": "Dividend Portfolio" } ], "error": null, "metadata": { "next_page_token": null, "page_number": 1, "request_id": "a1b2c3d4-e5f6-7890-1234-567890abcdef", "total_items": 2, "total_pages": 1 } } ``` ## Get Watchlist By ID `client.v1.watchlist.getWatchlistByID(stringwatchlistID, RequestOptionsoptions?): WatchlistGetWatchlistByIDResponse` **get** `/v1/watchlists/{watchlist_id}` Get a watchlist by ID with all its items ### Parameters - `watchlistID: string` ### Returns - `WatchlistGetWatchlistByIDResponse extends BaseResponse` - `data: WatchlistDetail` Detailed watchlist with all items - `id: string` Watchlist ID - `created_at: string` Creation timestamp - `items: Array` Items in the watchlist - `id: string` Item ID - `added_at: string` When the item was added - `added_price?: string | null` Price when the item was added - `instrument?: Instrument | null` Instrument details - `id: string` Unique OEMS instrument identifier (UUID) - `country_of_issue: string` The ISO country code of the instrument's issue - `currency: string` The ISO currency code in which the instrument is traded - `easy_to_borrow: boolean` Indicates if the instrument is classified as Easy-To-Borrow - `is_liquidation_only: boolean` Indicates if the instrument is liquidation only and cannot be bought - `is_marginable: boolean` Indicates if the instrument is marginable - `is_restricted: boolean` Indicates if the instrument is restricted from trading - `is_short_prohibited: boolean` Indicates if short selling is prohibited for the instrument - `is_threshold_security: boolean` Indicates if the instrument is on the Regulation SHO Threshold Security List - `is_tradable: boolean` Indicates if the instrument is tradable - `symbol: string` The trading symbol for the instrument - `venue: string` The MIC code of the primary listing venue - `adv?: string | null` Average daily share volume from the security definition. - `expiry?: string | null` The expiration date for options instruments - `instrument_type?: SecurityType | null` The type of security (e.g., Common Stock, ETF) - `"COMMON_STOCK"` - `"PREFERRED_STOCK"` - `"OPTION"` - `"CASH"` - `"OTHER"` - `long_margin_rate?: string | null` The percent of a long position's value you must post as margin - `name?: string | null` The full name of the instrument or its issuer - `notional_adv?: string | null` Notional ADV (`adv × previous_close`). The primary liquidity signal used by `/instruments/search` ranking. Computed at response time so it stays consistent with whatever `adv` and `previous_close` show. - `options_expiry_dates?: Array | null` Available options expiration dates for this instrument. Present only when `include_options_expiry_dates=true` in the request. - `previous_close?: string | null` Last close price from the security definition. - `short_margin_rate?: string | null` The percent of a short position's value you must post as margin - `strike_price?: string | null` The strike price for options instruments - `name: string` Watchlist name ### Example ```typescript import ClearStreet from '@clear-street-internal/sdk'; const client = new ClearStreet({ apiKey: 'My API Key', }); const response = await client.v1.watchlist.getWatchlistByID('550e8400-e29b-41d4-a716-446655440000'); console.log(response); ``` #### Response ```json { "data": { "created_at": "2025-01-15T10:00:00.000000000Z", "id": "550e8400-e29b-41d4-a716-446655440000", "items": [ { "added_at": "2025-01-16T09:30:00.000000000Z", "added_price": "150.25", "id": "660e8400-e29b-41d4-a716-446655440001", "instrument": { "country_of_issue": "US", "currency": "USD", "easy_to_borrow": true, "id": "a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8", "instrument_type": "COMMON_STOCK", "is_liquidation_only": false, "is_marginable": true, "is_restricted": false, "is_short_prohibited": false, "is_threshold_security": false, "is_tradable": true, "name": "Apple Inc.", "symbol": "AAPL", "venue": "XNMS" } } ], "name": "Tech Stocks" }, "error": null, "metadata": { "request_id": "a1b2c3d4-e5f6-7890-1234-567890abcdef" } } ``` ## Create Watchlist `client.v1.watchlist.createWatchlist(WatchlistCreateWatchlistParamsbody, RequestOptionsoptions?): WatchlistCreateWatchlistResponse` **post** `/v1/watchlists` Create Watchlist ### Parameters - `body: WatchlistCreateWatchlistParams` - `name: string` The desired watchlist name. ### Returns - `WatchlistCreateWatchlistResponse extends BaseResponse` - `data: WatchlistEntry` Represents a user watchlist. - `id: string` The unique identifier for the watchlist. - `created_at: string` The timestamp when the watchlist was created. - `name: string` The user-provided watchlist name. ### Example ```typescript import ClearStreet from '@clear-street-internal/sdk'; const client = new ClearStreet({ apiKey: 'My API Key', }); const response = await client.v1.watchlist.createWatchlist({ name: 'name' }); console.log(response); ``` #### Response ```json { "data": { "created_at": "2025-01-23T12:00:00.000000000Z", "id": "770e8400-e29b-41d4-a716-446655440002", "name": "Growth Stocks" }, "error": null, "metadata": { "request_id": "b2c3d4e5-f6a7-8901-2345-678901bcdefg" } } ``` ## Delete Watchlist `client.v1.watchlist.deleteWatchlist(stringwatchlistID, RequestOptionsoptions?): WatchlistDeleteWatchlistResponse` **delete** `/v1/watchlists/{watchlist_id}` Delete a watchlist and all its items ### Parameters - `watchlistID: string` ### Returns - `WatchlistDeleteWatchlistResponse = unknown` ### Example ```typescript import ClearStreet from '@clear-street-internal/sdk'; const client = new ClearStreet({ apiKey: 'My API Key', }); const response = await client.v1.watchlist.deleteWatchlist('550e8400-e29b-41d4-a716-446655440000'); console.log(response); ``` #### Response ```json { "data": null, "metadata": { "request_id": "cb824f1b-ea6e-4045-8169-9503be2b24d7" } } ``` ## Add Watchlist Item `client.v1.watchlist.addWatchlistItem(stringwatchlistID, WatchlistAddWatchlistItemParamsbody, RequestOptionsoptions?): WatchlistAddWatchlistItemResponse` **post** `/v1/watchlists/{watchlist_id}/items` Add an instrument to a watchlist ### Parameters - `watchlistID: string` - `body: WatchlistAddWatchlistItemParams` - `instrument_id: InstrumentIDOrSymbol` OEMS instrument UUID ### Returns - `WatchlistAddWatchlistItemResponse extends BaseResponse` - `data: AddWatchlistItemData` Response data for adding a watchlist item - `item_id: string` ID of the created item ### Example ```typescript import ClearStreet from '@clear-street-internal/sdk'; const client = new ClearStreet({ apiKey: 'My API Key', }); const response = await client.v1.watchlist.addWatchlistItem( '550e8400-e29b-41d4-a716-446655440000', { instrument_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' }, ); console.log(response); ``` #### Response ```json { "data": { "item_id": "770e8400-e29b-41d4-a716-446655440002" }, "error": null, "metadata": { "request_id": "b2c3d4e5-f6a7-8901-2345-678901bcdefg" } } ``` ## Delete Watchlist Item `client.v1.watchlist.deleteWatchlistItem(stringitemID, WatchlistDeleteWatchlistItemParamsparams, RequestOptionsoptions?): WatchlistDeleteWatchlistItemResponse` **delete** `/v1/watchlists/{watchlist_id}/items/{item_id}` Delete an instrument from a watchlist ### Parameters - `itemID: string` - `params: WatchlistDeleteWatchlistItemParams` - `watchlist_id: string` Watchlist ID ### Returns - `WatchlistDeleteWatchlistItemResponse = unknown` ### Example ```typescript import ClearStreet from '@clear-street-internal/sdk'; const client = new ClearStreet({ apiKey: 'My API Key', }); const response = await client.v1.watchlist.deleteWatchlistItem( '660e8400-e29b-41d4-a716-446655440001', { watchlist_id: '550e8400-e29b-41d4-a716-446655440000' }, ); console.log(response); ``` #### Response ```json { "data": null, "metadata": { "request_id": "5b0709e3-5868-4116-9a84-26f1b8c30503" } } ``` ## Domain Types ### Add Watchlist Item Data - `AddWatchlistItemData` Response data for adding a watchlist item - `item_id: string` ID of the created item ### Watchlist Detail - `WatchlistDetail` Detailed watchlist with all items - `id: string` Watchlist ID - `created_at: string` Creation timestamp - `items: Array` Items in the watchlist - `id: string` Item ID - `added_at: string` When the item was added - `added_price?: string | null` Price when the item was added - `instrument?: Instrument | null` Instrument details - `id: string` Unique OEMS instrument identifier (UUID) - `country_of_issue: string` The ISO country code of the instrument's issue - `currency: string` The ISO currency code in which the instrument is traded - `easy_to_borrow: boolean` Indicates if the instrument is classified as Easy-To-Borrow - `is_liquidation_only: boolean` Indicates if the instrument is liquidation only and cannot be bought - `is_marginable: boolean` Indicates if the instrument is marginable - `is_restricted: boolean` Indicates if the instrument is restricted from trading - `is_short_prohibited: boolean` Indicates if short selling is prohibited for the instrument - `is_threshold_security: boolean` Indicates if the instrument is on the Regulation SHO Threshold Security List - `is_tradable: boolean` Indicates if the instrument is tradable - `symbol: string` The trading symbol for the instrument - `venue: string` The MIC code of the primary listing venue - `adv?: string | null` Average daily share volume from the security definition. - `expiry?: string | null` The expiration date for options instruments - `instrument_type?: SecurityType | null` The type of security (e.g., Common Stock, ETF) - `"COMMON_STOCK"` - `"PREFERRED_STOCK"` - `"OPTION"` - `"CASH"` - `"OTHER"` - `long_margin_rate?: string | null` The percent of a long position's value you must post as margin - `name?: string | null` The full name of the instrument or its issuer - `notional_adv?: string | null` Notional ADV (`adv × previous_close`). The primary liquidity signal used by `/instruments/search` ranking. Computed at response time so it stays consistent with whatever `adv` and `previous_close` show. - `options_expiry_dates?: Array | null` Available options expiration dates for this instrument. Present only when `include_options_expiry_dates=true` in the request. - `previous_close?: string | null` Last close price from the security definition. - `short_margin_rate?: string | null` The percent of a short position's value you must post as margin - `strike_price?: string | null` The strike price for options instruments - `name: string` Watchlist name ### Watchlist Entry - `WatchlistEntry` Represents a user watchlist. - `id: string` The unique identifier for the watchlist. - `created_at: string` The timestamp when the watchlist was created. - `name: string` The user-provided watchlist name. ### Watchlist Entry List - `WatchlistEntryList = Array` - `id: string` The unique identifier for the watchlist. - `created_at: string` The timestamp when the watchlist was created. - `name: string` The user-provided watchlist name. ### Watchlist Item Entry - `WatchlistItemEntry` A single item in a watchlist - `id: string` Item ID - `added_at: string` When the item was added - `added_price?: string | null` Price when the item was added - `instrument?: Instrument | null` Instrument details - `id: string` Unique OEMS instrument identifier (UUID) - `country_of_issue: string` The ISO country code of the instrument's issue - `currency: string` The ISO currency code in which the instrument is traded - `easy_to_borrow: boolean` Indicates if the instrument is classified as Easy-To-Borrow - `is_liquidation_only: boolean` Indicates if the instrument is liquidation only and cannot be bought - `is_marginable: boolean` Indicates if the instrument is marginable - `is_restricted: boolean` Indicates if the instrument is restricted from trading - `is_short_prohibited: boolean` Indicates if short selling is prohibited for the instrument - `is_threshold_security: boolean` Indicates if the instrument is on the Regulation SHO Threshold Security List - `is_tradable: boolean` Indicates if the instrument is tradable - `symbol: string` The trading symbol for the instrument - `venue: string` The MIC code of the primary listing venue - `adv?: string | null` Average daily share volume from the security definition. - `expiry?: string | null` The expiration date for options instruments - `instrument_type?: SecurityType | null` The type of security (e.g., Common Stock, ETF) - `"COMMON_STOCK"` - `"PREFERRED_STOCK"` - `"OPTION"` - `"CASH"` - `"OTHER"` - `long_margin_rate?: string | null` The percent of a long position's value you must post as margin - `name?: string | null` The full name of the instrument or its issuer - `notional_adv?: string | null` Notional ADV (`adv × previous_close`). The primary liquidity signal used by `/instruments/search` ranking. Computed at response time so it stays consistent with whatever `adv` and `previous_close` show. - `options_expiry_dates?: Array | null` Available options expiration dates for this instrument. Present only when `include_options_expiry_dates=true` in the request. - `previous_close?: string | null` Last close price from the security definition. - `short_margin_rate?: string | null` The percent of a short position's value you must post as margin - `strike_price?: string | null` The strike price for options instruments ### Watchlist Get Watchlists Response - `WatchlistGetWatchlistsResponse extends BaseResponse` - `data: WatchlistEntryList` - `id: string` The unique identifier for the watchlist. - `created_at: string` The timestamp when the watchlist was created. - `name: string` The user-provided watchlist name. ### Watchlist Get Watchlist By ID Response - `WatchlistGetWatchlistByIDResponse extends BaseResponse` - `data: WatchlistDetail` Detailed watchlist with all items - `id: string` Watchlist ID - `created_at: string` Creation timestamp - `items: Array` Items in the watchlist - `id: string` Item ID - `added_at: string` When the item was added - `added_price?: string | null` Price when the item was added - `instrument?: Instrument | null` Instrument details - `id: string` Unique OEMS instrument identifier (UUID) - `country_of_issue: string` The ISO country code of the instrument's issue - `currency: string` The ISO currency code in which the instrument is traded - `easy_to_borrow: boolean` Indicates if the instrument is classified as Easy-To-Borrow - `is_liquidation_only: boolean` Indicates if the instrument is liquidation only and cannot be bought - `is_marginable: boolean` Indicates if the instrument is marginable - `is_restricted: boolean` Indicates if the instrument is restricted from trading - `is_short_prohibited: boolean` Indicates if short selling is prohibited for the instrument - `is_threshold_security: boolean` Indicates if the instrument is on the Regulation SHO Threshold Security List - `is_tradable: boolean` Indicates if the instrument is tradable - `symbol: string` The trading symbol for the instrument - `venue: string` The MIC code of the primary listing venue - `adv?: string | null` Average daily share volume from the security definition. - `expiry?: string | null` The expiration date for options instruments - `instrument_type?: SecurityType | null` The type of security (e.g., Common Stock, ETF) - `"COMMON_STOCK"` - `"PREFERRED_STOCK"` - `"OPTION"` - `"CASH"` - `"OTHER"` - `long_margin_rate?: string | null` The percent of a long position's value you must post as margin - `name?: string | null` The full name of the instrument or its issuer - `notional_adv?: string | null` Notional ADV (`adv × previous_close`). The primary liquidity signal used by `/instruments/search` ranking. Computed at response time so it stays consistent with whatever `adv` and `previous_close` show. - `options_expiry_dates?: Array | null` Available options expiration dates for this instrument. Present only when `include_options_expiry_dates=true` in the request. - `previous_close?: string | null` Last close price from the security definition. - `short_margin_rate?: string | null` The percent of a short position's value you must post as margin - `strike_price?: string | null` The strike price for options instruments - `name: string` Watchlist name ### Watchlist Create Watchlist Response - `WatchlistCreateWatchlistResponse extends BaseResponse` - `data: WatchlistEntry` Represents a user watchlist. - `id: string` The unique identifier for the watchlist. - `created_at: string` The timestamp when the watchlist was created. - `name: string` The user-provided watchlist name. ### Watchlist Delete Watchlist Response - `WatchlistDeleteWatchlistResponse = unknown` ### Watchlist Add Watchlist Item Response - `WatchlistAddWatchlistItemResponse extends BaseResponse` - `data: AddWatchlistItemData` Response data for adding a watchlist item - `item_id: string` ID of the created item ### Watchlist Delete Watchlist Item Response - `WatchlistDeleteWatchlistItemResponse = unknown` # Websocket ## Websocket Handler `client.v1.websocket.websocketHandler(RequestOptionsoptions?): void` **get** `/v1/ws` Upgrade the HTTP connection to a WebSocket and echo incoming messages. ### Example ```typescript import ClearStreet from '@clear-street-internal/sdk'; const client = new ClearStreet({ apiKey: 'My API Key', }); await client.v1.websocket.websocketHandler(); ```