Skip to content

Trade It API

Base URL:https://api.tradeit.app

Use the Trade It REST API to read connected brokerage accounts and holdings, create equity or options trade drafts, execute approved orders, and cancel eligible orders. These endpoints work without an embedded Trade It modal, so a partner can build the entire review and trading experience in its own application.

Authentication

Send either a Trade It API key or an OAuth access token as a bearer token with every request:

http
Authorization: Bearer <access_token_or_api_key>
Content-Type: application/json

Create an API key from the API keys page. For a multi-user partner integration, use OAuth so every request is authorized for the correct Trade It user.

OAuth discovery is available at:

text
https://tradeit.app/.well-known/oauth-authorization-server

Keep the partner client_secret, API keys, access tokens, and refresh tokens on your server. Do not expose them in browser code.

Tool execution

The account and trading operations documented here use one canonical endpoint:

http
POST https://api.tradeit.app/api/tool/execute

Select the operation with toolName and pass its input in params:

json
{
  "toolName": "get_accounts",
  "params": {}
}

The response body is the operation result itself; it is not wrapped in a result property.

API reference

OperationtoolNamePurpose
Get accountsget_accountsList the user's connected brokerage accounts.
Get holdingsget_holdingsList positions for one brokerage account.
Get tradesget_tradesRead recent trades and refresh order state.
Create tradecreate_tradeCreate a stock or crypto trade draft.
Create options tradecreate_options_tradeCreate a single-leg or multi-leg options draft.
Execute tradeexecute_tradeSubmit a reviewed draft to the brokerage.
Cancel tradecancel_tradeCancel a draft or request brokerage cancellation.
  1. Call Get accounts and let the user choose an account.
  2. Call Create trade or Create options trade.
  3. Render the returned order, including its account, action, quantity, order type, prices, and legs.
  4. Ask the user to approve that specific order.
  5. Only after approval, pass its id to Execute trade.
  6. Use Get trades to refresh the order state or Cancel trade when the user requests cancellation.

Explicit approval

Creating a draft and executing it are separate operations. Do not call execute_trade immediately after a create operation unless the user has reviewed and explicitly approved that order. An account configured for automatic execution may return an already submitted trade from a create call.

OAuth scopes

Request only the scopes the integration needs:

ScopeUsed for
brokerage:readAccounts and holdings
trade:readTrade history and current order state
trade:writeCreating, executing, and canceling trades
tool:executeCalling the tool execution endpoint

Errors

Errors use a consistent JSON shape:

json
{
  "error": "invalid_request",
  "error_description": "The request body is invalid.",
  "resolution": null,
  "validation_errors": []
}

Common status codes include 400 for invalid input or an invalid trade state, 401 for missing or invalid authentication, and 403 for insufficient access or an unavailable plan feature.

Partner setup

If you need OAuth credentials for a multi-user integration:

  1. Sign in at tradeit.app.
  2. Choose Organization on first login.
  3. Complete the partner setup flow in the partner portal.
  4. Save the generated client_id and one-time client_secret.

The Trade It Postman collection remains available as a runnable companion to this reference.

If you have questions or want to discuss your use case, contact us.