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.trade0.click/v1/api. The catalog below is the production surface documented on this site. The API Reference sidebar lists the same production endpoints; additional OpenAPI paths (quotes, newsfeed, fundamentals, and others) are documented under What's not in the REST API.
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 |
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
Two endpoints cover the portfolio: one returns the current open positions for an account, with per-position averages, side, and option metadata where applicable; the other returns closed (flat) lifecycles with realized P&L and cumulative share accounting. See Open Positions and Closed Positions for integration guides.
| Method | Path | Summary |
|---|---|---|
| GET | /accounts/:accountId/positions | Retrieve Positions |
| GET | /accounts/:accountId/positions/closed | Retrieve Closed 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 pair 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. For rejection reasons and async rejection timing, see 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 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; few offer a sell-back path for unused inventory. 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.trade0.click, 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.
- Paper first - build and validate 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 assistive tooling vs unattended automation.
What's not in the REST API
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.
- Market-data endpoints (quotes, charts, historical prices) are not available on the public API today. When they ship, availability and terms will be announced in the Change Log.
Where to go next
- API Reference - full OpenAPI-generated schemas for the production endpoints in this catalog.
- Quickstart Recipes - ready-to-run examples in Python and TypeScript for starter scenarios. 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, Closed Positions Recap, 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.