• Invest: 1-855-880-2559
  • Open 24/7

Ally Invest API

GET accounts{.format}

Description

This call will return detailed balance and holding information for each account associated with a user.

Authentication Required
Yes OAuth 1.0a
URI Parameters
format a response format, default is xml (See Response Structure)
Example URL
https://api.tradeking.com/v1/accounts.xml

Special Considerations

Balance data fields returned may be specific to account type (i.e., cash vs. margin accounts).

Data Fields

Data Tag Description
accounttype Holdings attribute for where asset as held, "1"= cash, "2"= margin long, "5"=margin short.
accountvalue Account value
accruedinterest Amount of any accrued interest on the account
assetclass Holding asset class type
cash cash
cashavailable cash available
cashavailableforwithdrawal Cash available for withdrawal (cash & margin accounts only, n/a for retirement accounts)
cashbalance cash balance
cashmv Value of cash market value
cfi Put or call code(FIXML)
change Holding asset change for the day
costbasis Holding cost basis
cusip Instrument cusip
desc Instrument description
equitypercentage Percentage of equity (margin accounts only)
factor Instrument factor
fedcall Value of any fed call on account
gainloss Holding gain/loss overall
housecall Value of any house call
lastprice Instrument last price
longoptions Long option market value
longstocks Long stock market value
marginbalance Margin balance (- indicates debit balance, + indicates credit balance)
marginmv Margin market value
marketvalue Holding market value
marketvaluechange Holding market value change
matdt Instrument maturity date (FIXML)
mmf Money market fund
mmy Instrument maturity year/month (FIXML)
mult Instrument multiplier
openbuyvalue Open buy value
options Total option market value. Path: /response/accounts/accountsummary/accountbalance/securities/
options Options buying power. Path: /response/accounts/accountsummary/accountbalance/buyingpower/
price Instrument price
purchaseprice Holding purchase price
putcall put or call
qty Holding quantity
sectyp Instrument security type (FIXML)
shortbalance short balance (credit for sell?)
shortmv short market value
shortoptions Short option market value
shortstocks Short stock market value
sodoptions Start of day options buying power
sodstock Start of day stock buying power
stock Stock buying power
stocks Total stock market value
strkpx Instrument strike price (FIXML)
sym Instrument underlying symbol (FIXML)
symbol Holding underlying symbol
total Total cash balance. Path: /response/accounts/accountsummary/accountbalance/money/
total Total market value (stock & option). Path: /response/accounts/accountsummary/accountbalance/securities/
totalsecurities Total account market value
uncleareddeposits uncleared deposits
unsettledfunds unsettle funds
yield Yield
account Account number

Request Example

GET /v1/accounts.xml HTTP/1.1
Authorization: OAuth
  oauth_consumer_key="672e71387c0a126f4e13296ecfb2b7bc",
  oauth_nonce="cfdb7f42de425d94fbc24c11a920c33e",
  oauth_signature="Vfm148kAgBZ6azEHqds43aY2UsEg3D",
  oauth_signature_method="HMAC-SHA1",
  oauth_timestamp="1306871932",
  oauth_token="819682555b63ab8bd90a4138138e7365",
  oauth_version="1.0"
Connection: close
Host: api.tradeking.com

Response Example

