tastytradeDeveloper Docs
Legacy ↗

Margin & Risk

Before an order can rest on the exchange, tastytrade evaluates whether your account can support it. This page explains the three things you read most often when reasoning about that: an account's current margin requirements, the margin dry-run that estimates an order's impact before you commit, and the trading status that gates which features and order types you may use.

All requests go to the sandbox base URL https://api.cert.tastyworks.com or production https://api.tastyworks.com, carry a User-Agent: product/version header, and authenticate with a short-lived (15-minute) OAuth access token from POST /oauth/token. JSON keys are dasherized (for example margin-requirement, day-trade-count). Monetary fields pair a value with an *-effect field of Debit, Credit, or None that tells you the direction.

Current margin requirements

GET /margin/accounts/{account_number}/requirements returns your account's margin picture, grouped by underlying symbol. The top level summarizes the whole account — margin-requirement, maintenance-requirement, margin-equity, maintenance-excess, and buying-power figures (including separate reg-t-* values), each with its effect — and margin-calculation-type (for example Reg T).

Each entry in groups is one underlying, with its own requirement totals, buying-power, and the risk shocks, plus a nested inner groups array of margin-strategy groups (for example LONG_UNDERLYING) — each of those carries includes-working-order and the position legs under position-entries. The per-underlying price-increase-percent and price-decrease-percent are the risk parameters: the price shocks (here 0.5 and -0.5) used to stress that position when computing its requirement. includes-working-order flags whether unfilled orders are already factored into a strategy group's requirement.

curl "https://api.tastyworks.com/margin/accounts/5WT00001/requirements" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "User-Agent: my-app/1.0.0"

The margin dry-run

The dry-run answers "what would this order do to my margin?" without placing it. Always estimate impact this way before sending a real order — it is the margin-focused complement to the order dry-run.

POST /margin/accounts/{account_number}/dry-run takes the same body you would send to submit an order, plus three extra attributes: account-number, underlying-symbol, and underlying-instrument-type (one of Equity, Equity Option, Future, Future Option, Cryptocurrency). Symbols follow tastytrade symbology — OCC for equity options, / for futures, ./ for future options, and pair notation for crypto.

{
    "account-number": "5WT00001",
    "time-in-force": "Day",
    "order-type": "Limit",
    "price": "186.99",
    "price-effect": "Debit",
    "underlying-symbol": "AAPL",
    "underlying-instrument-type": "Equity",
    "legs": [
        { "instrument-type": "Equity", "symbol": "AAPL", "quantity": 1, "action": "Buy to Open" }
    ]
}

The response compares your account before and after. Read change-in-margin-requirement, change-in-buying-power, and the current-buying-power versus new-buying-power pair (each with its effect) for the headline impact. isolated-order-margin-requirement and is-spread describe the order on its own, while last-results, base-results, and new-order-results give the full per-underlying breakdown, including buying-power-impact, working-margin, position-margin, and the underlying price marks used in the calculation.

A dry-run never creates an order, so it is safe to repeat. When you do place the real order, send it dry-run-first and set a unique external-identifier in the request body (there is no idempotency-key header, and the API does not deduplicate retried submissions). If the outcome of a submit is uncertain — a timeout or 5xx — check GET /accounts/{account_number}/orders for that identifier before resubmitting — see /docs/guides/idempotency-and-retries.

Trading status

GET /accounts/{account_number}/trading-status reports whether and how an account may trade. If is-closed or is-frozen is true, trading is blocked; if is-closing-only is true, only closing trades are allowed account-wide, while is-cryptocurrency-closing-only and is-futures-closing-only apply the same restriction to crypto and futures respectively. is-risk-reducing-only similarly restricts you to de-risking activity.

Key fields:

FieldMeaning
options-levelHighest options strategy tier permitted (for example No Restrictions).
is-pattern-day-traderWhether PDT rules apply to the account.
day-trade-countLive count of day trades used, updated throughout the day.
is-in-margin-call / is-in-day-trade-equity-maintenance-callOutstanding margin or day-trade maintenance calls.
is-cryptocurrency-enabled, is-futures-enabled, short-calls-enabledPer-feature toggles for what the account may trade.
equities-margin-calculation-typeHow equities margin is computed (for example Reg T).
futures-margin-rate-multiplierIntraday futures margin multiplier — 0 means no intraday futures margin; when set, eligible intraday futures positions are margined at the standard requirement divided by this value.

Check trading status before building order flows so you surface restrictions up front rather than discovering them as a rejected order.

Errors

Expect standard HTTP codes: 400/422 for malformed or invalid input, 401 for an expired or missing token, 403 when a restriction blocks the action, 404 for an unknown account, 429 when rate-limited, and 5xx for server-side issues. See /reference/errors and /docs/guides/rate-limits-and-backoff.

Related