Get Market Value of all Security Groups

Retrieve a trading account's collective market value of all security groups

Introduction‌

This GET endpoint enables you to retrieve the collective market value of different security groups in a specific trading account.‌

There are five required parameters that must be provided in the request:‌

  1. Authorization (header). This is the authorization token from the very first token request. The value of this header must have the following format: Bearer BQ898r9fefi (Bearer + 1 space + the token).

  2. API version (path). Unless necessary, leave it at "1.0".

  3. accountID (path). This is the internal ID of the trading account whose market value of different security groups must be listed.‌

Here's the final template for this API request:

GET apiURL/v1.0/accounts/{accountID}/positions/groups

Response

In response to this API request, you'll receive a JSON file with the collective market value of different security groups in the specified trading account.

[
  {
    "Name": "Options",
    "MarketValue": -996.5
  },
  {
    "Name": "Equity",
    "MarketValue": 129835.86
  },
  {
    "Name": "Cash",
    "MarketValue": 342377.84999484
  }
]

where:

Parameter
Description

Name

The security group.

Possible values:

  • FixedIncome

  • Equity

  • Forex

  • Futures

  • Other

  • Options

  • Index

  • Cryptocurrency

  • Cash

MarketValue

The collective market value of all securities of this group in this trading account.

Relationship Between Security Types and Groups

The following table lists security types that populate each security group:

Security Group
Corresponding Security Types

FixedIncome

  • BankersAcceptance

  • CertificateOfDeposit

  • MortgageObligation

  • CorporateBond

  • CommercialPaper

  • CorporatePrivatePlacement

  • FederalHousingAuthority

  • FederalHomeLoan

  • FederalNationalMortgageAssociation

  • GovernmentNationalMortgageAssociation

  • TreasuriesPlusAgencyDebenture

  • MortgageInterestOnly

  • MortgagePrincipleOnly

  • MortgagePrivatePlacement

  • MunicipalBond

  • StudentLoanMarketingAssociation

  • TimeDeposit

  • UsTreasuryBill

  • CatsTigersLions

  • ConvertibleBond

  • MortgageIoette

Equity

  • CommonStock

  • MutualFund

  • PreferredStock

  • Warrant

  • Right

  • ETF

  • DepositoryReceipt

  • CoveredWarrant

  • Unit

Forex

  • ForeignExchangeContract

Futures

  • Future

Options

  • Option

Index

  • Index

Cryptocurrency

  • Cryptocurrency

Other

  • MiscellaneousPassThru

  • NoIsitcSecurityType

  • RepurchaseAgreement

  • ReverseRepurchaseAgreement

  • WildcardEntry

  • FakeStockForNonStandartOption

Common Mistakes

Here are some of the common mistakes that developers make when attempting to fetch the collective market value of different security groups in a specific trading account.‌

Specifying the User ID Instead of the Trading Account ID

Another common mistake when making this request is specifying the user ID instead of the user's trading account ID. Doing so will result in the 500 status code and the following error message:

{    "message": "An error occurred while processing your request",    "error": "Unexpected server error"}

Last updated