The connector only reads data. It never creates, changes or pays anything in BTG.
This is the BTG Empresas connector (your company’s bank account). It is not the BTG Parceiros connector, which reads BTG’s partner reports.
Before you start
BTG only gives access to account and card data through an app that your company creates in BTG’s Developer Area, authorized by a person of your company. Nekt cannot create this app for you. You need:- A BTG Empresas account with the Advanced plan: BTG requires it for apps that read real data (production apps).
- A user registered as developer by the account holder, to create the app in the Developer Area.
- A user with the Operator profile (or higher) in the company’s account, to authorize the app. An authorization made by a user with only the developer profile does not read account data.
1. Create a production app in BTG
In BTG’s Developer Area, click Criar Aplicativos with the environment toggle (top right) set to Produção, and fill in:- Nome: any name, for example “Nekt”.
- Tipo: Confidencial (only confidential apps can read banking data).
- Modelo de integração: First-party (the app reads your own company’s account).
- URL de redirecionamento: an address you control. After the authorization, BTG sends the browser there with a code in the address bar, so it can be any page of your company’s site that you can open.
- Escopos:
openid, the read-only credit card scope and the read-only account scope (balance and statement). BTG’s login service publishes them asbrn:btg:empresas:banking:credit-cards.readonlyandempresas.btgpactual.com/accounts.readonly, but BTG’s pages use other names too, so always copy the exact scope names your app shows in the Developer Area and use those in the next step.
2. Authorize the app and get the refresh token
-
In a browser, open the address below, replacing
CLIENT_IDandREDIRECT_URIwith your app’s values (the redirect address must be exactly the one registered in the app) and, if your app shows different scope names, the scopes afterscope=with your app’s (separated by%20): - Log in with a user that has the Operator profile (or higher), select your company on the consent screen and confirm.
-
BTG opens your redirect address with
?code=...at the end. Copy the value ofcodeand, within a few minutes, exchange it for tokens: -
From the answer, copy the value of
refresh_token. You will paste it in Nekt. Keep it, like the client secret, as a password.
Configuring BTG Empresas as a Source
In the Sources tab, click on the “Add source” button located on the top right of your screen. Then, select the BTG Empresas option from the list of connectors. Click Next and you’ll be prompted to add your access.1. Add account access
The following configurations are available:- Company CNPJ: the CNPJ of the company you selected when authorizing the app, with or without punctuation.
- Client ID: the Client ID of your BTG app.
- Client Secret: the Client Secret of your BTG app. If you generate a new secret in BTG, update it here.
- Refresh Token: the refresh token from the authorization above.
-
Start Date: the first day to read. Statements are read from this day on, and invoices whose cycle closes on or after it are read with all their transactions. For example,
2026-01-01. - Statement Type (advanced, optional): (Default: Simple) which statement BTG lists for your checking accounts: Simple (money in and out, without investment yields), With yields, or With yields, investments and redemptions.
- Statement Lookback Days (advanced, optional): (Default: 30) each run reads the statements again from this many days before the last day already read, to catch entries BTG posts late with an earlier date, for example after a long holiday. From 0 to 90.
2. Select streams
Choose which data streams you want to sync. For faster extractions, select only the streams that are relevant to your analysis. You can select entire groups of streams or pick specific ones.Tip: The stream can be found more easily by typing its name.Cards, Invoices and Invoice Transactions need the credit card scope. Accounts, Account Balances and Account Statements need the account scope. If your app only has one of them, select only the streams of that scope. Select the streams and click Next.
3. Configure data streams
Customize how you want your data to appear in your catalog. Select the desired layer where the data will be placed, a folder to organize it inside the layer, a name for each table (which will effectively contain the fetched data) and the type of sync.- Layer: choose between the existing layers on your catalog. This is where you will find your new extracted tables as the extraction runs successfully.
- Folder: a folder can be created inside the selected layer to group all tables being created from this new data source.
- Table name: we suggest a name, but feel free to customize it. You have the option to add a prefix to all tables at once and make this process faster!
- Sync Type: Invoices, Invoice Transactions, Account Balances and Account Statements are INCREMENTAL, which is the recommended type for them. Cards and Accounts are FULL_TABLE: they are read in full on every run, so their tables always show the current state. Read more about Sync Types here.
4. Configure data source
Describe your data source for easy identification within your organization, not exceeding 140 characters. To define your Trigger, consider how often you want data to be extracted from this source. Once a day is enough for most uses, and it keeps the refresh token alive. Several runs per day are fine if you want card spending sooner: each run reads the open invoice again. Optionally, you can define some additional settings:- Configure Delta Log Retention and determine for how long we should store old states of this table as it gets updated. Read more about this resource here.
- Determine when to execute an Additional Full Sync. A full sync reads every invoice since the Start Date with all its transactions and every statement entry since the Start Date again. Avoid it on Account Balances (see above).
5. Check your new source
You can view your new source on the Sources page. If needed, manually trigger the source extraction by clicking on the arrow button. Once executed, your data will appear in your Catalog.Each run first checks, with one request per scope, that the authorization can read what the selected streams need. If a scope is missing, the run stops before writing anything and the log names the streams and the scope. If BTG keeps failing or returns an inconsistent list while a stream is being read, the run stops before writing that stream, so its table is never replaced or updated with a partial read.
Card transactions before the invoice closes
BTG lists the open invoice of the credit card (the current one) together with the closed ones, and returns its transactions in the same way, so purchases appear in Invoice Transactions before the invoice closes, on the next run after BTG registers them. The columnis_posted tells whether BTG already posted the transaction on the invoice.
Transactions of an invoice can still change after it closes (refunds, installments, adjustments, credits posted up to the due date), so every invoice that is not final is read again on every run: the open one, future ones that already hold installments, and closed ones until 15 days after their due date. Older invoices are read once more after that and then kept as they are.
A purchase that BTG removes from an invoice that is still being read (for example, a cancelled authorization, or one BTG posts again under a new identifier) stays in the table with is_removed = true and every other column empty, so it does not count twice. Its original values (merchant, amount, date) remain only in the history of your table in the destination, for example the table’s previous versions in the Catalog. To avoid false removals, a purchase is marked as removed only when two reads of the invoice in the same run both miss it, and an invoice that suddenly comes back empty while it still shows a total or charges is never taken as removals: the run warns you and reads it again next time. An invoice with no total and no charges left (for example, the only installment of a future invoice was cancelled) has its purchases marked as removed once both reads come back empty. To see only what BTG lists now, filter the removed rows out:
Troubleshooting
Streams and Fields
Available streams
The table below lists every stream, its slug (the exact identifier to pass when creating the source via API) and a short description.
Timestamps are in UTC (BTG sends Brasília time, which the connector converts). Dates such as due dates and statement days are kept as BTG gives them. Amounts are decimals. Lists of objects (invoice summary, all amounts and taxes of a transaction) are JSON text. BTG never returns full card numbers: only the last four digits.
The connector was built from BTG’s public API documentation. BTG does not document every value in detail (for example all invoice status values, or the meaning of each amount type of an international purchase); the first runs confirm them.
Fields by stream
Cards
Cards
Every corporate card of the company, as BTG lists it now.Table:
cards · Primary key: card_id · Sync: Full tableInvoices
Invoices
Every credit card invoice whose cycle closes on or after the Start Date: the open (current) one, the closed ones and future ones that already hold installments, with totals, due dates, payment data and status. Every invoice is updated on every run.Table:
invoices · Primary key: invoice_id · Sync: Incremental (synced_at), every invoice in scope updated on every runInvoice Transactions
Invoice Transactions
The transactions of each invoice, including the invoice that is still open: purchases, installments, refunds and charges, with merchant, amounts, currency, IOF and the card used. Invoices that are not final are read again on every run; a transaction BTG no longer lists comes back with is_removed = true.Table:
invoice_transactions · Primary key: invoice_id, id · Sync: Incremental (synced_at), invoices that are not final read again on every runAccounts
Accounts
The company’s BTG checking accounts that the authorization reaches.Table:
accounts · Primary key: account_id · Sync: Full tableAccount Balances
Account Balances
One balance snapshot per account per day (Brasília time); the last run of the day wins.Table:
account_balances · Primary key: account_id, snapshot_date · Sync: Incremental (synced_at), one row per account per dayAccount Statements
Account Statements
Every statement entry (money in and out) of each checking account, with description and category.Table:
account_statements · Primary key: account_id, id · Sync: Incremental (movement_date), one bookmark per account