Currently POST and PUT request interactivity supply the entire JSON schema in the Try It Out section. In this guide, you'll find examples specific to Orders and Saved Orders for use in the Try It Out section. These would be sent as the POST data for Place Order. Order entry will only be available for the assetType `EQUITY` and `OPTIONS` as of this time.

Personal application will be throttled to 0-120 POST/PUT/DELETE Order requests per minute per account based on the properties of the application you specified during the application registration process. Applications registered before April 9, 2021 will have a different throttle associated with this. GET order requests will be unthrottled.  Please contact us at API@TDAmeritrade.com for more information.

Instruction for EQUITY and OPTION

Instruction

EQUITY (Stocks and ETFs)

OPTION

BUY

ACCEPTED

REJECT

SELL

ACCEPTED

REJECT

BUY_TO_OPEN

REJECT

ACCEPTED

BUY_TO_COVER

ACCEPTED

REJECT

BUY_TO_CLOSE

REJECT

ACCEPTED

SELL_TO_OPEN

REJECT

ACCEPTED

SELL_SHORT

ACCEPTED

REJECT

SELL_TO_CLOSE

REJECT

ACCEPTED

 

Buy Market: Stock

Buy 15 shares of XYZ at the Market good for the Day.

{
  "orderType": "MARKET",
  "session": "NORMAL",
  "duration": "DAY",
  "orderStrategyType": "SINGLE",
  "orderLegCollection": [
    {
      "instruction": "Buy",
      "quantity": 15,
      "instrument": {
        "symbol": "XYZ",
        "assetType": "EQUITY"
      }
    }
  ]
}
	

Buy Limit: Single Option

Buy to open 10 contracts of the XYZ March 20, 2015 $49 CALL at a Limit of $6.45 good for the Day.

{
  "complexOrderStrategyType": "NONE",
  "orderType": "LIMIT",
  "session": "NORMAL",
  "price": "6.45",
  "duration": "DAY",
  "orderStrategyType": "SINGLE",
  "orderLegCollection": [
    {
      "instruction": "BUY_TO_OPEN",
      "quantity": 10,
      "instrument": {
        "symbol": "XYZ_032015C49",
        "assetType": "OPTION"
    	}
    }
  ]
}

Buy Limit: Vertical Call Spread

Buy to open 10 contracts of the XYZ Jan 15, 2016 $40 Call and Sell to open 10 contracts of the XYZ Jan 15, 2016 $42.5 Call for a Net Debit of $1.20 good for the Day.

{
  "orderType": "NET_DEBIT",
  "session": "NORMAL",
  "price": "1.20",
  "duration": "DAY",
  "orderStrategyType": "SINGLE",
  "orderLegCollection": [
    {
      "instruction": "BUY_TO_OPEN",
      "quantity": 10,
      "instrument": {
        "symbol": "XYZ_011516C40",
        "assetType": "OPTION"
      }
    },
    {
      "instruction": "SELL_TO_OPEN",
      "quantity": 10,
      "instrument": {
        "symbol": "XYZ_011516C42.5",
        "assetType": "OPTION"
      }
    }
  ]
}

Custom Option Spread

Buy to open 2 contracts of the XYZ Jan 17, 2020 $43 Put and Sell to open 1 contracts of the XYZ Jan 18, 2019 $45 Put at the Market good for the Day.

{
 "orderStrategyType": "SINGLE",
  "orderType": "MARKET",
  "orderLegCollection": [
    {
      "instrument": {
        "assetType": "OPTION",
        "symbol": "XYZ_011819P45"
    },
      "instruction": "SELL_TO_OPEN",
      "quantity": 1
    },
    {
      "instrument": {
        "assetType": "OPTION",
        "symbol": "XYZ_011720P43"
      },
      "instruction": "BUY_TO_OPEN",
      "quantity": 2
    }
  ],
  "complexOrderStrategyType": "CUSTOM",
  "duration": "DAY",
  "session": "NORMAL"
}

Conditional Order: One Triggers Another

Buy 10 shares of XYZ at a Limit price of $34.97 good for the Day. Once filled, immediately submit an order to Sell 10 shares of XYZ with a Limit price of $42.03 good for the Day.  Also known as 1st Trigger Sequence.

