XP Data Access is a restricted partner API. Access is granted by XP only to offices that have completed XP’s onboarding and Security Assessment. Nekt cannot provision test access on your behalf, so you configure this source with the credentials and certificate that XP issued to your office.
Prerequisites
Before configuring the source, your office needs the following from XP. They are all obtained through the XP developer portal and Security Assessment:- Client ID and Client Secret — OAuth2 credentials generated in the developer portal (Gestão → Credenciais). The client secret is shown only once.
- Subscription Key — sent by XP by email after the Security Assessment is approved (the
Ocp-Apim-Subscription-Keyvalue). - Digital certificate — a client-authentication certificate (mTLS) issued with your office’s data. It must have the Client Authentication extended key usage (
1.3.6.1.5.5.7.3.2) and OCSP enabled, and it must not include the TLS Web Server Authentication usage. ICP-Brasil certificates are accepted. - IP allow-listing — XP releases access by IP range. The IPs that reach the API are registered in the Security Assessment ticket.
Configuring XP as a Source
In the Sources tab, click on the “Add source” button located on the top right of your screen. Then, select the XP option from the list of connectors. Click Next and you’ll be prompted to add your access.1. Add account access
Provide the credentials and certificate that XP issued to your office:- Environment: The XP Data Access environment to connect to. Choose
homologationto validate the integration first, orproductionfor live data. Each environment has its own credentials, certificate, and scope. - Client ID: The OAuth2 client ID from the developer portal.
- Client Secret: The OAuth2 client secret from the developer portal.
- Subscription Key: The
Ocp-Apim-Subscription-Keyvalue sent by XP. - Client Certificate (PEM): The mTLS client certificate, in PEM format. If this value also contains the private key, leave the private key field empty.
- Private Key (PEM): The private key matching the certificate, in PEM format. Leave empty if the certificate already includes the key.
- Private Key Passphrase: The passphrase to decrypt the private key, if it is encrypted.
- Partner Name: An identifier for your office, used in the request
User-Agent. - Start Date: The earliest record date to sync for incremental streams.
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.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: you can choose between INCREMENTAL and FULL_TABLE.
- Incremental: every time the extraction happens, we’ll get only the new data - which is good if, for example, you want to keep every record ever fetched.
- Full table: every time the extraction happens, we’ll get the current state of the data - which is good if, for example, you don’t want to have deleted data in your catalog.
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. This decision usually depends on how frequently you need the new table data updated (every day, once a week, or only at specific times).XP Data Access publishes data with a one-day delay (D-1) and updates only on business days, following the B3 banking calendar. A daily trigger is usually enough.
- 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. This will complement the incremental data extractions, ensuring that your data is completely synchronized with your source every once in a while.
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.Streams and Fields
Below you’ll find all available data streams from XP and their corresponding fields. Most streams sync incrementally: dimensions bylastUpdate, fact tables by dimTimeCode (a YYYYMMDD time key), and Positivador by positionDate.
Account (Conta)
Account (Conta)
Account dimension. Tracks account versions over time (SCD Type 2) with validity windows;
currentRegisterIndicator marks the active row.Key Fields:id- Unique record identifierdimAccountCode- Surrogate key for the account versionaccountCode- Stable business key of the accountcpfCnpjCodeGuid- Anonymized CPF/CNPJ identifierpersonType- Person type (F for individual, J for company)dscSuitability- Suitability profile descriptionstartValidityDate/endValidityDate- Validity window of this versioncurrentRegisterIndicator- 1 for the current row, 0 otherwiselastUpdate- Last update timestamp (replication key)
Office Channel (Canal do Escritório)
Office Channel (Canal do Escritório)
Office channel dimension (SCD Type 2), describing the office and its hierarchy.Key Fields:
id- Unique record identifierdimOfficeChannelCode- Office channel surrogate keyofficeCode/officeName/officeFantasyName- Office identificationcity/state/neighborhood- LocationmasterAdvisorCode- Master advisor codeheadOfficeCode/headOfficeName- Head officevalidityStartDate/validityEndDate- Validity windowcurrentRegister- 1 for the current row, 0 otherwiselastUpdate- Last update timestamp (replication key)
Product (Produto)
Product (Produto)
Product dimension (SCD Type 2) with classification, issuer, and yield attributes.Key Fields:
id- Unique record identifierdimProductCode- Product surrogate keyassetCode/assetName- Asset identificationproductClassficationL0toproductClassficationL5- Classification levels (key spelling matches the API)isinCode/cnpjCode/cetselCode- External identifiersissuerName/managerName/strategy- Issuer and managementproductType- Product type (DB, LCI, LCA, LC, LF, LIG, and others)yield/index/dealType- Yield attributeslastUpdate- Last update timestamp (replication key)
Movement Type (Tipo de Movimentação)
Movement Type (Tipo de Movimentação)
Movement type dimension.Key Fields:
id- Unique record identifierdimMovementTypeCode- Movement type surrogate keymovementTypeCode- Movement type codemovementTypeDescription- Movement type descriptionlastUpdate- Last update timestamp (replication key)
Financial Institution (Instituição Financeira)
Financial Institution (Instituição Financeira)
Financial institution dimension.Key Fields:
id- Unique record identifierdimFinancialInstitutionCode- Financial institution surrogate keyfinancialInstitutionCode/financialInstitutionName- Institution identificationcategoryName- CategorylastUpdate- Last update timestamp (replication key)
Time (Tempo)
Time (Tempo)
Calendar dimension (loaded full). Provides date attributes and business/trading-day flags following the B3 calendar.Key Fields:
id- Unique record identifierdimTimeCode- Time key (YYYYMMDD)date- Calendar dateyearNumber/monthNumber/dayNumber- Date partsquarterNumber/weekOfTheYearNumber- Period attributesbusinessDay/tradingDay- 1 if it is a business/trading day, 0 otherwisenextTradingDate- Next trading date
Media (Midia)
Media (Midia)
Media dimension.
additionalFields carries technical metadata as a JSON string.Key Fields:id- Unique record identifiercodConta- Account codemarca- Branddevice- DevicebaseUrl- Base URLadditionalFields- Additional technical metadata (JSON string)lastUpdate- Last update timestamp (replication key)
Account-Advisor Relation (Relação Conta-Assessor)
Account-Advisor Relation (Relação Conta-Assessor)
Fact table relating accounts to advisors over time.Key Fields:
id- Unique record identifierdimAccountCode/accountCode- Account referencesdimAdvisorCode/advisorCode- Advisor referencesdimOfficeChannelCode- Office channel referencedate- Relation reference datedimTimeCode- Time key (YYYYMMDD, replication key)lastUpdate- Last update timestamp
Inflow (Captação)
Inflow (Captação)
Fact table of inflows and movements.Key Fields:
id- Unique record identifiermovementCode- Movement codemovementNatureCode- Movement naturemovementAmount/movementValue- Quantity and valuedimAccountCode/dimProductCode/dimAdvisorCode- Dimension referencesdimFinancialInstitutionalCode- Financial institution referencedimMovementTypeCode- Movement type referencedimTimeCode- Time key (YYYYMMDD, replication key)lastUpdate- Last update timestamp
Custody (Custódia / AUC)
Custody (Custódia / AUC)
Fact table of daily assets under custody by account and product.Key Fields:
id- Unique record identifierdimAccountCode/dimProductCode- Account and product referencesdimOfficeChannelCode/dimAdvisorCode- Office and advisor referencespositionAmount- Position quantitypositionValue- Position value (assets under custody)termDueDate- Term due datedimTimeCode- Time key (YYYYMMDD, replication key)lastUpdate- Last update timestamp
Active Customer (Cliente Ativo)
Active Customer (Cliente Ativo)
Fact table of active customers per day.Key Fields:
id- Unique record identifierdimAccountCode- Account referenceaccountQuantity- Number of accountsdimOfficeChannelCode/dimAdvisorCode- Office and advisor referencesoperatedStockExchange- Whether the client traded equities in the last 30 daysdimTimeCode- Time key (YYYYMMDD, replication key)lastUpdate- Last update timestamp
Positivador
Positivador
Analytical stream combining client attributes with monthly revenue, capture, and net-position metrics.Key Fields:
id- Unique record identifieraccountCode/advisorCode/headOfficeCode- Identificationsegment/segmentClient/dscSuitability- Client profilestatus/activatedInM/churnedInM- LifecyclefinancialApplications/revenueInMonth- Balances and revenuegrossCaptureInMonth/redemptionInMonth/netCaptureInMonth- Capture metricsnetInMonthand relatednet*fields - Net positions by product classpositionDate- Position date (replication key)
Reprocessing Log (Log de Reprocessamento)
Reprocessing Log (Log de Reprocessamento)
Control stream (full snapshot). Reports, per resource, the reference date and the processing window. Use
maximumProcessingDate to know how current each resource is.Key Fields:tableName- Name of the reprocessed resourcereferenceDate- Reference date of the datatypeProcessing- Processing type (FULL or INCREMENTAL)minimumProcessingDate/maximumProcessingDate- Processing window