Orders & Order Types
An order in the tastytrade API is a JSON document with two parts: order attributes that apply to the trade as a whole, and a legs array where each leg names a single instrument, a side, and a quantity. All JSON keys are dasherized (for example order-type, price-effect, time-in-force, instrument-type), and prices/values are sent as strings or decimals.
Orders are submitted to POST /accounts/{account_number}/orders. Because orders move real money, always dry-run first against POST /accounts/{account_number}/orders/dry-run (the same JSON body), inspect the returned buying-power-effect/fee-calculation and any warnings, then submit. There is no idempotency-key header and the API does not deduplicate retried submissions, so set your own unique external-identifier on each order (it is echoed back on the order response); if a submission's outcome is uncertain (timeout or 5xx), check GET /accounts/{account_number}/orders (or /orders/live) for that identifier before resubmitting. See Idempotency & retries and the full schema at /reference/orders.
Order attributes
| Attribute | Required | Meaning |
|---|---|---|
order-type | Yes | The kind of order (see below) |
time-in-force | Yes | How long the order lives if unfilled |
price | Yes for Limit / Stop Limit | The limit price |
price-effect | With price | Debit (you pay) or Credit (you receive) |
stop-trigger | Yes for Stop / Stop Limit | The trigger price |
gtc-date | Yes for GTD | Expiry date (yyyy-mm-dd) |
value / value-effect | Yes for Notional Market | Dollar amount to buy/sell |
legs | Yes | Array of leg objects |
source | No | Free-form origin tag |
price-effect must agree with the leg action: buying is a Debit, selling is a Credit. Buying for a credit (or selling for a debit) is rejected.
Legs
Each leg names one instrument. All orders need at least one leg. Equity, future, and cryptocurrency orders are limited to 1 leg; equity-option and future-option orders allow up to 4 legs. Two legs may not share the same symbol.
| Leg attribute | Required | Meaning |
|---|---|---|
action | Yes | Buy to Open, Sell to Open, Buy to Close, Sell to Close (or Buy/Sell for single-leg outright futures) |
instrument-type | Yes | Equity, Equity Option, Future, Future Option, or Cryptocurrency |
quantity | Yes (omit for Notional Market) | Whole number, or decimal for crypto |
symbol | Yes | The instrument symbol |
The action and instrument-type values above are the commonly used ones — the full enums (which also include Allocate, Equity Offering, Fixed Income Security, and Liquidity Pool) are in /reference/orders.
Symbols follow tastytrade symbology: plain tickers for equities (AAPL), OCC-style strings for equity options (AAPL 230818C00197500), leading-slash futures (/CLZ2), future options, and crypto pairs (BTC/USD). Look symbols up via the instruments endpoints — see /reference.
Order types
| Type | Rule |
|---|---|
Limit | Must include price and price-effect |
Market | No price/price-effect; single leg; time-in-force not GTC |
Stop | Market order with a stop-trigger; becomes a market order when the quote hits the trigger |
Stop Limit | Limit order (price + price-effect) plus a stop-trigger |
A Notional Market type also exists for buying a dollar value of crypto or eligible equities (omit quantity). These are the commonly used order types — the full order-type enum (which also includes Marketable Limit and Liquidity Allocation) is in /reference/orders.
{
"time-in-force": "Day",
"order-type": "Limit",
"price": "1.09",
"price-effect": "Debit",
"legs": [
{ "instrument-type": "Equity Option", "symbol": "AAPL 230818C00197500", "quantity": 1, "action": "Buy to Open" },
{ "instrument-type": "Equity Option", "symbol": "AAPL 230818C00200000", "quantity": 1, "action": "Sell to Open" }
]
}
Time-in-force
| TIF | Meaning |
|---|---|
Day | Works until filled or the market closes |
GTC | Good 'til canceled — works until filled or canceled |
GTD | Good 'til date — also requires gtc-date (yyyy-mm-dd) |
Some venues also support immediate-or-cancel and extended-hours behaviors; refer to /reference/orders for the values your instrument accepts.
Complex orders
Complex (bracket) orders are submitted to POST /accounts/{account_number}/complex-orders and have a type plus an orders array (and, for triggered types, a trigger-order; PAIRS adds ratio-price fields — see below). Supported types are OTOCO, OCO, OTO, and PAIRS. BLAST is deprecated and is not supported in any environment.
- OTO — the
trigger-ordergoes live immediately; when it fills, itsorders(up to 3) are routed. They do not cancel one another. - OCO — no
trigger-order; theordersgo live immediately, and when one fills the other is canceled. - OTOCO — a
trigger-orderplus an OCO pair that sit inContingentstatus until the trigger fills, then route as an OCO. - PAIRS —
ordersworked together as a pairs strategy, triggered by a ratio price: setratio-price-comparator(gteorlte) andratio-price-threshold(a decimal serialized as a JSON string, e.g."150.25"); optionally setratio-price-is-threshold-based-on-notionalto compare on notional value instead of price. A working PAIRS order's threshold and comparator can later be edited viaPATCH /accounts/{account_number}/complex-orders/{id}(only PAIRS orders can be edited there).
{
"type": "OTOCO",
"trigger-order": {
"order-type": "Limit", "price": 157.97, "price-effect": "Debit", "time-in-force": "Day",
"legs": [{ "instrument-type": "Equity", "symbol": "AAPL", "action": "Buy to Open", "quantity": 100 }]
},
"orders": [
{ "order-type": "Limit", "price": 198.68, "price-effect": "Credit", "time-in-force": "GTC",
"legs": [{ "symbol": "AAPL", "instrument-type": "Equity", "action": "Sell to Close", "quantity": 100 }] },
{ "order-type": "Stop", "time-in-force": "GTC", "stop-trigger": 143.06,
"legs": [{ "symbol": "AAPL", "instrument-type": "Equity", "action": "Sell to Close", "quantity": 100 }] }
]
}
The response returns a complex-order.id (used to fetch or cancel the whole bracket) plus individual ids for the trigger and nested orders. Cancel a complex order through its own endpoint using the complex-order id, not a nested order id.
Related
- /reference/orders — full order request/response schema
- /reference/errors —
400/401/403/404/422/429/5xxhandling (a failed preflight check returns422) - Idempotency & retries and Rate limits & backoff
- Get started and the MCP server