Skip to content

Interactive Brokers

Tally Up connects to Interactive Brokers using the Flex Web Service — IBKR’s official mechanism for programmatic access to your activity statements. Setup involves two things in the IBKR website: a Flex Query (a report template) and a Flex Web Service token. Once configured, Tally Up imports trades, dividends, interest, fees, withholding tax, FX transactions, and cash movements automatically.


  • An Interactive Brokers account
  • Access to IBKR Client Portal (the IBKR web interface)
  • Two pieces of information from IBKR: a Flex Token and a Query ID

A Flex Query is a saved report template that tells IBKR which data to include when Tally Up requests your activity statement.

  1. Log in to Interactive Brokers Client Portal and click Log In → Client Portal.
  2. Open the menu (☰) and navigate to Performance & Reports → Flex Queries.
  3. Click Create New Query.
  4. Set the query type to Activity Statement and the output format to XML.
IBKR Flex Queries screen showing the list of saved queries and the Create New Query button
The Flex Queries screen in IBKR Client Portal.

In the query editor, enable all of the following sections:

SectionWhat it imports
TradesBuy and sell transactions
Cash TransactionsDeposits, withdrawals, and cash adjustments
DividendsDividend payments
Withholding TaxTax withheld on dividends and interest
InterestInterest earned
Fees / CommissionsBrokerage fees and commissions
FX TransactionsForeign currency conversions
Corporate ActionsStock splits, mergers, and other corporate events
IBKR Flex Query editor showing the section checkboxes and query type settings
Enable all the recommended sections in the query editor.
  1. Click Save. IBKR generates a Query ID — a short numeric code.
  2. Note down the Query ID. You will paste it into Tally Up shortly.

For further details see the IBKR guide to Activity Flex Queries.


Step 2 — Generate a Flex Web Service Token

Section titled “Step 2 — Generate a Flex Web Service Token”

The Flex Token authorises Tally Up to request your Flex reports on your behalf. It has read-only access and cannot trade or move funds.

  1. In Client Portal, go to Settings → Flex Web Service.
  2. Click Enable Flex Web Service if it is not already on.
  3. Click Generate Token.
  4. Copy the token — it is a long alphanumeric string.

For further details see the IBKR guide to the Flex Web Service.

IBKR Flex Web Service settings page showing the Enable and Generate Token options
The Flex Web Service settings page — enable the service and generate a token.

  1. In Tally Up, open Settings → Bank Connections and tap Add Connection.
  2. Select Interactive Brokers as the provider.
  3. Paste your Flex Token into the token field.
  4. Paste your Query ID into the query ID field.
  5. Tap Test Connection. Tally Up contacts IBKR and confirms the credentials are valid.
  6. If the test succeeds, tap Save Connection.

Once the connection is saved, link each IBKR account to a Tally Up asset:

  1. Open the asset you want to link (or create a new one).
  2. In the asset editor, find the Banking section.
  3. Select your saved Interactive Brokers connection.
  4. Choose the specific IBKR account to link to this asset (Tally Up fetches the list from IBKR).
  5. Save the asset.

If you have multiple IBKR accounts — for example, a cash account and an investment account — set up one asset per account, using the same saved connection for each.


Transaction typeDescription
Trade — buyShare or instrument purchase
Trade — sellShare or instrument sale
Cash depositMoney arriving in your account
Cash withdrawalMoney leaving your account
DividendDividend payment received
InterestInterest earned
FeeCommission or account fee
Withholding taxTax deducted at source
FX conversionCurrency exchange — imported as two linked transactions

Flex tokens expire periodically. When a token expires, syncing stops and the connection status shows an error in Settings → Bank Connections.

To renew:

  1. Log in to IBKR Client Portal and go to Settings → Flex Web Service.
  2. Generate a new token.
  3. In Tally Up, open Settings → Bank Connections, tap your Interactive Brokers connection, and paste the new token.
  4. Tap Test Connection, then Save Connection.

Your Query ID does not change when you regenerate the token.


ProblemResolution
Invalid tokenGenerate a new token in IBKR’s Flex Web Service settings
Invalid Query IDConfirm the Query ID in IBKR’s Flex Queries screen — it is the numeric ID shown next to the query
Report format not supportedEnsure the query type is Activity Statement and the output format is XML
Missing transactionsEdit the Flex Query in IBKR and verify all recommended sections are enabled
No accounts listedThe token may not yet have been activated — wait a few minutes after generating and try again

On first sync, Tally Up imports your full transaction history from IBKR in monthly chunks going back as far as your account holds data. This initial import may take a few moments. Subsequent syncs are incremental, fetching only new activity since the last successful sync.


The saved connection record syncs to all your devices via iCloud, but the Flex Token is stored in the Keychain on each device separately.

On the second device:

  1. Open Settings → Bank Connections.
  2. Tap your Interactive Brokers connection (shown as Credentials required on this device).
  3. Paste your Flex Token and Query ID, then tap Save Connection.

It is recommended to enable background sync on your main device only. On secondary devices, leave Enable Background Refresh off in Settings → Bank Connections.