<?xml version="1.0" encoding="UTF-8"?>
<response id="77cf30da:12df25c7074:-7dc9">
  <accounts>
    <accountsummary>
    <account>12345678</account>
    <accountbalance>
      <account>12345678</account>
      <accountvalue>67119.40000000001</accountvalue>
      <buyingpower>
        <cashavailableforwithdrawal>66177.48000000001</cashavailableforwithdrawal>
        <daytrading>264709.84</daytrading>
        <equitypercentage>100</equitypercentage>
        <options>66177.48000000001</options>
        <soddaytrading>264709.84</soddaytrading>
        <sodoptions>66177.48000000001</sodoptions>
        <sodstock>132354.96000000002</sodstock>
        <stock>132354.96000000002</stock>
      </buyingpower>
      <fedcall>0.0</fedcall>
      <housecall>0.0</housecall>
      <money>
        <accruedinterest>0.0</accruedinterest>
        <cash>66134.67</cash>
        <cashavailable>0.0</cashavailable>
        <marginbalance>0.0</marginbalance>
        <mmf>0.02</mmf>
        <total>66134.69</total>
        <uncleareddeposits>0.0</uncleareddeposits>
        <unsettledfunds>0.0</unsettledfunds>
        <yield>0.0</yield>
      </money>
      <securities>
        <longoptions>0.0</longoptions>
        <longstocks>57.38</longstocks>
        <options>0.0</options>
        <shortoptions>0.0</shortoptions>
        <shortstocks>0.0</shortstocks>
        <stocks>57.38</stocks>
        <total>984.71</total>
      </securities>
    </accountbalance>
      <accountholdings>
        <displaydata>
          <totalsecurities>$984.71</totalsecurities>
        </displaydata>
        <holding>
          <accounttype>2</accounttype>
          <costbasis>40.9</costbasis>
          <displaydata>
            <accounttype>Margin</accounttype>
            <assetclass>Stock</assetclass>
            <change>$.00</change>
            <costbasis>$40.90</costbasis>
            <desc>POWERSHARES QQQ NASDAQ 100</desc>
            <lastprice>$57.38</lastprice>
            <marketvalue>$57.38</marketvalue>
            <marketvaluechange>$.32</marketvaluechange>
            <qty>1</qty>
            <symbol>QQQQ</symbol>
          </displaydata>
          <gainloss>16.480000000000004</gainloss>
          <instrument>
            <cusip>73935A104</cusip>
            <desc>POWERSHARES QQQ NASDAQ 100</desc>
            <factor>0.0</factor>
            <sectyp>CS</sectyp>
            <sym>QQQQ</sym>
          </instrument>
          <marketvalue>57.38</marketvalue>
          <marketvaluechange>0.3225000000000051</marketvaluechange>
          <price>57.38</price>
          <purchaseprice>0.0</purchaseprice>
          <qty>1.0</qty>
          <quote>
            <change>0.0</change>
            <lastprice>57.38</lastprice>
          </quote>
          <underlying/>
        </holding>
        <holding>
          <accounttype>1</accounttype>
          <costbasis>950.09</costbasis>
          <displaydata>
            <accounttype>Cash</accounttype>
            <assetclass>Fixed Income</assetclass>
            <change>$.00</change>
            <costbasis>$950.09</costbasis>
            <desc>MICROSOFT CORP FIXED RT NT</desc>
            <lastprice>$.00</lastprice>
            <marketvalue>$.00</marketvalue>
            <marketvaluechange>$.00</marketvaluechange>
            <qty>1</qty>
            <symbol>M20AH7</symbol>
          </displaydata>
          <gainloss>-22.75999999999999</gainloss>
          <instrument>
            <cusip>594918AH7</cusip>
            <desc>MICROSOFT CORP FIXED RT NT</desc>
            <factor>0.0</factor>
            <sectyp>BOND</sectyp>
            <sym>M20AH7</sym>
          </instrument>
          <marketvalue>0.0</marketvalue>
          <marketvaluechange>0.0</marketvaluechange>
          <price>0.0</price>
          <purchaseprice>0.9501</purchaseprice>
          <qty>1.0</qty>
          <quote>
            <change>0.0</change>
            <lastprice>0.0</lastprice>
          </quote>
          <underlying/>
        </holding>
        <totalsecurities>984.7100000000064</totalsecurities>
      </accountholdings>
    </accountsummary>
  </accounts>
</response>
Disclaimer:

Any mention of actual symbols are to be used for coding purposes only and do not imply a recommendation or solicitation to buy or sell a particular security or to engage in any particular investment strategy.

At the time of publication and in the preceding month, Ally Invest did not have ownership greater than 1% in any stocks mentioned here and does not have any other actual, material conflict of interest known at the time of publication.

Ally Invest did not receive compensation from a public offering or from investment banking services related to any companies mentioned here within the past 12 months, or expects to receive any in the next 3 months. Ally Invest did not engage in market making in the securities mentioned here.

Ally Invest Securities' background can be found at FINRA's BrokerCheck. Options involve risk and are not suitable for all investors.

Review the Characteristics and Risks of Standardized Options brochure (PDF) before you begin trading options. Options investors may lose the entire amount of their investment in a relatively short period of time.