Trading

Details on placing orders with the API

Getting Started with the Tradier Trading API

This guide covers all of the Trading endpoints available in the Tradier Brokerage API — from placing your first equity order to working with complex multi-leg options strategies and advanced conditional orders.


Prerequisites

You'll need:

  • A Tradier Brokerage account and an API access token from web.tradier.com/user/api
  • Your Account ID (e.g. 6YA00001), available from the User Profile endpoint

All requests require:

Authorization: Bearer <YOUR_TOKEN>
Accept: application/json
Content-Type: application/x-www-form-urlencoded

Base URLs:

  • Production: https://api.tradier.com/v1
  • Sandbox (paper trading): https://sandbox.tradier.com/v1

Tip: Always test your order logic against the sandbox environment before going live. The sandbox supports the full trading API with paper money and delayed market data. Previewing orders is also strongly recommended.


Common Parameters

These parameters apply across all order types:

ParameterRequiredDescription
classYesOrder class: equity, option, multileg, combo, oto, oco, otoco
symbolYesUnderlying ticker symbol (e.g. AAPL)
typeYesOrder type: market, limit, stop, stop_limit
durationYesHow long the order stays active: day, gtc, pre, post
quantityYesNumber of shares (whole numbers for equities) or contracts
priceConditionalRequired for limit and stop_limit orders
stopConditionalRequired for stop and stop_limit orders
tagNoOptional user-defined label for the order
previewNoSet to true to validate without submitting (see Preview section)

1. Preview an Order (Recommended First Step)

Before submitting any order, use the preview feature to validate it and see estimated costs, commissions, and margin impact. All standard validation rules — including buying power checks — run against the preview. It's the safest way to get started with the Trading API.

To preview, submit the full order payload to the Place Order endpoint with preview=true added. Note that previewing is recommended but not strictly required — in algorithmic trading contexts where speed matters, some users choose to skip the preview step.

curl -X POST "https://api.tradier.com/v1/accounts/6YA00001/orders" \
  -H "Authorization: Bearer <YOUR_TOKEN>" \
  -H "Accept: application/json" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "class=equity&symbol=AAPL&side=buy&quantity=10&type=market&duration=day&preview=true"

Example response:

{
  "order": {
    "status": "ok",
    "commission": 0,
    "cost": 2613.8,
    "fees": 0,
    "symbol": "AAPL",
    "quantity": 10,
    "side": "buy",
    "type": "market",
    "duration": "day",
    "result": true,
    "order_cost": 2613.8,
    "margin_change": 1306.9,
    "request_date": "2026-02-20T03:45:14.714",
    "extended_hours": false,
    "class": "equity",
    "strategy": "equity",
    "day_trades": 0
  }
}

2. Place an Equity Order

The simplest order type — buy or sell shares of a stock or ETF.

POST /v1/accounts/{account_id}/orders

Side options: buy, sell, sell_short, buy_to_cover

Market Order — Buy 100 shares of AAPL

curl -X POST "https://api.tradier.com/v1/accounts/6YA00001/orders" \
  -H "Authorization: Bearer <YOUR_TOKEN>" \
  -H "Accept: application/json" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "class=equity&symbol=AAPL&side=buy&quantity=100&type=market&duration=day"

Limit Order — Buy at a specific price

curl -X POST "https://api.tradier.com/v1/accounts/6YA00001/orders" \
  -H "Authorization: Bearer <YOUR_TOKEN>" \
  -H "Accept: application/json" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "class=equity&symbol=AAPL&side=buy&quantity=10&type=limit&duration=day&price=175.00"

Stop-Limit Order — Sell with a trigger and floor price

curl -X POST "https://api.tradier.com/v1/accounts/6YA00001/orders" \
  -H "Authorization: Bearer <YOUR_TOKEN>" \
  -H "Accept: application/json" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "class=equity&symbol=AAPL&side=sell&quantity=10&type=stop_limit&duration=gtc&stop=170.00&price=169.50"

Successful response:

{
  "order": {
    "id": 20258740,
    "status": "ok",
    "partner_id": "3a8bbee1-5184-4ffe-8a0c-294fbad1aee9"
  }
}

