api.sankhya.com.br), so you can analyze your financial titles, invoices, products, stock and costs together with the rest of your data.
The connector only reads data. It never creates, changes or deletes anything in Sankhya.
Before you start
The connector uses Sankhya’s official integration model: an integration registered in the Sankhya Portal do Desenvolvedor (Developer Area) plus a token generated in your Sankhya Om. You will need:- A Sankhya Om version that has the Configurações Gateway screen. Sankhya generates integration tokens on this screen from Sankhya Om version 4.16 onwards (Sankhya FAQ).
- Access to the Sankhya Portal do Desenvolvedor (areadev.sankhya.com.br) with a user that can create solutions. If no one in your company has access yet, the manager of your company’s Sankhya ID account grants it at account.sankhya.com.br (how to get access). Sankhya customers building an integration for their own use do not need to join the “Sankhya Developer” partner program.
- Access to the Database Explorer. The connector reads your tables with Sankhya’s Database Explorer service (
DbExplorerSP.executeQuery). The Sankhya Om user behind the integration needs access to the DbExplorer screen; without it, the sync fails with the messageO uso do executeQuery requer acesso a tela DbExplorer. Sankhya lets you restrict which screens and services an integration can use (Camada de autorização para API), so ask your Sankhya administrator to allow it.
Nekt only talks to the Sankhya API Gateway, never directly to your Sankhya Om server, so you do not need to open your firewall to Nekt. If your Sankhya Om runs on your own servers (on premise), it must already be reachable by the Sankhya Gateway, as Sankhya requires for any integration. See Gerando Tokens de Integração no SankhyaOm for the Gateway addresses to allow.
Getting your Sankhya credentials
The connector needs three values: a Client ID and a Client Secret, created in the Portal do Desenvolvedor, and a Gateway Token (X-Token), generated in your Sankhya Om. These steps follow Sankhya’s official documentation: Portal do Desenvolvedor Sankhya, Novo Fluxo de Autenticação com OAuth 2.0 and Autenticação com OAuth 2.0 (Client Credentials).1
Create a solution in the Portal do Desenvolvedor
Sign in to the Portal do Desenvolvedor, open Minhas soluções and click Criar solução. Give it a name you will recognize (for example, “Nekt”) and a short description. When asked whether the solution will be offered to other customers in the Marketplace, choose Não, é para uso exclusivo da minha empresa. Select the groups that can manage the solution and click Criar nova solução.
2
Add an integration component and copy the Client ID and Client Secret
In the solution details, click Adicionar componente and create a component of the integration type (componente de integração). Sankhya generates a
client_id and a client_secret for each new integration component, for the production and sandbox (homologação) environments. Copy the production Client ID and Client Secret: these are the Client ID and Client Secret fields in Nekt.3
Generate the Gateway Token in Sankhya Om
In your Sankhya Om, open the Configurações Gateway screen and generate the token for the solution you created. Sankhya shows this step in a video in Gerando Tokens de Integração no SankhyaOm. This token is the Gateway Token (X-Token) field in Nekt: it tells the Sankhya Gateway which Sankhya Om environment to read.
Configuring Sankhya as a Source
In the Sources tab, click on the “Add source” button located on the top right of your screen. Then, select the Sankhya 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:- Client ID: The Client ID of your integration component in the Sankhya Portal do Desenvolvedor.
- Client Secret: The Client Secret of the same integration component.
- Gateway Token (X-Token): The token generated on the Configurações Gateway screen of your Sankhya Om.
- Base URL: The address of the Sankhya API Gateway. Leave it empty to use
https://api.sankhya.com.br. This is not the address of your Sankhya Om system: entering your own server’s address makes the login fail. To test against Sankhya’s sandbox, enterhttps://api.sandbox.sankhya.com.brand use the sandbox Client ID and Client Secret. - Initial sync date (recommended): Earliest date to read, in the format
YYYY-MM-DD(for example2024-01-01) orDD/MM/YYYY(for example01/01/2024). On the first sync, thefinanceiros,notas,itens_notaandmovimentos_bancariostables only read rows created or changed since this date; later syncs only read what changed since the previous one. It is also the first due date read byagenda_financeira. These tables can hold millions of rows, so setting a date (for example, the start of the period you want to analyze) makes the first sync much faster. Leave it empty to read their whole history. - End Date: Optional. Latest date to read, in the same formats. It filters
financeirosandnotasby negotiation date (dtneg) andmovimentos_bancariosby posting date (dtlanc), on every sync. Leave it empty for a source that keeps your data up to date: rows dated after it are never read.
2. Select streams
Choose which data streams you want to sync. For faster extractions, select only the streams that are relevant to your analysis. The available streams are listed in Available streams below.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 and changed rows. We recommend it for
financeiros,notas,itens_nota,movimentos_bancarios,parceirosandprodutos. - Full table: every time the extraction happens, we’ll get the current state of the data. All the other streams are always full table.
- Incremental: every time the extraction happens, we’ll get only the new and changed rows. We recommend it for
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). 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. Rows deleted in Sankhya stay in the incremental tables until a full sync, so if deletions matter to your analysis, schedule a periodic full sync (for example, weekly).
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
Available streams
The tables below list every stream, its slug (the exact identifier to pass when creating the source via API), the Sankhya table it reads, its primary key and how it is synced.Finance
Sales and purchase documents
Companies and partners
Products, stock and costs
Cities, states, countries and currencies
Production
These tables exist only when your company uses the Sankhya production module. If they do not exist in your Sankhya, the streams are skipped with a warning in the run log and the other streams keep syncing.Fields
Every Sankhya installation has its own columns, so the connector does not use a fixed list of fields. When it discovers the streams, it reads every column of each table in your Sankhya, including your company’s custom fields (theAD_* fields), and creates a column for each one:
- Column names are the Sankhya field names in lowercase, for example
nufin,codparc,vlrdesdoborad_meucampo. - Each column’s description is the field label from your Sankhya data dictionary, so you can recognize the field as it appears on Sankhya’s screens.
- Binary columns, such as images and attached files, are not synced.
vlrliquido(net amount) infinanceirosis a calculated field of the Sankhya data dictionary, not a stored column: the connector calculates it with its Sankhya formula.impostos_financeirosalso hasimposto_nomeimp(tax name),receitadarf_descrreceita(DARF revenue description),cadastronaturezarendimentos_descnatrend(income nature description) andimposto_calcbasemensal, read from the related Sankhya tax tables.
Implementation notes
How incremental streams sync
financeiros,notas,itens_nota,movimentos_bancarios,parceirosandprodutosare synced by their last change date in Sankhya (dtalter).- On the first sync,
financeiros,notas,itens_notaandmovimentos_bancariosread the rows changed since the Initial sync date (or the whole table when it is empty).parceirosandprodutosalways read the whole table on the first sync, because documents of any date refer to them. - Later syncs read only the rows changed since the previous sync, plus the 10 minutes before it, so changes saved while a sync was running are not missed.
- A financial title’s change date is also updated when it is settled, so settlements reach
financeiroson the next sync. - Rows deleted in Sankhya are not detected by incremental syncs. They stay in your tables until the next full sync.
- Full table streams read the whole table on every sync, so deletions are reflected right away.
Dates and times
Sankhya stores dates and times in the local time of your Sankhya server, without a time zone. Nekt does not convert them: read date and time columns (such asdtalter or dhbaixa) as your Sankhya server’s local time.
Custom fields and missing tables
- Some streams include a few custom fields that exist only in some Sankhya installations (for example
ad_dtdecompetenciainfinanceiros). If a field does not exist in your Sankhya, its column stays empty and the run log lists it; the rest of the stream syncs normally. - A stream whose table does not exist in your Sankhya (usually because the module is not in use, as with the production tables) is skipped with a warning, and its table is not updated.
Performance
- The Sankhya Database Explorer returns at most 5,000 rows per request, and fewer for tables with many columns (such as
notas). The first sync of large tables, with years of financial titles or invoices, can take a while. Setting the Initial sync date shortens it. - End Date does not filter
itens_nota: when you set it,itens_notacan include items of documents that are not innotas.