About Trading API
The TradeZero Trading API is a JSON-over-HTTPS REST API that exposes the same order management, account, and short-locate infrastructure used by ZeroPro, TZ1, and ZeroMobile. The full reference is generated from our OpenAPI 3 specification, so what you see in the catalog below matches exactly what the API sends and accepts.
What you can do
The Trading API is organized around four workflows plus a small 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 Information.
- 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.
- 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 mirrors the API Reference sidebar - jump straight to a row by clicking its summary. Paths in the tables are shown relative to the /v1/api prefix.
Accounts
The account endpoints return the metadata, balances, and aggregate P&L that drive every other workflow. Most integrations call List User Accounts once 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 |
Positions
A single endpoint returns the current open positions for an account, with per-position averages, side, and option metadata where applicable.
| Method | Path | Summary |
|---|---|---|
| GET | /accounts/:accountId/positions | Retrieve Positions |
Orders
The orders surface covers the full order lifecycle - submission, listing (today and historical), and single or bulk cancellation. Two supporting lookups - Is Symbol Easy to Borrow (gates short orders) and Retrieve Trading Routes (DMA destinations) - sit alongside the order endpoints because they're typically called together with order placement. The single Create Order endpoint handles equities, single-leg options, and multi-leg option strategies; the securityType field and legs array on the payload decide which.
To track order status and fills, you can poll Retrieve Today's Orders - or subscribe to the Portfolio Stream over WebSocket and receive a push event every time an order transitions (Accepted, PartiallyFilled, Filled, Canceled, Rejected) and every time a position changes as a result. Most production integrations use REST to submit and cancel orders, and the WebSocket to react to their outcomes.
| 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 by clientOrderId |
| GET | /accounts/:accountId/orders/start-date/:startDate | Retrieve Historical Orders |
| DELETE | /accounts/:accountId/orders/:orderId | 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 are the API's standout: most brokers don't expose short-borrow inventory at all, and the ones that do rarely let you sell unused inventory back for credit. The six endpoints cover the full workflow - quote a locate, accept (or cancel) the quote, sell back what you don't use, and audit current inventory and history.
| 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:
- 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; send
Accept: application/jsonandContent-Type: application/jsonon every call. - HTTPS only - non-TLS connections are refused.
What's not in the REST API
The REST surface covers state queries and write actions (orders, locates). What it deliberately doesn't cover:
- Real-time streaming of order status, position changes, and live P&L is delivered over the WebSocket API using the same key pair.
- Market-data endpoints (quotes, charts, historical prices) are coming soon.
Where to go next
- API Reference - every endpoint with full request and response schemas, generated from the OpenAPI spec.
- Quickstart Recipes - copy-paste flows in Python and TypeScript for the most common scenarios. Useful starting points by workflow:
- Orders → Place Your First Order, Limit Order and Cancel,
clientOrderIdIdempotency. - Locates → Locate & Sell Short, Handle Locate Rejections.
- Options → Multi-Leg Options Spread, Options Strategy Cookbook.
- Account dashboards → Live Account Dashboard, P&L Stream Dashboard.
- Orders → Place Your First Order, Limit Order and Cancel,
- Authentication - generate your API keys and attach them to your first request.