Once you have the id, use GET /v1/accounts/{account_id}/orders/{order_id} to check whether the order is pending, open, filled, or rejected. A 200 - OK response on order submission is just an indication that the API call submitting the order was correct and the order has been received, the order could still be rejected at the brokerage level so it is important to check the order status.


3. Pre/Post Market Session Orders

Extended hours trading is supported for orders during the following windows (all times EST):

SessionHours
Pre-market7:30 AM – 9:25 AM
Post-market4:00 PM – 8:00 PM

Set duration=pre or duration=post to route orders into the appropriate session.

curl -X POST "https://api.tradier.com/v1/accounts/6YA00001/orders" \
  -H "Authorization: Bearer <YOUR_TOKEN>" \
  -H "Accept: application/json" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "class=equity&symbol=AAPL&side=buy&quantity=10&type=limit&duration=pre&price=174.50"

4. Place an Option Order

Single-leg options orders require the full OCC option symbol (e.g. AAPL251017C00247500).

Side options: buy_to_open, sell_to_open, buy_to_close, sell_to_close

Buy a Call Option to Open

curl -X POST "https://api.tradier.com/v1/accounts/6YA00001/orders" \
  -H "Authorization: Bearer <YOUR_TOKEN>" \
  -H "Accept: application/json" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "class=option&symbol=AAPL&option_symbol=AAPL251017C00247500&side=buy_to_open&quantity=1&type=market&duration=day"

5. Place a Multileg Options Order

Use class=multileg for spreads and other pure options strategies (up to 4 legs). Legs are indexed starting at [0], each with its own option_symbol[n], side[n], and quantity[n].

Order type options: market, debit, credit, even

Iron Condor — 4-leg multileg order

curl -X POST "https://api.tradier.com/v1/accounts/6YA00001/orders" \
  -H "Authorization: Bearer <YOUR_TOKEN>" \
  -H "Accept: application/json" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "class=multileg&symbol=AAPL&type=market&duration=day\
&option_symbol[0]=AAPL251017C00255000&side[0]=sell_to_open&quantity[0]=1\
&option_symbol[1]=AAPL251017C00260000&side[1]=buy_to_open&quantity[1]=1\
&option_symbol[2]=AAPL251017P00245000&side[2]=sell_to_open&quantity[2]=1\
&option_symbol[3]=AAPL251017P00240000&side[3]=buy_to_open&quantity[3]=1"

For simpler 2-leg spreads, just include legs [0] and [1].


6. Place a Combo Order

A combo order combines one equity leg with one or two option legs — useful for strategies like covered calls or protective puts. The equity leg uses symbol as its identifier; set option_symbol to null for that leg. Option legs use their full OCC symbol as usual.

curl -X POST "https://api.tradier.com/v1/accounts/6YA00001/orders" \
  -H "Authorization: Bearer <YOUR_TOKEN>" \
  -H "Accept: application/json" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "class=combo&symbol=AAPL&type=debit&duration=day&price=170.00\
&side[0]=buy&quantity[0]=100&option_symbol[0]=null\
&option_symbol[1]=AAPL251017C00260000&side[1]=sell_to_open&quantity[1]=1"

7. Advanced Orders

Advanced order types let you chain or conditionalize multiple orders to automate your trade management.

OTO — One-Triggers-Other

The first order must fill before the second order is submitted. Use this to set up an entry order that automatically queues an exit.

Legs are indexed at [0] (trigger) and [1] (triggered).

curl -X POST "https://api.tradier.com/v1/accounts/6YA00001/orders" \
  -H "Authorization: Bearer <YOUR_TOKEN>" \
  -H "Accept: application/json" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "class=oto&duration=day\
&symbol[0]=AAPL&side[0]=buy&quantity[0]=100&type[0]=limit&price[0]=175.00\
&symbol[1]=AAPL&side[1]=sell&quantity[1]=100&type[1]=limit&price[1]=185.00"

Key rules:

  • The first leg's type must be limit, stop, or stop_limit — not market
  • The second leg supports market, limit, stop, or stop_limit

