# TradeZero Developer Portal > Official documentation for the TradeZero REST and WebSocket APIs — programmatic equities, multi-leg options, short locates, account data, and real-time P&L and portfolio streams. Production endpoints are those linked from the Documentation tab; additional OpenAPI paths may exist for preview only. Base URL: https://developer.tradezero.com API host: https://webapi.tradezero.com Authentication: TZ-API-KEY-ID and TZ-API-SECRET-KEY headers (see Authentication guide). ## Documentation - [TradeZero Developer Documentation](https://developer.tradezero.com/docs/documentation): Welcome to the TradeZero developer documentation - REST and WebSocket APIs for programmatic access to equities, multi-leg options, and short locates, with live streaming of P&L and order updates. - [About TradeZero](https://developer.tradezero.com/docs/documentation/about-tradezero): TradeZero is a brokerage built for active traders, with REST and WebSocket APIs for programmatic access to equities, options, short locates, and account streaming. - [Account Types](https://developer.tradezero.com/docs/documentation/account-types): TradeZero exposes live and paper accounts over the same API base URL. This page covers how to tell them apart, what each one supports, and how to safely switch between them. - [Authentication](https://developer.tradezero.com/docs/documentation/api-keys): Generate a TradeZero API key + secret in the Portal and attach them to every REST request over HTTPS. Covers the live and paper onboarding flows, key lifecycle rules, and API key headers. - [OAuth vs API Keys](https://developer.tradezero.com/docs/documentation/oauth-vs-api-keys): Choose the right TradeZero authentication model — direct API key headers for personal integrations vs OAuth2 JWT exchange for compliant third-party apps. - [Rate Limits](https://developer.tradezero.com/docs/documentation/rate-limits): Request-rate limits on the TradeZero Trading API (webapi.tradezero.com). Per-endpoint sustained and burst limits, HTTP 429 behavior, locate quote cooldown rules, and integration patterns. - [About Trading API](https://developer.tradezero.com/docs/documentation/about-trading-api): Overview of the TradeZero Trading API - the REST surface for accounts, positions, orders, and short locates, with a grouped catalog of every endpoint. - [Account Information](https://developer.tradezero.com/docs/documentation/accounts): Access TradeZero account data programmatically - list trading accounts, retrieve balances and buying power, and monitor margin and status to power dashboards and account-management tools. - [Short Locates](https://developer.tradezero.com/docs/documentation/locates): Request, accept, and credit back stock locates for short selling on the TradeZero API. Covers the three locate types (Locate, Pre-Borrow, Single Use), the async quote-and-poll lifecycle, inventory management, and the Reg SHO threshold-security rules. - [Equity Trading](https://developer.tradezero.com/docs/documentation/trading): Place, cancel, and retrieve equity orders through the TradeZero REST API. Covers the order-management endpoints below, the full Buy/Sell/Short/Cover surface, order-type and time-in-force rules, cancel patterns, and the order lifecycle. - [Order Rejections](https://developer.tradezero.com/docs/documentation/order-rejections): Quick reference for TradeZero order rejections — R-code table, async vs sync timing, where to read text, and client integration rules including R130 cancel overwrite. - [Options Trading](https://developer.tradezero.com/docs/documentation/options): Place single-leg and multi-leg options orders through the TradeZero REST API. Covers the OCC symbol format, all four trader actions (BTO/STO/STC/BTC), supported multi-leg strategies, the Mleg envelope rules, validation errors, order history, and options positions. - [Open Positions](https://developer.tradezero.com/docs/documentation/positions): Read open positions and per-position P&L on a TradeZero account. The two endpoints share row identity through positionId and return the same JSON response format on paper and live; this page covers the response envelopes, field reference, error handling, and live updates via WebSocket. - [Closed Positions](https://developer.tradezero.com/docs/documentation/closed-positions): Read fully-closed position lifecycles on a TradeZero account - realized P&L, cumulative shares in/out, and blended entry/exit prices per symbol lifecycle. Covers what the endpoint returns, what it does not do, aggregation, positionId handling, field reference, update patterns, and worked examples. - [Trading API FAQs](https://developer.tradezero.com/docs/documentation/trading-api-faqs): Answers to frequently asked questions about the TradeZero Trading API - order behavior, account states, market hours, error codes, and other operational details. ## WebSocket API - [About WebSocket API](https://developer.tradezero.com/docs/websocket_api): Connect to the TradeZero WebSocket API for real-time account streaming. Covers authentication with TZ-API-KEY-ID and TZ-API-SECRET-KEY, system messages, TypeScript interfaces, reconnection strategy, and separate P&L and Portfolio stream endpoints. - [P&L Stream](https://developer.tradezero.com/docs/websocket_api/pnl): Subscribe to the TradeZero P&L WebSocket stream for real-time profit and loss updates per position. Authenticates with TZ-API-KEY-ID and TZ-API-SECRET-KEY. JSON push messages cover account equity, unrealized P&L, and per-symbol breakdowns. - [Portfolio Stream](https://developer.tradezero.com/docs/websocket_api/portfolio): Subscribe to the TradeZero Portfolio WebSocket stream for push-based order and position updates. Receive fills, partial fills, cancellations, and rejections as orders are processed - no polling required. ## FAQ excerpts - Q: What kind of software can I build with the API? / A: The API Trading program is for self-directed traders building personal assistive tooling on their own TradeZero account - dashboards, hotkey helpers, execution assistants, and integrations you run for yourself. You keep full GUI access through ZeroPro, TZ1, or ZeroMobile alongside your integration. Fully unattended … (https://developer.tradezero.com/docs/documentation/trading-api-faqs) - Q: Should I start on paper or live? / A: Start on paper. Endpoints, schemas, and error semantics match live, but you are working with simulated funds. Validate order placement, cancellation, WebSocket subscriptions, and account reads end-to-end on paper keys, then switch to live credentials when you are ready. Locates require a live account for the full qu… (https://developer.tradezero.com/docs/documentation/trading-api-faqs) - Q: Why does my order return `200 OK` but `orderStatus: "Rejected"`? / A: The API returns 200 OK once the request body is structurally valid. Whether the order is accepted for routing is reflected in orderStatus. Common rejections include: - R78 - market order submitted outside Regular Trading Hours (9:30 AM-4:00 PM ET). Use a Limit order with timeInForce: "Day_Plus" or "GTC_Plus" for ext… (https://developer.tradezero.com/docs/documentation/trading-api-faqs) - Q: Why didn't I get the rejection reason on POST /order? / A: Many rejections on live accounts are asynchronous when you send an explicit route (for example "SMART") — R24, R54, R95, platform NBBO limits, and R118 without route follow this pattern. POST /order returns PendingNew and text: null; the reason appears on GET /order/{clientOrderId} and GET /orders moments later. Exc… (https://developer.tradezero.com/docs/documentation/trading-api-faqs) - Q: Why does GET /order return 404 for my rejected order? / A: Three common causes: 1. Registration race — poll for 1–2 s after PendingNew POST before giving up. 2. clientOrderId rewrite — R118 routed rejections return a different clientOrderId on POST (with an INVALID suffix). Always use post.clientOrderId from the POST response, not the ID you sent. 3. Reject without retrieva… (https://developer.tradezero.com/docs/documentation/trading-api-faqs) - Q: Why did cancel show R130 instead of the original rejection? / A: If the client calls DELETE /orders/{clientOrderId} on an order that is already Rejected, the API returns HTTP 200 but overwrites text with R130: Cancel Request Rejected: …, masking the original reason (for example R118). Read and display the rejection from GET /order/{clientOrderId} before attempting cancel, and nev… (https://developer.tradezero.com/docs/documentation/trading-api-faqs) - Q: Where are rejection timestamps? / A: Every order row carries startTime (submission) and lastUpdated (last state change). On async rejections, lastUpdated is when orderStatus: "Rejected" and text landed — a few milliseconds after startTime (within ~50 ms on live routed orders). (https://developer.tradezero.com/docs/documentation/trading-api-faqs) - Q: Does the Portfolio WebSocket carry rejection events? / A: Yes, for async rejections (R24, R54, R95, R118 without route, platform NBBO). Subscribe to "Order" on wss://webapi.tradezero.com/stream/portfolio. Rejected orders push an Order update with orderStatus: "Rejected", populated text, and timestamps. Many async rejections send two pushes — first PendingNew, then Rejected… (https://developer.tradezero.com/docs/documentation/trading-api-faqs) - Q: Can I modify a working order? / A: There is no modify endpoint. Use the cancel-then-replace pattern: DELETE /v1/api/accounts/{accountId}/orders/{clientOrderId} the original, wait for orderStatus: "Canceled", then POST /order a replacement with a new clientOrderId. Reusing the original id returns R114 even after cancellation - the id is consumed perma… (https://developer.tradezero.com/docs/documentation/trading-api-faqs) - Q: What's the difference between `GET /orders` and `GET /orders/start-date`? / A: Both are about orders, but they sit at different levels: - GET /orders is the today's order book - it returns every order on the account from today's session regardless of current state (rows include New, Accepted, PartiallyFilled, Filled, Canceled, Rejected, DoneForDay, …) plus any still-working orders from previou… (https://developer.tradezero.com/docs/documentation/trading-api-faqs) - Q: Why does canceling an order return `404`, `400`, or `401`? / A: DELETE /v1/api/accounts/{accountId}/orders/{clientOrderId} has three distinct failure shapes: - 401 Unauthorized (JSON) - auth headers were missing. Body: {"statusCode":"Unauthorized","message":"Token not provided","detail":null}. - 404 Not found (plain text) - the order was not found (wrong ID, not yet registered, … (https://developer.tradezero.com/docs/documentation/trading-api-faqs) - Q: Does cancel-all work when there are no open orders? / A: Yes. DELETE /v1/api/accounts/orders always returns {"message":"Cancel Request Submitted Successfully"} as long as the multipart body carries a valid account field - regardless of whether any orders were open. (https://developer.tradezero.com/docs/documentation/trading-api-faqs) - Q: Are enum values case-sensitive? / A: Yes, but enforcement differs by field. side, orderType, securityType, and timeInForce are case-sensitive - wrong case returns 400. For openClose, always send "Open" or "Close" exactly. (https://developer.tradezero.com/docs/documentation/trading-api-faqs) - Q: Can I send fractional shares? / A: No. orderQuantity must be a whole integer. Sending 0.5 returns 400 Bad Request with - orderQuantity: Invalid type. Expected: integer, given: number. (https://developer.tradezero.com/docs/documentation/trading-api-faqs) - Q: What is `route: ""` in a rejected order? / A: Some orders rejected during validation show route: "" because no venue was selected. Always check orderStatus === "Rejected" and read text for the reason. (https://developer.tradezero.com/docs/documentation/trading-api-faqs) - Q: Why did my order reject with `R54: Unable to reach the destination Route`? / A: The order had no usable route. On a live account, always send an explicit route from GET /routes - omitting route can leave the order with no route assigned and produce R54 during routing. The other cause is sending a route your account doesn't have (route names vary by account, and securityType matters - e.g. a sin… (https://developer.tradezero.com/docs/documentation/trading-api-faqs) - Q: Which routes are available - and what's the difference between paper and live? / A: Query GET /v1/api/accounts/{accountId}/routes: - Paper accounts return two synthetic routes - PAPER (Stock + Option) with Day, GoodTillCancel, GoodTillCrossing and PAPERM (MLEG, Day-only). - Live accounts return five routes - SMART (smart router for Stocks; widest order-type and TIF set), CTDL (direct-access stock r… (https://developer.tradezero.com/docs/documentation/trading-api-faqs) - Q: Can I cancel an order immediately after placing it? / A: A DELETE /v1/api/accounts/{accountId}/orders/{clientOrderId} issued before the order is registered may return 404 Not found. Poll GET /orders until the order appears before canceling, or retry the cancel after a brief delay. (https://developer.tradezero.com/docs/documentation/trading-api-faqs) - Q: How do I tell paper accounts from live accounts in the API response? / A: Read the accountType field from GET /v1/api/account/{accountId}. Paper accounts return "Paper"; live accounts return "Live" (or another non-"Paper" value reflecting how the account is classified). Do not pattern-match account IDs - use the server-issued field. See Account Types. (https://developer.tradezero.com/docs/documentation/trading-api-faqs) - Q: Why am I getting `404 Not found` instead of `401 Unauthorized` when my credentials are wrong? / A: Most read endpoints return 404 Not found when credentials are missing or invalid. The order-cancel endpoint (DELETE /v1/api/accounts/{accountId}/orders/{clientOrderId}) returns 401 Unauthorized instead. Handle both status codes in your client. See Error handling. (https://developer.tradezero.com/docs/documentation/trading-api-faqs) - Q: Do I need to refresh or rotate my API keys? / A: No automatic expiry - keys stay valid until you explicitly regenerate or disable them in the portal. Rotate if you suspect a leak: use Regenerate Secret to replace just the secret (invalidating the old one immediately) or Disable + Generate for a full key replacement. Every lifecycle event is logged in the portal's … (https://developer.tradezero.com/docs/documentation/trading-api-faqs) - Q: Why does `POST /quote` return `200 OK` but no offer ever appears in `/history`? / A: On paper accounts, /quote returns 200 OK but the quote settles in /history as locateStatus: 56 Rejected because locates run on live accounts only. Use a funded live account for the full quote → accept → inventory workflow. See Account Types. On live accounts, quotes that find no available inventory may produce a Rej… (https://developer.tradezero.com/docs/documentation/trading-api-faqs) - Q: How long does an offered locate quote stay valid? / A: 30 seconds from when the row first reaches locateStatus: 65 (Offered). If you don't POST /accept within that window, both rows (and the .SU sibling for Reg SHO symbols) move to status 67 (Expired) and you need to issue a fresh /quote. (https://developer.tradezero.com/docs/documentation/trading-api-faqs) - Q: What is a Reg SHO threshold security and why do I see two rows in `/history`? / A: A Reg SHO threshold security is an equity security that appears on a threshold securities list under Regulation SHO due to persistent fail-to-deliver positions meeting regulatory thresholds for five consecutive settlement days. The platform returns two priced rows for these symbols: one for the Pre-Borrow offer (you… (https://developer.tradezero.com/docs/documentation/trading-api-faqs) - Q: Do the streams send a keepalive ping? / A: No. The server does not send a keepalive. Implement your own reconnection logic with exponential backoff so long-lived connections can recover automatically if they drop. See Reconnection. (https://developer.tradezero.com/docs/documentation/trading-api-faqs) - Q: Are both streams available on paper accounts? / A: Yes. The P&L and Portfolio streams work identically on paper and live accounts. P&L updates are driven by simulated quote ticks on your paper positions. See WebSocket API. (https://developer.tradezero.com/docs/documentation/trading-api-faqs) ## API Reference - [TradeZero Developer API](https://developer.tradezero.com/docs/TradeZeroAPI/tradezero-developer-api): TradeZero offers a powerful and modern API that enables seamless interaction with our trading platform. Using our API you can perform a variety of trading operations programmatically: - [Create Order](https://developer.tradezero.com/docs/TradeZeroAPI/post-v-1-api-accounts-account-id-order): Create an order for the user's account - [Cancel Order](https://developer.tradezero.com/docs/TradeZeroAPI/delete-v-1-api-accounts-account-id-orders-client-order-id): Cancel an open order, returning the canceled order details. - [List User Accounts](https://developer.tradezero.com/docs/TradeZeroAPI/get-v-1-api-accounts): Get account details for all your accounts. - [Retrieve Account Details](https://developer.tradezero.com/docs/TradeZeroAPI/get-v-1-api-account-account-id): Retrieve account details for one of your accounts. - [Retrieve Account Values and Profit/Loss](https://developer.tradezero.com/docs/TradeZeroAPI/get-v-1-api-accounts-account-id-pnl): Retrieve profit and loss, balance, exposure, etc. for your account. - [Retrieve Positions](https://developer.tradezero.com/docs/TradeZeroAPI/get-v-1-api-accounts-account-id-positions): Retrieve all open positions for the account. - [Retrieve Closed Positions](https://developer.tradezero.com/docs/TradeZeroAPI/get-v-1-api-accounts-account-id-positions-closed): Retrieve closed positions for the account. - [Retrieve Today's Orders](https://developer.tradezero.com/docs/TradeZeroAPI/get-v-1-api-accounts-account-id-orders): Retrieve orders from today for your account. - [Retrieve Historical Orders](https://developer.tradezero.com/docs/TradeZeroAPI/get-v-1-api-accounts-account-id-orders-start-date-start-date): Retrieve up to 1 week of historical orders for your account. Note: only orders for live production accounts are returned, paper trading accounts do not have order history available. - [Cancel All Orders](https://developer.tradezero.com/docs/TradeZeroAPI/delete-v-1-api-accounts-orders): Cancel all open orders for your account and optionally by the specified by symbol. Details for each canceled order are not returned. - [Is Symbol Easy to Borrow](https://developer.tradezero.com/docs/TradeZeroAPI/get-v-1-api-accounts-account-id-is-easy-to-borrow-symbol-symbol): Check if a symbol is easy to borrow for short selling. - [Retrieve Trading Routes](https://developer.tradezero.com/docs/TradeZeroAPI/get-v-1-api-accounts-account-id-routes): Retrieve available trading routes for your account. - [Locate a quote](https://developer.tradezero.com/docs/TradeZeroAPI/post-v-1-api-accounts-locates-quote): Locate a symbol quote - [Accept a locate quote](https://developer.tradezero.com/docs/TradeZeroAPI/post-v-1-api-accounts-locates-accept): Accept a locate quote that has been offered. Locates typically expire within a short time frame. See Get locates inventory and history for locate status. - [Cancel a locate quote](https://developer.tradezero.com/docs/TradeZeroAPI/delete-v-1-api-accounts-locates-cancel-accounts-account-id-quote-req-id-quote-req-id): Cancel a locate quote - [Sell a locate for credit](https://developer.tradezero.com/docs/TradeZeroAPI/post-v-1-api-accounts-locates-sell): Sell a locate for credit - [Get locates inventory](https://developer.tradezero.com/docs/TradeZeroAPI/get-v-1-api-accounts-account-id-locates-inventory): Get active locate inventory for the current trading day. - [Get locates history](https://developer.tradezero.com/docs/TradeZeroAPI/get-v-1-api-accounts-account-id-locates-history): Get active history for all open/closed/expired locates for the day. - [Retrieve Historical Orders Paginated](https://developer.tradezero.com/docs/TradeZeroAPI/get-v-1-api-accounts-account-id-orders-with-pagination-start-date-start-date): Retrieve up to 1 year of historical orders for your account with paginated results. Note: only orders for live production accounts are returned, paper trading accounts do not have order history available. - [Retrieve an Order from Today](https://developer.tradezero.com/docs/TradeZeroAPI/get-v-1-api-accounts-account-id-order-order-id): Retrieve an order from today for the specified orderId and account. ## Recipes - [Place Your First Order](https://developer.tradezero.com/recipes/place-your-first-order): Authenticate, confirm credentials, check buying power, place a market order, and verify the status - your first end-to-end TradeZero integration. - [Authenticate & Discover Account](https://developer.tradezero.com/recipes/authenticate-and-discover-account): Validate credentials against the live API, identify whether you are pointed at a paper or live account, and enumerate the routes your account is authorized to use. - [List All Your Accounts](https://developer.tradezero.com/recipes/list-all-accounts): Use GET /v1/api/accounts as the entry point for any tool that operates across multiple TradeZero accounts. The list response already carries full account data; call the per-account detail endpoint in parallel only if you need the bp field (the list uses buyingPower). Partition paper vs live by the accountType field returned on each row. - [Encoding Trader Actions](https://developer.tradezero.com/recipes/trader-actions-wire-format): TradeZero accepts only side: "Buy" | "Sell" on order requests; the trader's real intent (Buy / Sell / Short / Cover) is encoded by pairing side with openClose. This recipe maps trader actions to wire fields in both directions. - [Place a Limit Order & Cancel It](https://developer.tradezero.com/recipes/limit-order-and-cancel): Submit a resting limit buy far below the market, confirm it is on the book, cancel by clientOrderId, and poll until the order reaches a terminal state. - [Watch a Single Order to Completion](https://developer.tradezero.com/recipes/watch-single-order): Place one order then poll GET /order/{clientOrderId} - a lightweight single-order endpoint that returns the result directly, without scanning all of today's orders or parsing userOrderId. - [Pre-Trade Validation](https://developer.tradezero.com/recipes/pre-trade-validation): Validate account status, available cash, route capability, existing position, and option trading level - *before* you submit POST /order. Catches the primary 4xx rejections upfront and gives users every failure at once instead of one per retry. - [Route-Aware Order Submission](https://developer.tradezero.com/recipes/route-aware-order): Query GET /routes to discover available execution venues, select the best one for your order characteristics, and pass the route field in POST /order to direct the order precisely. - [Stop-Loss On a Long Position](https://developer.tradezero.com/recipes/stop-loss-on-long-position): Look up an existing long position, size a stop relative to the average entry price, submit a Sell/Close stop order with timeInForce: GoodTillCancel, and verify it parks on the book. - [Use clientOrderId for Idempotency](https://developer.tradezero.com/recipes/client-order-id-idempotency): Never submit the same order twice. Generate a stable clientOrderId before the first attempt, check GET /order/{clientOrderId} to dedupe client-side, and reconcile through the same key after any transport failure. - [Cancel All Open Orders](https://developer.tradezero.com/recipes/cancel-all-open-orders): Use DELETE /v1/api/accounts/orders to flatten every working order in one call (optionally scoped by symbol), poll until terminal, and fall back to per-order cancellation when you need finer-grained subsets. - [Flatten All Positions](https://developer.tradezero.com/recipes/flatten-all-positions): Close every open position when you choose to. Walk each row of /positions, build the inverse market order (longs → Sell/Close, shorts → Buy/Close, options use tradedSymbol), submit sequentially, and poll until the account is fully flat. - [Locate Shares & Sell Short](https://developer.tradezero.com/recipes/locate-and-sell-short): Check Easy-To-Borrow, request and accept a locate quote for hard-to-borrow symbols, confirm the inventory landed, then open the short with side: "Sell" / openClose: "Open". - [Cancel a Pending Locate](https://developer.tradezero.com/recipes/cancel-pending-locate): Locate quotes are not free - every offer ties up inventory. When the offered rate exceeds your threshold, cancel cleanly via DELETE /locates/cancel/accounts/{id}/quoteReqID/{q} and confirm the cancel landed in /locates/history before moving on. - [Handle Locate Rejections](https://developer.tradezero.com/recipes/handle-locate-rejections): Every locate rejection lands in /locates/history with locateStatus: 56. The text field tells you why. This recipe shows how to classify each rejection code and build the appropriate recovery path - skip ETB symbols, back off on "no inventory", and reuse live quotes instead of re-quoting when already pending. - [Reuse Locate Inventory](https://developer.tradezero.com/recipes/reuse-locate-inventory): Check existing locate inventory before requesting a new quote. Pre-Borrow locates survive multiple short/cover cycles intraday - no re-quoting needed. Sell back unused inventory end-of-day to stop the billing clock. - [Select Between Pre-Borrow and Single Use](https://developer.tradezero.com/recipes/locate-type-selection): When a Reg SHO threshold symbol returns two locate offers - Pre-Borrow (locateType: 3) and Single Use (locateType: 4) - pick the one that minimises your borrow cost for your planned trade count. - [Cancel a Pending Sell-Back](https://developer.tradezero.com/recipes/cancel-pending-sell): After queuing a locate sell-back with POST /locates/sell, you can reverse the decision using the same DELETE /locates/cancel endpoint before the sell settles. The shares return to your available inventory. - [Locate a Basket of Symbols](https://developer.tradezero.com/recipes/locate-basket): Fan-out ETB checks across a list of symbols you select, request locate quotes for the hard-to-borrow names in parallel, poll a single history response to classify all outcomes at once, then accept the offers that meet your rate criteria. - [Pre-Market Short Setup](https://developer.tradezero.com/recipes/pre-market-short-setup): A morning checklist for short sellers: check existing inventory for reuse, ETB-filter the entire watchlist in one parallel pass, request locate quotes in parallel for hard-to-borrow names, accept or cancel offers against a rate threshold you set, then confirm a clean inventory snapshot before market open. - [Build & Parse OCC Option Symbols](https://developer.tradezero.com/recipes/occ-option-symbol): Master the 13-21-character OCC symbol format the TradeZero API uses for every option order - construct it from human inputs, parse it back from positions, and submit a single-leg buy with it. - [Close an Option Position](https://developer.tradezero.com/recipes/close-option-position): Look up an existing short option in /positions, submit a Buy/Close limit at the mid + a tick, then poll positions until the row disappears - the inverse of opening a short. - [Multi-Leg Options: Bull Call Spread](https://developer.tradezero.com/recipes/multi-leg-options-spread): Define a vertical spread as two OCC legs, sort by strike ascending, and submit as a single securityType: "Mleg" ticket. The venue prices and fills both legs together at the net debit, so you never carry one-sided risk during the fill. - [Options Strategy Cookbook](https://developer.tradezero.com/recipes/options-strategy-cookbook): A single recipe for every documented multi-leg strategy - Covered Call, Married Put, Straddle, Strangle, Bull Call / Bear Put, Butterfly, Iron Butterfly, Condor, Iron Condor. Build the OCC + submit scaffolding once; plug in the right legs[] per strategy. The wire format never changes - only the legs do. - [Live Account Dashboard](https://developer.tradezero.com/recipes/live-account-dashboard): Fan out four parallel reads (/account, /pnl, /positions, /orders), compose the headline metrics into a flat snapshot, and poll on an exponential-backoff timer so the dashboard stays cheap when idle and responsive when active. - [End-of-Day Trade Recap](https://developer.tradezero.com/recipes/end-of-day-recap): Pull today's historical orders from GET /orders/start-date/{date} (one row per fill - tradeId, qty, price, commission, totalFees, netProceeds), summarise headline activity (fills, share volume, gross/net flow, fees), and print a per-symbol VWAP and net-share breakdown - with a fallback to GET /orders for paper accounts (paper has no order history available). - [Closed Positions Recap](https://developer.tradezero.com/recipes/closed-positions-recap): Read GET /positions/closed, parse lifecycle rows with safe positionId handling, aggregate cumulative realized P&L by symbol (or tradedSymbol for options), print a closed-trades recap, and poll for async lifecycle updates after a flat close. - [Poll Orders & Detect Fills](https://developer.tradezero.com/recipes/poll-orders-detect-fills): Monitor the orders your application submits: track a working set of clientOrderIds, detect each status transition once, prune terminal orders, and stay within rate limits. - [P&L Stream Dashboard](https://developer.tradezero.com/recipes/pnl-stream-dashboard): Connect to the P&L WebSocket stream, complete the two-step auth handshake, subscribe with {"account": accountId}, then maintain a live in-memory state of account equity and per-position unrealized P&L - with correct snapshot seeding, aggCalcs merging, and nested pnlCalc updates. - [Portfolio Stream](https://developer.tradezero.com/recipes/portfolio-order-tracker): Bootstrap your order and position state from REST, then stream live incremental updates from the Portfolio WebSocket. Orders key on clientOrderId; position updates arrive with id (the WebSocket name for positionId). Buffer messages during the REST fetch so no event is ever lost. ## Change Log - [Change Log](https://developer.tradezero.com/docs/changelog): Release notes and notable changes to the TradeZero Developer APIs - new endpoints, breaking changes, and behavior updates, listed in reverse chronological order. ## Optional - [Home](https://developer.tradezero.com/): Developer portal landing page with links to docs, API reference, and recipes. - [Search](https://developer.tradezero.com/search): On-site search (not intended for indexing). Unlisted preview guides (stock scanner, news scanner) and non-production API reference pages are omitted from this index and marked `noindex` on the site.