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

Ally Invest API

Response Structure

Overview

Responses will follow a general structure for all calls. This structure includes a response wrapper with data aggregates inside of the wrapper. Whether the format is XML, or something else, the general structure will remain the same.

Formats

The default response format for all requests will be XML. You can optionally pass in the format parameter in the URI alternate values to receive different response formats. We currently support the following formats:

  • XML (.xml)
  • JSON (.json)
  • JSONP (.jsonp, including a callback parameter i.e accounts/balances.jsonp?callback=myFunction)

We hope to add new response formats over time. If you have a suggestion about a new format we should support, let us know.

Response ID

There is a unique identifier as an attribute of the response block that is recorded by our servers and sent to you for your records. In case you need support on a request or response, you can send this unique identifier to us and we’ll be able to trace your messages.

XML Response Example

<?xml version="1.0" encoding="UTF-8"?>
<response id="77cf30da:12df25c7074:-7ea6">
  <accountbalance>
    <account>12345678</account>
    <accountvalue>67119.41</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.39</longstocks>
      <options>0.0</options>
      <shortoptions>0.0</shortoptions>
      <shortstocks>0.0</shortstocks>
      <stocks>57.39</stocks>
      <total>984.72</total>
    </securities>
  </accountbalance>
</response>

JSON Response Example

{
    "response": {
        "id": "77cf30da:12df25c7074:-7ea0",
        "accountbalance": {
            "account": 12345678,
            "accountvalue": 67119.41,
            "buyingpower": {
                "cashavailableforwithdrawal": 66177.48000000001,
                "daytrading": 264709.84,
                "equitypercentage": 100,
                "options": 66177.48000000001,
                "soddaytrading": 264709.84,
                "sodoptions": 66177.48000000001,
                "sodstock": 132354.96000000002,
                "stock": 132354.96000000002
            },
            "fedcall": 0.0,
            "housecall": 0.0,
            "money": {
                "accruedinterest": 0.0,
                "cash": 66134.67,
                "cashavailable": 0.0,
                "marginbalance": 0.0,
                "mmf": 0.02,
                "total": 66134.69,
                "uncleareddeposits": 0.0,
                "unsettledfunds": 0.0,
                "yield": 0.0
            },
            "securities": {
                "longoptions": 0.0,
                "longstocks": 57.39,
                "options": 0.0,
                "shortoptions": 0.0,
                "shortstocks": 0.0,
                "stocks": 57.39,
                "total": 984.72
            }
        }
    }
}
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.