Checking your session…

This page connects a brokerage to your BasisTrail account, so it needs you signed in first.

Connect Interactive Brokers

Three steps, about five minutes, read-only throughout. Keep this tab open next to Interactive Brokers.

  1. 1Create the report
  2. 2Get your token
  3. 3Pair your phone

Tell IBKR what to report

In Interactive Brokers open Performance & Reports, then Flex Queries. Create an Activity Flex Query, or edit the one already connected to BasisTrail.

Open Client Portal in a new tab

Report sections

Inside each section choose all available fields. BasisTrail ignores fields it does not need, but missing base-currency, cost-basis or fee fields produce incomplete totals.

General configuration

The period controls transaction history. Open Positions still supplies current value and cost basis, but activity older than the selected period cannot appear in realized P&L or the transaction list.

Create a read-only token

Same place as step 1: open Performance & Reports, then Flex Queries. Look for a small gear or settings icon labelled Flex Web Service Configuration near the top of that page (on some accounts it is a link, not an icon).

If you cannot see it there, use the menu in the top-left corner instead: ReportingFlex QueriesFlex Web Service Configuration. It is not under Settings or Account Settings.

Click it, switch the toggle on, then click Generate A New Token.

Pick the longest expiry offered. When a token expires the sync simply stops returning data, so a year of quiet beats a month of it. Copy the token immediately: IBKR shows it once and will not display it again.

I keep trades in a separate query

Type this into the app

On your phone open Settings, then Interactive Brokers, and put this in Setup code.

Your token is not stored on our servers. It was encrypted in this browser. The key that opens it exists only inside the code above, which works once and then expires.
Something went wrong

Invalid token. It expired, or Flex Web Service got switched off again. Generate a new one and redo step 2.

The report is empty. Reopen the Activity query and confirm the report sections, XML format and longest available period from step 1.

Numbers look incomplete. Make sure every report section includes all available fields, then save and refresh BasisTrail.

I edited an existing query. Keep the same token and Query ID. If you created a replacement query instead, reconnect BasisTrail with the new Query ID.

Still stuck? Email hello@basistrail.app with the Query ID. Never send the token.