OCO — One-Cancels-Other

Two orders are submitted simultaneously. When one fills, the other is automatically cancelled. Ideal for setting a profit target and stop loss at the same time.

curl -X POST "https://api.tradier.com/v1/accounts/6YA00001/orders" \
  -H "Authorization: Bearer <YOUR_TOKEN>" \
  -H "Accept: application/json" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "class=oco&duration=gtc\
&symbol[0]=AAPL&side[0]=sell&quantity[0]=100&type[0]=limit&price[0]=190.00\
&symbol[1]=AAPL&side[1]=sell&quantity[1]=100&type[1]=stop&stop[1]=165.00"

Key rules:

  • Both legs must have different type values
  • If both are equities, the symbol must match on both legs
  • If both are options, the option_symbol must match on both legs

OTOCO — One-Triggers-One-Cancels-Other

The most powerful advanced order type. The first order (trigger) must fill before the second and third orders are activated. Once live, orders 2 and 3 behave as an OCO pair — when one fills, the other cancels.

This is the classic bracket order: entry → (profit target OR stop loss).

curl -X POST "https://api.tradier.com/v1/accounts/6YA00001/orders" \
  -H "Authorization: Bearer <YOUR_TOKEN>" \
  -H "Accept: application/json" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "class=otoco&duration=day\
&symbol[0]=AAPL&side[0]=buy&quantity[0]=100&type[0]=limit&price[0]=175.00\
&symbol[1]=AAPL&side[1]=sell&quantity[1]=100&type[1]=limit&price[1]=190.00\
&symbol[2]=AAPL&side[2]=sell&quantity[2]=100&type[2]=stop&stop[2]=165.00"

Key rules:

  • Orders 2 and 3 must have the same symbol (equities) or option_symbol (options)
  • Orders 2 and 3 must have different type values
  • If specifying duration per leg, orders 2 and 3 must share the same duration

8. Change an Existing Order

Modify the type, duration, price, or stop of an open order. Only orders in open or pending status can be changed.

PUT /v1/accounts/{account_id}/orders/{order_id}
curl -X PUT "https://api.tradier.com/v1/accounts/6YA00001/orders/123456" \
  -H "Authorization: Bearer <YOUR_TOKEN>" \
  -H "Accept: application/json" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "type=limit&duration=gtc&price=172.00"

Returns the updated order object with the new parameters applied.


9. Cancel an Order

Cancel an open or pending order. Orders that are already filled or expired cannot be cancelled.

DELETE /v1/accounts/{account_id}/orders/{order_id}
curl -X DELETE "https://api.tradier.com/v1/accounts/6YA00001/orders/123456" \
  -H "Authorization: Bearer <YOUR_TOKEN>" \
  -H "Accept: application/json"

A successful request to cancel returns a 200 OK response and should immeditately be followed with a check of the orders status to confirm the order's updated status set to canceled.


Order Status Reference

StatusMeaning
pendingOrder submitted, awaiting market open
openOrder is live and working
partially_filledSome quantity has been executed
filledOrder completely executed
expiredOrder expired (e.g. a day order after close)
canceledOrder was cancelled
rejectedOrder failed validation or was rejected
pending_cancelCancellation request submitted, awaiting confirmation

Error Handling

CodeMeaning
200Success
400Invalid request — check parameters
401Missing or invalid token, or toke/url mismatch
403Access denied
404Account or order not found

Tradier's error responses are descriptive — the 400 response body typically explains exactly what's wrong with the request.


Recommended Workflow

For most integrations, follow this pattern for any order:

  1. Preview the order with preview=true to validate parameters and see costs
  2. If result: true, submit the same payload with preview=false
  3. Poll GET /v1/accounts/{account_id}/orders/{order_id} to monitor status — confirm it reaches open, partially_filled, or filled rather than rejected or canceled
  4. Cancel or modify as needed while the order is still open

Next Steps

  • Market Data — Look up option chains, quotes, and expirations before placing trades at GET /v1/markets/...
  • Account Endpoints — Check buying power and positions before sizing orders
  • Streaming — Subscribe to real-time account events to get live order fill notifications

What’s Next