Skip to content

Integrate Trade It into your platform ​

Let users sign in with Trade It, connect their brokerages, view accounts, holdings, and trade history, and place trades from your product. Use the React SDK for embedded connection and trading modals, or use the REST API to build your own account and order screens.

Install the Trade It React skill in your project:

bash
npx skills add trade-it-inc/react-sdk-skill

Then give your AI coding client this prompt:

text
Use the $trade-it-react skill to integrate Trade It into this platform.
Read https://docs.tradeit.app/sdk and its linked guides first.

Use our existing framework, authentication, and database. Set up a
server-side OAuth client with discovery, PKCE, state validation, a callback,
and per-user token storage and refresh. Add a “Sign in with Trade It” button.
Keep the client secret and OAuth tokens on the server.

Add the brokerage connection modal, an account selector, and holdings for
the selected account. Add trade history using the REST API.
Use @trade-it/react for the trade review modal.
Require explicit user approval before placing any live trade.

Tell me which callback URL to register and which environment variables to
set. I will supply credentials through the environment, not this chat.
Verify the authorization, denied-consent, refresh, and reconnect paths.

Create your organization and obtain credentials below before testing the integration. The skill helps implement the code; you still choose your app's permissions and configure its credentials.

1. Create your organization and get credentials ​

  1. Sign up or sign in at Trade It.
  2. Choose Organization on first login, or open Partner Setup from your existing account.
  3. Enter your organization name, logo URL, and client URI (your platform's website).
  4. Add your redirect URIs. These are callback routes on your server that receive the OAuth authorization result. For the local example, register http://localhost:3000/auth/tradeit/callback. Add your production callback separately, for example https://app.example.com/auth/tradeit/callback.
  5. Complete checkout and set up your payment method.
  6. Save the provisioned Client ID (client_id) and Client Secret (client_secret). The secret is revealed only once; store it in your server's secret manager.

The Client ID identifies your platform. The Client Secret authenticates your server. Neither is a user's access token: each user must authorize your app before you can access their brokerage data.

2. Set up your OAuth client ​

Follow Set up OAuth to configure credentials and discover endpoints. The manual guide includes focused code snippets for your existing app, with each step labeled client side or server side.

3. Add sign-in and save user tokens ​

Add a Sign in with Trade It button that starts authorization through your server. Trade It returns the user to your callback, where you validate the request, exchange the code, and store tokens for that platform user. Follow Sign in and save tokens.

Your platform session and the user's Trade It authorization are separate. If your product already has accounts, link Trade It to the currently signed-in platform user.

4. Build the experience ​

GuideWhat you will build
Connect a brokerageOpen the embedded connection modal using a short-lived session URL.
Read accountsShow the user's accounts and let them choose one.
Read holdingsDisplay positions for the selected account.
Read trade historyFetch the user's recent trades.
Place tradesUse the React trade modal or submit user-approved orders through your server.

For the embedded modals, install:

bash
npm install @trade-it/react

Account, holdings, and trade history reads use the REST API and do not require React. See the API reference for request and response fields and the SDK enums for modal configuration values.

Only need a button that opens a prefilled trade on Trade It? Use Trade Links. For help with your platform integration, contact us.