• Invest: 1-855-880-2559
  • Mon - Sun
  • 7am - 10 pm ET

Ally Invest API Documentation

Build your application to connect to our investment platform and the 250,000 traders connected to it.

FIXML

The API itself doesn't have any business objects defined by the system back-end that contain the data necessary to make trades. Instead, FIX protocol messages are required, using a standard known as FIXML.

The Ally Invest API supports order functionality for stock and option orders. Required order information is required to be submitted in FIXML format within the body of any order requests through the API. You can find sample orders in FIXML format to illustrate potential order messaging on the trading page. The current implementation relies on FIXML schema specification v 5.0 service pack 2, available for download at http://www.fixprotocol.org.

Order support is included for basic stock and options orders as well as multi-leg support for complex option strategies such as spreads, straddles, covered calls, and iron condors. Support includes the following:

  • Equity market, limit, stop, stop limit, and market on close orders
  • Single leg option orders can support market, limit, stop, and stop limit orders assuming the exchange accepting the order supports that order type
  • Multi-leg support for advanced options strategies supporting market or limit price types
  • Term qualifiers of "Day" for day orders or "GTC" for good until canceled orders for eligible orders

Keep in mind that trailing stop orders are no longer supported. The following fields will cause an error if they are passed in the FIXML: Typ = "P" for trailing stop, ExecInst, OfstTyp, PegPxTyp, or OfstVal

FIXML tag attributes are repeated in several of the examples shown on the trading page. The following table is a sample list of the attributes required along with a description.

FIXML Attribute Description and Notes
Acct Account number needs to be passed with all order requests.
AcctTyp Only used for closing short positions, "Buy to Cover" orders should include this attribute as AcctTyp="5".
CFI Abbreviation for "classification of financial instrument", used for options to distinguish "OC" for call option or "OP" for put option.
Mat Represents the expiration date of an option. Needs to be in the format of "YYYY‐MM‐ DDT00:00:00.000‐05:00". For single leg orders, this attribute tag changes from Mat to MatDt.
MatDt Represents the expiration date of an option. Needs to be in the format of "YYYY‐MM‐ DDT00:00:00.000‐05:00". For multiple leg orders, this attribute tag changes from MatDt to Mat.
MMY Expiration of the option in the format of YYYYMM.
OrigID Order ID that needs to be passed for any change or cancel requests. Note: for Multi‐leg orders, use tag OrigClOrdID instead of OrigID.
PosEfct Used for options, option legs require and attribute of "O" for opening or "C" for closing.
Px Price for price type if needed. This attribute would be required for limits (Typ = "2") or stop limits (Typ="4").
SecTyp Security type attribute is needed. "CS" for common stock or "OPT" for option.
Side Side of market as "1" ‐ Buy, "2" ‐ Sell, "5" ‐ Sell Short. Buy to cover orders are attributed as buy orders with Side="1".
Strk Strike price of option contract. This tag changes from Strk to StrkPx for single leg orders.
StrkPx Strike price of option contract. This tag changes from StrkPx to Strk for multi‐leg orders.
Sym Ticker symbol of underlying security. This is utilized for stock, option, and multi‐leg orders.
TmInForce Time in force, possible values include "0" ‐ Day Order, "1" ‐ GTC Order, "7" ‐ Market on Close. Not applicable when Typ="1" (market order).
Typ Price Type as "1" ‐ Market, "2" ‐ Limit", "3" ‐ Stop, or "4" - Stop Limit.
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 before you begin trading options. Options investors may lose the entire amount of their investment in a relatively short period of time.