{
  "orderType": "LIMIT",
  "session": "NORMAL",
  "price": "34.97",
  "duration": "DAY",
  "orderStrategyType": "TRIGGER",
  "orderLegCollection": [
    {
      "instruction": "BUY",
      "quantity": 10,
      "instrument": {
        "symbol": "XYZ",
        "assetType": "EQUITY"
      }
    }
  ],
  "childOrderStrategies": [
    {
      "orderType": "LIMIT",
      "session": "NORMAL",
      "price": "42.03",
      "duration": "DAY",
      "orderStrategyType": "SINGLE",
      "orderLegCollection": [
        {
          "instruction": "SELL",
          "quantity": 10,
          "instrument": {
            "symbol": "XYZ",
            "assetType": "EQUITY"
          }
        }
      ]
    }
  ]
}

Conditional Order: One Cancels Another

Sell 2 shares of XYZ at a Limit price of $45.97 and Sell 2 shares of XYZ with a Stop Limit order where the stop price is $37.03 and limit is $37.00.  Both orders are sent at the same time.  When one order fills, the other order is immediately cancelled.  Both orders are good for the Day. Also known as an OCO order.

{
  "orderStrategyType": "OCO",
  "childOrderStrategies": [
    {
      "orderType": "LIMIT",
      "session": "NORMAL",
      "price": "45.97",
      "duration": "DAY",
      "orderStrategyType": "SINGLE",
      "orderLegCollection": [
        {
          "instruction": "SELL",
          "quantity": 2,
          "instrument": {
            "symbol": "XYZ",
            "assetType": "EQUITY"
          }
        }
      ]
    },
    {
      "orderType": "STOP_LIMIT",
      "session": "NORMAL",
      "price": "37.00",
      "stopPrice": "37.03",
      "duration": "DAY",
      "orderStrategyType": "SINGLE",
      "orderLegCollection": [
        {
          "instruction": "SELL",
          "quantity": 2,
          "instrument": {
            "symbol": "XYZ",
            "assetType": "EQUITY"
          }
        }
      ]
    }
  ]
}

Conditional Order: One Triggers A One Cancels Another

Buy 5 shares of XYZ at a Limit price of $14.97 good for the Day.  Once filled, 2 sell orders are immediately sent: Sell 5 shares of XYZ at a Limit price of $15.27 and Sell 5 shares of XYZ with a Stop order where the stop price is $11.27.  When one of the sell order fills, the other order is immediately cancelled.  Both Sell orders are Good till Cancel.  Also known as a 1st Trigger OCO order.

{
  "orderStrategyType": "TRIGGER",
  "session": "NORMAL",
  "duration": "DAY",
  "orderType": "LIMIT",
  "price": 14.97,
  "orderLegCollection": [
    {
      "instruction": "BUY",
      "quantity": 5,
      "instrument": {
        "assetType": "EQUITY",
        "symbol": "XYZ"
      }
    }
  ],
  "childOrderStrategies": [
    {
      "orderStrategyType": "OCO",
      "childOrderStrategies": [
        {
          "orderStrategyType": "SINGLE",
          "session": "NORMAL",
          "duration": "GOOD_TILL_CANCEL",
          "orderType": "LIMIT",
          "price": 15.27,
          "orderLegCollection": [
            {
              "instruction": "SELL",
              "quantity": 5,
              "instrument": {
                "assetType": "EQUITY",
                "symbol": "XYZ"
              }
            }
          ]
        },
        {
          "orderStrategyType": "SINGLE",
          "session": "NORMAL",
          "duration": "GOOD_TILL_CANCEL",
          "orderType": "STOP",
          "stopPrice": 11.27,
          "orderLegCollection": [
            {
              "instruction": "SELL",
              "quantity": 5,
              "instrument": {
                "assetType": "EQUITY",
                "symbol": "XYZ" 
               }
            }
          ]
        }
      ]
    }
  ]
}

Sell Trailing Stop: Stock

Sell 10 shares of XYZ with a Trailing Stop where the trail is a -$10 offset from the time the order is submitted.  As the stock price goes up, the -$10 trailing offset will follow.  If stock XYZ goes from $110 to $130, your trail will automatically be adjusted to $120.  When XYZ falls to $120 or below, a Market order is submitted.  This order is good for the Day.

{
  "complexOrderStrategyType": "NONE",
  "orderType": "TRAILING_STOP",
  "session": "NORMAL",
  "stopPriceLinkBasis": "BID",
  "stopPriceLinkType": "VALUE",
  "stopPriceOffset": 10,
  "duration": "DAY",
  "orderStrategyType": "SINGLE",
  "orderLegCollection": [
    {
      "instruction": "SELL",
      "quantity": 10,
      "instrument": {
        "symbol": "XYZ",
        "assetType": "EQUITY"
      }
    }
  ]
}