Skip to main content

How to Connect Upstox to TradeLyser

Connect your Upstox account to TradeLyser once and your trades flow into your trading journal automatically: no tradebook downloads, no spreadsheets. TradeLyser uses the official Upstox API, so you create a developer app in your Upstox account, paste its API key and secret into TradeLyser, and log in to Upstox. The whole setup takes about 10 minutes.

Once connected you can:

  • Sync Upstox trades automatically every weekday night, or with one click whenever you want them sooner.
  • Import your Upstox trade history for up to the last 3 financial years, so your journal and analytics start with real data.
  • See P&L, win rate, fees and tax across all your Upstox trades on the TradeLyser dashboard.

What you need​

RequirementWhere to get it
An active Upstox trading accountupstox.com
An Upstox developer app (API key and API secret)Upstox Developer Apps, created in Step 1 below
A TradeLyser accountapp.tradelyser.com (a free trial is available)
Copy the redirect URL exactly

Upstox only sends you back to TradeLyser if the Redirect URI in your Upstox app matches TradeLyser's callback URL character for character:

https://app.tradelyser.com/upstox-callback

A missing https://, an extra / at the end or a typo is the most common reason an Upstox connection fails.

Step 1: Create an Upstox developer app​

  1. Log in to Upstox Developer Apps with your Upstox credentials.
  2. Create a new app.
  3. Give the app a name you will recognise, such as TradeLyser.
  4. In Redirect URI, paste https://app.tradelyser.com/upstox-callback. TradeLyser also shows this URL, with a Copy button, on the Upstox connection screen.
  5. Accept the terms and create the app.
  6. Copy the API Key and API Secret that Upstox generates. Keep the secret private, as you would a password.

Step 2: Add your Upstox account in TradeLyser​

The Add Account screen in TradeLyser, where you choose Upstox from the list of supported brokers

  1. In TradeLyser, open Accounts and click Add Account.
  2. Choose Upstox. Brokers with a green dot are supported for Auto Sync.
  3. Choose a calculation method. This decides how buys and sells are matched into trades:
    • FIFO (first in, first out) is recommended. It matches how most Indian brokers, including Upstox, report P&L.
    • LIFO matches the most recent buy first.
    • WA uses the weighted average price.
  4. Choose Auto Sync as the import method.
  5. Enter an account name (for example Upstox – Intraday), then paste the API Key and API Secret from Step 1.
  6. Click Connect and Save Account. An Upstox login window opens. Sign in, approve access, and you are returned to TradeLyser with the account connected.
These choices are permanent

The calculation method and import method cannot be changed after the account is created. If you need a different method later, add a second Upstox account in TradeLyser.

Step 3: Sync your Upstox trades​

The actions menu on an Upstox account in TradeLyser, with Sync Trades, Sync History and Re-Auth

Open the ⋯ actions menu on your Upstox account card:

ActionWhat it does
Sync TradesFetches today's orders from Upstox. You can choose to skip fees, taxes or slippage, then click Fetch Orders. Large syncs run in the background and you get a notification when they finish.
Sync HistoryFetches older trades for a date range. For Upstox this covers the last 3 financial years. Orders already imported are skipped, so it is safe to run again.
Re-AuthLogs in to Upstox again when the login has expired.

TradeLyser also syncs your Upstox account automatically every Monday to Friday at 10:30 pm IST, as long as your Upstox login is still valid at that time. Run Sync Trades whenever you want today's trades in TradeLyser sooner, for example right after the market closes.

tip

After a sync, click the refresh icon in the TradeLyser header so every dashboard widget picks up the new trades straight away.

Import your Upstox trade history (up to 3 years)​

A journal is only as useful as the data in it. Right after connecting, run Sync History once to bring in your past Upstox trades:

  1. Open the ⋯ actions menu on the Upstox account and choose Sync History.
  2. Pick the date range you want to import, within the last 3 financial years.
  3. Start the sync. It runs in the background, and you can keep using TradeLyser while it finishes.

With your history imported, reports and analytics such as win rate, expectancy and P&L by symbol reflect your real track record instead of the last few days.

Re-authenticate every trading day​

Like most Indian brokers, Upstox expires API logins daily. When that happens, the account card shows Re-auth required. Log in again before 10:30 pm so the nightly sync can run, and before any manual sync:

  1. Open the ⋯ actions menu on the Upstox account.
  2. Choose Re-Auth and sign in to Upstox again.

The account card's Token field shows how long the current login remains valid.

If your Upstox login has expired, TradeLyser reminds you with a bell notification and an email in the morning (around 8:30 am) and a last call around 9 pm, so you can log in before the 10:30 pm sync. Accounts that are still logged out at 10:30 pm are skipped that night. To stop these reminders for an account, choose Turn off login reminders in its ⋯ actions menu.

Prefer not to use the API?​

You can still journal Upstox trades without a developer app. When adding the account, choose File Upload as the import method, then import the trade file you download from Upstox using Import Trade. Upstox files go through TradeLyser's generic parser. If a file is not recognised, use the TradeLyser CSV template instead. See Import trades from CSV for the full walkthrough.

Troubleshooting Upstox connection issues​

ProblemFix
Upstox shows a redirect URI error after loginThe Redirect URI in your Upstox app doesn't exactly match https://app.tradelyser.com/upstox-callback. Edit the app in Upstox Developer Apps, correct it, and connect again.
"Invalid API key" or "Invalid credentials"Copy the API Key and API Secret again from Upstox Developer Apps. Check there are no spaces before or after them.
Account shows Re-auth requiredThe daily Upstox login has expired. Use Re-Auth from the ⋯ menu.
Today's trades are missingRun Sync Trades after the order is executed (or wait for the 10:30 pm nightly sync), then click the header refresh icon.
Older trades are missingRun Sync History for the dates you need (up to 3 financial years).
Wrong P&L matching (FIFO vs LIFO)The calculation method can't be changed. Add a new Upstox account with the method you want.

Still stuck? Follow Troubleshoot broker connection or Trades not syncing, or email support@tradelyser.com.

Frequently asked questions​

Does TradeLyser support Upstox?​

Yes. Upstox is supported for Auto Sync through the official Upstox API, and for File Upload of Upstox trade files.

How far back can I import Upstox trades?​

Sync History imports Upstox trades from the last 3 financial years.

Do I need to log in to Upstox every day?​

Yes. Upstox API logins expire daily, so use Re-Auth to log in again before 10:30 pm so the nightly sync can update your trades, and before any manual sync.

Can I connect more than one Upstox account?​

Yes. Add each Upstox account separately from Accounts → Add Account. The number of accounts you can add depends on your TradeLyser plan. See Add multiple accounts.

Next steps​