Skip to content
Skip to main content

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.

MethodPathSummary
GET/accountsList User Accounts
GET/account/:accountIdRetrieve Account Details
GET/accounts/:accountId/pnlRetrieve 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.

MethodPathSummary
GET/accounts/:accountId/positionsRetrieve 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.

MethodPathSummary
POST/accounts/:accountId/orderCreate Order
GET/accounts/:accountId/ordersRetrieve Today's Orders
GET/accounts/:accountId/order/:clientOrderIdRetrieve a Single Order by clientOrderId
GET/accounts/:accountId/orders/start-date/:startDateRetrieve Historical Orders
DELETE/accounts/:accountId/orders/:orderIdCancel Order
DELETE/accounts/ordersCancel All Orders
GET/accounts/:accountId/is-easy-to-borrow/symbol/:symbolIs Symbol Easy to Borrow
GET/accounts/:accountId/routesRetrieve 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.

MethodPathSummary
POST/accounts/locates/quoteRequest a locate quote
POST/accounts/locates/acceptAccept a locate quote
DELETE/accounts/locates/cancel/accounts/:accountId/quoteReqID/:quoteReqIDCancel a locate quote
POST/accounts/locates/sellSell a locate for credit
GET/accounts/:accountId/locates/inventoryGet locates inventory
GET/accounts/:accountId/locates/historyGet 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-ID and TZ-API-SECRET-KEY headers on every request. See Authentication.
  • Path prefix - all routes are namespaced under /v1/api.
  • Content type - JSON request and response bodies; send Accept: application/json and Content-Type: application/json on 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