About Trading API
The TradeZero Trading API is a JSON REST interface to your brokerage account. Place and cancel orders, retrieve balances and positions, and run the full short-locate workflow on the same infrastructure that powers TradeZero Platforms. The endpoint catalog below is aligned with our OpenAPI 3 specification. Narrative guides (Equity Trading, API Conventions, Rate Limits) cover runtime behavior the API Reference does not fully spell out - mixed content types, async outcomes, and error shapes.
What you can do
The Trading API is organized around four core workflows and a set of supporting lookups:
- Manage your account and live P&L - list the accounts your keys can trade, retrieve detailed account state, and pull aggregated profit/loss with per-position breakdown. See Account Info.
- Place and cancel orders for equities and options (single-leg and multi-leg via strategies) - market, limit, stop, and stop-limit orders with full route control. See Equity Trading and Order types, times in force, and session hours.
- Trade multi-leg option strategies - a fixed catalog of verticals, straddles, strangles, butterflies, iron butterflies, condors, iron condors, covered calls, and married puts, all using OCC symbology. See Options Trading.
- Run the full short-locate workflow - easy-to-borrow checks, locate quotes, accept and cancel, inventory management, sell-back for credit, and locate history with audit details. See Short Locates.
- Discover trading routes for DMA - retrieve the routing destinations available to your account, with the order types, securities, and times in force each route accepts.
Endpoint catalog
Every REST endpoint lives under https://webapi.tradezero.com/v1/api. The catalog below is the production surface documented on this site. The API Reference sidebar lists the same production endpoints; companion surfaces (WebSocket, MCP, and market data outside this REST catalog) are summarized under Beyond REST.
Accounts
The account endpoints return the metadata, balances, and aggregate P&L that drive every other workflow. Call List User Accounts at startup to learn which account IDs the key pair can trade, then call Retrieve Account Details for the static metadata you don't need to refresh on every tick (account status, type, option trading level, buying-power limits). For live account values and P&L you have two options: poll Retrieve Account Values and Profit/Loss on a timer, or subscribe to the P&L Stream over WebSocket to get the same aggregates and per-position breakdown pushed in real time as prices move and orders fill.
| Method | Path | Summary |
|---|---|---|
| GET | /accounts | List User Accounts |
| GET | /account/:accountId | Retrieve Account Details |
| GET | /accounts/:accountId/pnl | Retrieve Account Values and Profit/Loss |
Cash
Paginated cash ledger history - deposits, withdrawals, locate fees, and other cash movements - for a date window of up to one year. See Cash Transactions for query defaults, pagination, and the response envelope.
| Method | Path | Summary |
|---|---|---|
| GET | /accounts/:accountId/cash-transactions/start-date/:startDate | Retrieve Cash Transaction History Paginated |
Positions
Three endpoints cover the portfolio: open holdings with per-position averages and option metadata; closed (flat) lifecycles with realized P&L; and holdings as of a calendar date. See Positions & P&L, Closed positions, and Historical positions.
| Method | Path | Summary |
|---|---|---|
| GET | /accounts/:accountId/positions | Retrieve Positions |
| GET | /accounts/:accountId/positions/closed | Retrieve Closed Positions |
| GET | /accounts/:accountId/positions/historical | Retrieve Historical Positions |
Orders
The orders surface covers submission, listing (today and historical), and single or bulk cancellation. Supporting lookups - easy-to-borrow and routes - pair with placement. One Create Order endpoint handles equities, single-leg options, and multi-leg strategies via securityType and legs.
- Poll
GET /ordersorGET /order/{clientOrderId}for status, or subscribe to the Portfolio Stream forOrder/Positionpushes. - Rejection timing and R-codes: Equity Trading → Order rejections.
| Method | Path | Summary |
|---|---|---|
| POST | /accounts/:accountId/order | Create Order |
| GET | /accounts/:accountId/orders | Retrieve Today's Orders |
| GET | /accounts/:accountId/order/:clientOrderId | Retrieve a Single Order (orderId path param is your clientOrderId) |
| GET | /accounts/:accountId/orders/start-date/:startDate | Retrieve Historical Orders |
| GET | /accounts/:accountId/orders-with-pagination/start-date/:startDate | Retrieve Historical Orders (paginated) |
| DELETE | /accounts/:accountId/orders/:clientOrderId | Cancel Order |
| DELETE | /accounts/orders | Cancel All Orders |
| GET | /accounts/:accountId/is-easy-to-borrow/symbol/:symbol | Is Symbol Easy to Borrow |
| GET | /accounts/:accountId/routes | Retrieve Trading Routes |
Locates
Locates expose a programmatic short-borrow workflow that many broker APIs do not offer: quote priced inventory, accept offers, sell back unused shares, and audit session history. Six endpoints cover the full lifecycle from easy-to-borrow checks through credit-back.
| Method | Path | Summary |
|---|---|---|
| POST | /accounts/locates/quote | Request a locate quote |
| POST | /accounts/locates/accept | Accept a locate quote |
| DELETE | /accounts/locates/cancel/accounts/:accountId/quoteReqID/:quoteReqID | Cancel a locate quote |
| POST | /accounts/locates/sell | Sell a locate for credit |
| GET | /accounts/:accountId/locates/inventory | Get locates inventory |
| GET | /accounts/:accountId/locates/history | Get locates history |
Conventions
A few rules apply to every endpoint above. The full cross-API reference is on API Conventions.
- Base URL -
https://webapi.tradezero.com, the same host for both paper and live; the API key pair selects the environment. - Authentication -
TZ-API-KEY-IDandTZ-API-SECRET-KEYheaders on every request. See Authentication. - Path prefix - all routes are namespaced under
/v1/api. - Content type - JSON request and response bodies on most endpoints; send
Accept: application/jsonandContent-Type: application/jsonon JSON routes. Exception: Cancel all orders requiresmultipart/form-dataorapplication/x-www-form-urlencoded, not JSON. See API Conventions → HTTP and content types. - HTTPS only - non-TLS connections are refused.
- Paper first - build against paper keys, then swap in live credentials. Same URL, same schemas; locates and some route inventories differ on live.
- Permitted use - the API Trading Agreement defines what your personal Customer Application may do. This documentation describes how the API works; Built for your workflow summarizes personal trading tools versus fully unattended systems.
Beyond REST
The REST surface covers state queries and write actions (orders, locates). Additional capabilities are delivered through companion channels:
- Real-time streaming of order status, position changes, and live P&L is delivered over the WebSocket API using the same key pair.
- AI assistants connect to the same account through TradeZero MCP using OAuth 2.0.
- Market data (quotes, charts, historical prices) is provided through TradeZero Platforms and market-data partners - it is outside this public Trading API surface. Watch the Change Log for any future additions to this site.