> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nekt.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Applix as a data source

> Bring accounts receivable and payable, boletos, contracts, orders, invoices and registries from the Applix ERP to Nekt.

Applix is a cloud ERP (by Connectuse) with sales, finance and contracts modules. The Nekt connector reads its API v3 and brings to your Catalog the financial data (accounts receivable and payable, boletos, cash and bank balances), contracts with their installments, sales orders, quotes and invoices, and the main registries (customers, products, stock, price lists, salespeople and others).

## Before you start

You need **API credentials from Applix**: a **Client ID** and a **Client Secret**. Ask Applix support to enable API access for your company; the credentials give access to the modules your Applix plan includes (Sales, Finance, Contracts).

## Configuring Applix as a Source

In the [Sources](https://app.nekt.ai/sources) tab, click on the "Add source" button located on the top right of your screen. Then, select the Applix 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 Applix API credentials.
* **Client Secret**: The Client Secret of your Applix API credentials.
* **Start Date**: Documents dated from this day on are synced: orders, quotes and invoices by their date, accounts receivable and payable by their **due date**, and cash and bank balances by month. Contracts and registries (customers, products and others) are always read in full.
* **Invoice series** (advanced, default `1`): the invoice (nota fiscal) series to sync, separated by commas, for example `1` or `1,2,900`. Applix lists invoices one series at a time, so include every series your company uses.

Once you're done, click **Next**.

### 2. Select streams

Choose which data streams you want to sync. For faster extractions, select only the streams that are relevant to your analysis.

> 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 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.

Most Applix streams are full table: Applix has no "changed since" filter, so every extraction reads the whole period again and always shows the current status of each account, boleto, order and contract (see [how changes are captured](#how-changes-are-captured)). Only the detail streams (orders, quotes and invoices details) are incremental.

Once you are done configuring, click **Next**.

### 4. Configure data source

Describe your data source for easy identification within your organization, not exceeding 140 characters.

To define your [Trigger](https://docs.nekt.com/runs/scheduling-and-triggers.md), 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](https://docs.nekt.com/get-started/core-concepts/resource-control).
* Determine when to execute an **Additional [Full Sync](https://docs.nekt.com/get-started/core-concepts/types-of-sync#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. Only the detail streams are incremental, so it is rarely needed for this connector.

Once you are ready, click **Next** to finalize the setup.

### 5. Check your new source

You can view your new source on the [Sources](https://app.nekt.ai/sources) page. If needed, manually trigger the source extraction by clicking on the arrow button. Once executed, your data will appear in your Catalog.

> [!WARNING]
>
> For you to be able to see it on your [Catalog](https://app.nekt.ai/catalog), you need at least one successful source run.

# 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.

| Stream | Slug | Description |
| - | - | - |
| Accounts Receivable and Payable | `contas_receber_pagar` | One row per account (or per cost-centre/project split of an account): receivables, payables and contract installments not invoiced yet. |
| Boletos | `boletos` | One row per boleto of every customer, in every status. |
| Cash and Bank Balances | `saldos_caixa_banco` | One row per cash/bank account and month: the balance at the end of the month. |
| Receivables (Sales) | `contas_receber` | One row per receivable as the sales module shows it, with the linked invoices and orders. |
| Contracts | `contratos` | One row per contract renewal (numero + renovacao). |
| Contract Details | `contratos_detalhes` | One row per contract renewal with its items, installments (with collection and receivables) and finance setup. |
| Sales Orders | `pedidos` | One row per sales order. |
| Sales Order Details | `pedidos_detalhes` | One row per sales order with its items. |
| Quotes | `orcamentos` | One row per quote. |
| Quote Details | `orcamentos_detalhes` | One row per quote with its items. *Not selected by default* (see [Data Quality Considerations](#data-quality-considerations)). |
| Invoices | `notas_fiscais` | One row per invoice (nota fiscal) of the configured series. |
| Invoice Details | `notas_fiscais_detalhes` | One row per invoice with taxes, items and linked orders. |
| Customers | `clientes` | One row per customer. |
| Products | `produtos` | One row per product. |
| Stock Balance | `saldo_estoque` | One row per product with its stock by storage location and lot. |
| Price Lists | `tabela_precos` | One row per price list with its versions and product prices. |
| Product Categories | `categorias_produto` | One row per product category. |
| Payment Terms | `condicoes_pagamento` | One row per payment term. |
| Collection Methods | `formas_cobranca` | One row per collection method. |
| Customer Groups | `grupos_cliente` | One row per customer group. |
| Services | `servicos` | One row per service. |
| Scrap Balances | `sucatas_receber` | One row per scrap balance document (scrap to receive or to pay). |
| Salespeople | `vendedores` | One row per salesperson. |

Nested lists (order items, contract installments, contacts, custom fields) are stored as JSON text, for example `json_extract_scalar(produto, '$[0].codigo')`. Small objects such as addresses are split into their own columns (`endereco_rua`, `endereco_cidade`). Fields Applix returns that are not in its documentation are kept in `additional_fields` (JSON), so no data is lost.

## Fields by stream

> [accordion] Accounts Receivable and Payable
>
> Stream name: `contas_receber_pagar`. One row per account (or per cost-centre/project split of an account): receivables, payables and contract installments not invoiced yet.
>
> **Sync Strategy:**
>
> * Full table
> * Primary key(s): `row_key`
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `row_key` | String | Hash of the fields that identify the row in Applix; primary key of the table. |
> | `id` | Integer | Internal id of the account in Applix. |
> | `tipoconta` | String | Kind of account: RECEBER (receivable), PAGAR (payable) or CONTRATO (contract installment not invoiced yet). |
> | `tipomov` | String | Movement type (C = credit, D = debit). |
> | `nossonumero` | String | Bank 'nosso número' of the boleto, when there is one. |
> | `empresa` | String | Company of the account. |
> | `situacaoconta` | String | Status of the account (ABERTA, LIQUIDADA or CANCELADA). |
> | `dtreferencia` | Date | Reference (competence) date of the account. |
> | `dtvencimento` | Date | Due date of the account; the date the windows of this stream filter on. |
> | `dtpagtoconta` | Date | Payment date of the account. |
> | `dtprevistapagto` | Date | Expected payment date. |
> | `dtemissaonotafiscal` | Date | Issue date of the linked invoice. |
> | `dtliquidacaoconta` | Date | Settlement date of the account. |
> | `pessoa` | String | Name of the customer or supplier. |
> | `fantasia` | String | Trade name of the customer or supplier. |
> | `tipopessoa` | String | Type of person (FISICA or JURIDICA). |
> | `documentopessoa` | String | CNPJ or CPF of the customer or supplier. |
> | `email` | String | Email of the customer or supplier. |
> | `logradouro` | String | Address: street. |
> | `numero` | String | Address: street number. |
> | `telefone` | String | Phone of the customer or supplier. |
> | `cidade` | String | Address: city. |
> | `bairro` | String | Address: neighbourhood. |
> | `nrcep` | String | Address: postal code (CEP). |
> | `estado` | String | Address: state (UF). |
> | `situacaocred` | String | Credit status of the customer or supplier. |
> | `anotacaopessoa` | String | Notes on the customer or supplier. |
> | `grupo` | String | Customer group. |
> | `segmento` | String | Market segment. |
> | `regiao` | String | Region. |
> | `origem` | String | Origin. |
> | `porte` | String | Size. |
> | `vltaxacartao` | Number | Card fee amount. |
> | `vlconta` | Number | Amount of the account. |
> | `vldescontototal` | Number | Total discount amount. |
> | `vlacrescimototal` | Number | Total surcharge (interest/fine) amount. |
> | `vlquitado` | Number | Amount already settled. |
> | `vlatualizado` | Number | Updated amount (with surcharges and discounts). |
> | `vlpagtoconta` | Number | Amount paid. |
> | `idmovimentocaixa` | Integer | Id of the cash movement that settled the account. |
> | `ccrealpagamento` | String | Cash/bank account where the payment was made. |
> | `tipodoctopagamento` | String | Type of the payment document. |
> | `nrdoctopagamento` | String | Number of the payment document. |
> | `aorateio` | Integer | Whether the account is split across cost centres/projects (rateio). |
> | `tipodocumento` | String | Document type of the account. |
> | `formacobranca` | String | Collection method. |
> | `nomedocumento` | String | Name of the document. |
> | `nrdocumento` | String | Document number. |
> | `anotacoesconta` | String | Notes on the account. |
> | `anotacoesrateio` | String | Notes on the split (rateio). |
> | `divisao` | String | Division of the account (or of this split). |
> | `contagerencial` | String | Management account (chart of accounts) of the account or split. |
> | `contagerencialnivel1` | String | Management account, level 1. |
> | `contagerencialnivel2` | String | Management account, level 2. |
> | `contagerencialnivel3` | String | Management account, level 3. |
> | `contagerencialnivel4` | String | Management account, level 4. |
> | `projeto` | String | Project of the account or split. |
> | `situacaoprojeto` | String | Status of the project. |
> | `projetonivel1` | String | Project, level 1. |
> | `projetonivel2` | String | Project, level 2. |
> | `projetonivel3` | String | Project, level 3. |
> | `projetonivel4` | String | Project, level 4. |
> | `projetogerencial` | String | Management project. |
> | `situacaoprojetogerencial` | String | Status of the management project. |
> | `projetogerencialnivel1` | String | Management project, level 1. |
> | `projetogerencialnivel2` | String | Management project, level 2. |
> | `projetogerencialnivel3` | String | Management project, level 3. |
> | `projetogerencialnivel4` | String | Management project, level 4. |
> | `vendedor` | String | Salesperson. |
> | `agentevendedor` | String | Sales agent. |
> | `ocorrencia` | String | Bank occurrence. |
> | `docreferencia` | String | Reference document. |
> | `aoalocada` | String | Allocation flag of the account. |
> | `tipocustoconta` | String | Cost type of the account. |
> | `caixabanco` | String | Cash or bank account. |
> | `vlbrutonotafiscal` | Number | Gross amount of the linked invoice. |
> | `ctcontabil` | String | Accounting account. |
> | `nnf` | String | Number of the linked invoice. |
> | `valoriss` | Number | ISS tax withheld. |
> | `valorpis` | Number | PIS tax withheld. |
> | `valorcofins` | Number | COFINS tax withheld. |
> | `valorcsll` | Number | CSLL tax withheld. |
> | `valorirrf` | Number | IRRF tax withheld. |
> | `valorinss` | Number | INSS withheld. |
> | `valordeducao` | Number | Deduction amount. |
> | `valoroutrasretencoes` | Number | Other withholdings. |
> | `additional_fields` | String | Fields returned by Applix that are not in its API documentation (JSON object), kept so no data is lost. |

> [accordion] Boletos
>
> Stream name: `boletos`. One row per boleto of every customer, in every status.
>
> **Sync Strategy:**
>
> * Full table
> * Primary key(s): `id`
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `id` | String | Internal id of the boleto (also used by Applix to serve its PDF). |
> | `tipo` | String | Type of account (RECEBER). |
> | `empresa` | String | CNPJ of the company. |
> | `documento` | String | Document or boleto number. |
> | `nossonumero` | String | Bank 'nosso número' of the boleto. |
> | `parcela` | Integer | Installment number, when there is one. |
> | `cnpjcpfcliente` | String | CNPJ or CPF of the customer. |
> | `dataemissao` | Date | Issue date of the document. |
> | `formacobranca` | String | Collection method. |
> | `datavencimento` | Date | Due date. |
> | `valorconta` | Number | Total amount of the account. |
> | `valordesconto` | Number | Discount amount. |
> | `valoracrescimo` | Number | Surcharge amount. |
> | `saldoemaberto` | Number | Amount still open. |
> | `situacao` | String | Status of the account (ABERTA, LIQUIDADA or CANCELADA). |
> | `linhadigitavel` | String | Typeable line (linha digitável) of the boleto. |
> | `datainclusao` | Datetime | When the record was created in Applix (local time). |
> | `ultimaalteracao` | Datetime | When the record was last changed in Applix (local time). |
> | `additional_fields` | String | Fields returned by Applix that are not in its API documentation (JSON object), kept so no data is lost. |

> [accordion] Cash and Bank Balances
>
> Stream name: `saldos_caixa_banco`. One row per cash/bank account and month: the balance at the end of the month.
>
> **Sync Strategy:**
>
> * Full table
> * Primary key(s): `row_key`
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `row_key` | String | Hash of the fields that identify the row in Applix; primary key of the table. |
> | `periodo` | String | Month of the balance (YYYY-MM), as requested from Applix. |
> | `caixabanco` | String | Name of the cash or bank account. |
> | `tipocaixabanco` | String | Type of the account (e.g. CONTA CORRENTE, CAIXA). |
> | `vlsaldofinalperiodo` | Number | Balance at the end of the month (for the current month: so far). |
> | `dtperiodo` | String | Period as Applix labels it (YY-MM). |
> | `empresa` | String | Company of the account. |
> | `additional_fields` | String | Fields returned by Applix that are not in its API documentation (JSON object), kept so no data is lost. |

> [accordion] Receivables (Sales)
>
> Stream name: `contas_receber`. One row per receivable as the sales module shows it, with the linked invoices and orders.
>
> **Sync Strategy:**
>
> * Full table
> * Primary key(s): `row_key`
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `row_key` | String | Hash of the fields that identify the row in Applix; primary key of the table. |
> | `tipo` | String | Type of the account (RECEBER). |
> | `empresa` | String | CNPJ of the company. |
> | `documento` | String | Document or boleto number. |
> | `parcela` | Integer | Installment number, when there is one. |
> | `cnpjcpfcliente` | String | CNPJ or CPF of the customer. |
> | `dataemissao` | Date | Issue date of the document. |
> | `datavencimento` | Date | Due date of the account. |
> | `valorconta` | Number | Total amount of the account. |
> | `saldoemaberto` | Number | Amount still open. |
> | `situacao` | String | Status of the account (ABERTA, LIQUIDADA or CANCELADA). |
> | `notafiscal` | String | Linked invoices (JSON array: mod, serie, numero). |
> | `pedido` | String | Linked sales orders (JSON array: numero, vendedor). |
> | `datainclusao` | Datetime | When the record was created in Applix (local time). |
> | `ultimaalteracao` | Datetime | When the record was last changed in Applix (local time). |
> | `additional_fields` | String | Fields returned by Applix that are not in its API documentation (JSON object), kept so no data is lost. |

> [accordion] Contracts
>
> Stream name: `contratos`. One row per contract renewal (numero + renovacao).
>
> **Sync Strategy:**
>
> * Full table
> * Primary key(s): `row_key`
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `row_key` | String | Hash of the fields that identify the row in Applix; primary key of the table. |
> | `numero` | String | Number of the contract (identifier). |
> | `tpcontrato` | String | Type of contract (e.g. SERVICO). |
> | `categoria` | String | Category of the contract. |
> | `modalidade` | String | Billing modality of the contract (e.g. mensal, trimestral). |
> | `situacao` | String | Status of the contract (EM ELABORACAO, ATIVO, INATIVO, CANCELADO, CONCLUIDO or SUSPENSO). |
> | `contrato` | String | Title of the contract. |
> | `renovacao` | String | Renewal number of the contract; with numero, identifies the row. |
> | `cliente` | String | Name of the customer. |
> | `documento_cliente` | String | CNPJ or CPF of the customer. |
> | `inicio` | Date | Start date of the contract. |
> | `termino` | Date | End date of the contract. |
> | `contrato_renovavel` | String | Whether the contract is renewable (SIM or NAO). |
> | `expiracao` | Date | Expiration date of the contract. |
> | `agente_comercial` | String | Sales agent of the contract. |
> | `fechamento_negocio` | Date | Date the deal was closed. |
> | `indicante` | String | Referrer of the contract. |
> | `representante` | String | Representative of the contract. |
> | `anotacoes` | String | Notes on the contract. |
> | `additional_fields` | String | Fields returned by Applix that are not in its API documentation (JSON object), kept so no data is lost. |

> [accordion] Contract Details
>
> Stream name: `contratos_detalhes`. One row per contract renewal with its items, installments (with collection and receivables) and finance setup.
>
> **Sync Strategy:**
>
> * Full table
> * Primary key(s): `row_key`
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `row_key` | String | Hash of the fields that identify the row in Applix; primary key of the table. |
> | `numero` | String | Number of the contract (identifier). |
> | `tpcontrato` | String | Type of contract (e.g. SERVICO). |
> | `categoria` | String | Category of the contract. |
> | `modalidade` | String | Billing modality of the contract (e.g. mensal, trimestral). |
> | `situacao` | String | Status of the contract (EM ELABORACAO, ATIVO, INATIVO, CANCELADO, CONCLUIDO or SUSPENSO). |
> | `contrato` | String | Title of the contract. |
> | `renovacao` | String | Renewal number of the contract; with numero, identifies the row. |
> | `cliente` | String | Name of the customer. |
> | `documento_cliente` | String | CNPJ or CPF of the customer. |
> | `inicio` | Date | Start date of the contract. |
> | `termino` | Date | End date of the contract. |
> | `contrato_renovavel` | String | Whether the contract is renewable (SIM or NAO). |
> | `expiracao` | Date | Expiration date of the contract. |
> | `agente_comercial` | String | Sales agent of the contract. |
> | `fechamento_negocio` | Date | Date the deal was closed. |
> | `indicante` | String | Referrer of the contract. |
> | `representante` | String | Representative of the contract. |
> | `anotacoes` | String | Notes on the contract. |
> | `tipo_cobranca_parcela` | String | How installments are billed (e.g. MES). |
> | `tipo_cobertura` | String | Coverage type code of the contract. |
> | `emitente` | String | CNPJ of the issuing company. |
> | `produtos_servicos` | String | Products and services of the contract (JSON array: item, descricao, codigo, quant, vlunit). |
> | `parcelas` | String | Installments of the contract (JSON array: nrparcela, dtvencimento, dtreferencia, vlparcela, vlacrescimo, vldesconto, referencia, formacobranca, tpcomissao, processo\_cobranca\[] and conta\_receber\[] with the receivable generated and its situacao). |
> | `financeiro` | String | Finance integration of the contract (JSON array: division, management account and project of installments and services). |
> | `additional_fields` | String | Fields returned by Applix that are not in its API documentation (JSON object), kept so no data is lost. |

> [accordion] Sales Orders
>
> Stream name: `pedidos`. One row per sales order.
>
> **Sync Strategy:**
>
> * Full table
> * Primary key(s): `numero`
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `numero` | Integer | Number of the sales order (identifier). |
> | `empresa` | String | CNPJ of the company. |
> | `cnpjcpfcliente` | String | CNPJ or CPF of the customer. |
> | `vendedor` | String | Salesperson of the order. |
> | `datapedido` | Date | Date of the order; the date the windows of this stream filter on. |
> | `datavalidade` | Date | Validity date of the order. |
> | `dataentregaprevista` | Date | Expected delivery date. |
> | `dataautorizacao` | Datetime | When the order was authorized (local time). |
> | `dataenvio` | Datetime | When the order was sent (local time). |
> | `tabelapreco` | String | Price list used in the order. |
> | `condicaopagamento` | String | Code of the payment term of the order. |
> | `valortotalpedido` | Number | Total amount of the order. |
> | `situacao` | String | Status of the order (DIGITACAO, ORCAMENTO, AUTORIZADO, EMITIDO, CANCELADO or FATURADO). |
> | `personalizado` | String | Custom fields of the document (JSON array of objects with campo1 to campo6). |
> | `additional_fields` | String | Fields returned by Applix that are not in its API documentation (JSON object), kept so no data is lost. |

> [accordion] Sales Order Details
>
> Stream name: `pedidos_detalhes`. One row per sales order with its items.
>
> **Sync Strategy:**
>
> * Incremental on `datapedido`
> * Primary key(s): `numero`
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `numero` | Integer | Number of the sales order (identifier). |
> | `empresa` | String | CNPJ of the company. |
> | `cnpjcpfcliente` | String | CNPJ or CPF of the customer. |
> | `vendedor` | String | Salesperson of the order. |
> | `datapedido` | Date | Date of the order; incremental replication key. |
> | `datavalidade` | Date | Validity date of the order. |
> | `dataentregaprevista` | Date | Expected delivery date. |
> | `dataautorizacao` | Datetime | When the order was authorized (local time). |
> | `dataenvio` | Datetime | When the order was sent (local time). |
> | `tabelapreco` | String | Price list used in the order. |
> | `condicaopagamento` | String | Code of the payment term of the order. |
> | `formacobranca` | String | Collection method of the order. |
> | `valortotalpedido` | Number | Total amount of the order. |
> | `valordesconto` | Number | Discount amount of the order. |
> | `modalidadefrete` | Integer | Freight mode code (NF-e modFrete, e.g. 9 = no freight). |
> | `valorfrete` | Number | Freight amount of the order. |
> | `observacaopedido` | String | Notes of the order. |
> | `observacaonota` | String | Notes to print on the invoice. |
> | `situacao` | String | Status of the order when its details were read. |
> | `produto` | String | Items of the order (JSON array: item, codigo, qtdevenda, valorvenda, valordesconto, situacao). |
> | `personalizado` | String | Custom fields of the document (JSON array of objects with campo1 to campo6). |
> | `additional_fields` | String | Fields returned by Applix that are not in its API documentation (JSON object), kept so no data is lost. |

> [accordion] Quotes
>
> Stream name: `orcamentos`. One row per quote.
>
> **Sync Strategy:**
>
> * Full table
> * Primary key(s): `row_key`
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `row_key` | String | Hash of the fields that identify the row in Applix; primary key of the table. |
> | `numero` | Integer | Number of the quote (identifier). |
> | `empresa` | String | CNPJ of the company. |
> | `cnpjcpfcliente` | String | CNPJ or CPF of the customer. |
> | `vendedor` | String | Salesperson of the quote. |
> | `datapedido` | Date | Date of the quote; the date the windows of this stream filter on. |
> | `tabelapreco` | String | Price list used in the quote. |
> | `condicaopagamento` | String | Code of the payment term of the quote. |
> | `valortotalorcamento` | Number | Total amount of the quote. |
> | `situacao` | String | Status of the quote (CANCELADO, AUTORIZADO, PERDIDO, DIGITACAO or ENCERRADO). |
> | `personalizado` | String | Custom fields of the document (JSON array of objects with campo1 to campo6). |
> | `additional_fields` | String | Fields returned by Applix that are not in its API documentation (JSON object), kept so no data is lost. |

> [accordion] Quote Details
>
> Stream name: `orcamentos_detalhes`. One row per quote with its items. Not selected by default.
>
> **Sync Strategy:**
>
> * Incremental on `datapedido`
> * Primary key(s): `numero`
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `numero` | Integer | Number of the quote (identifier). |
> | `empresa` | String | CNPJ of the company. |
> | `cnpjcpfcliente` | String | CNPJ or CPF of the customer. |
> | `vendedor` | String | Salesperson of the quote. |
> | `datapedido` | Date | Date of the quote; incremental replication key. |
> | `datavalidade` | Date | Validity date of the quote. |
> | `dataenvio` | Date | Date the quote was sent. |
> | `tabelapreco` | String | Price list used in the quote. |
> | `condicaopagamento` | String | Code of the payment term of the quote. |
> | `valortotalorcamento` | Number | Total amount of the quote. |
> | `valordesconto` | Number | Discount amount of the quote. |
> | `modalidadefrete` | Integer | Freight mode code (NF-e modFrete). |
> | `valorfrete` | Number | Freight amount of the quote. |
> | `observacao` | String | Notes of the quote. |
> | `situacao` | String | Status of the quote when its details were read. |
> | `produto` | String | Items of the quote (JSON array: item, codigo, qtdevenda, valorvenda, valordesconto, situacao). |
> | `personalizado` | String | Custom fields of the document (JSON array of objects with campo1 to campo6). |
> | `additional_fields` | String | Fields returned by Applix that are not in its API documentation (JSON object), kept so no data is lost. |

> [accordion] Invoices
>
> Stream name: `notas_fiscais`. One row per invoice (nota fiscal) of the configured series.
>
> **Sync Strategy:**
>
> * Full table
> * Primary key(s): `row_key`
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `row_key` | String | Hash of the fields that identify the row in Applix; primary key of the table. |
> | `mod` | String | Invoice model code (e.g. 55 = NF-e, 01 = model 1). |
> | `serie` | Integer | Invoice series. |
> | `numero` | Integer | Invoice number. |
> | `cnpjemitente` | String | CNPJ of the issuer. |
> | `cnpjcpfcliente` | String | CNPJ or CPF of the customer. |
> | `dataemissao` | Date | Issue date; the date the windows of this stream filter on. |
> | `datasaida` | Date | Date the goods left. |
> | `valornfe` | Number | Total amount of the invoice. |
> | `valorprodutos` | Number | Amount of the products of the invoice. |
> | `situacao` | String | Status of the invoice (e.g. AUTORIZADA, CANCELADA). |
> | `additional_fields` | String | Fields returned by Applix that are not in its API documentation (JSON object), kept so no data is lost. |

> [accordion] Invoice Details
>
> Stream name: `notas_fiscais_detalhes`. One row per invoice with taxes, items and linked orders.
>
> **Sync Strategy:**
>
> * Incremental on `dataemissao`
> * Primary key(s): `row_key`
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `row_key` | String | Hash of the fields that identify the row in Applix; primary key of the table. |
> | `mod` | String | Invoice model code. |
> | `serie` | Integer | Invoice series. |
> | `numero` | Integer | Invoice number. |
> | `cnpjemitente` | String | CNPJ of the issuer. |
> | `cnpjcpfcliente` | String | CNPJ or CPF of the customer. |
> | `vendedor` | String | Salesperson of the invoice. |
> | `dataemissao` | Date | Issue date; incremental replication key. |
> | `datasaida` | Date | Date the goods left. |
> | `naturezaoperacao` | String | Nature of the operation (natureza da operação). |
> | `formacobranca` | String | Collection method of the invoice. |
> | `valornfe` | Number | Total amount of the invoice. |
> | `valorprodutos` | Number | Amount of the products. |
> | `valorfrete` | Number | Freight amount. |
> | `valorseguro` | Number | Insurance amount. |
> | `valordesconto` | Number | Discount amount. |
> | `valoricms` | Number | ICMS tax amount. |
> | `valoricmsst` | Number | ICMS-ST (tax substitution) amount. |
> | `valoripi` | Number | IPI tax amount. |
> | `valorpis` | Number | PIS tax amount. |
> | `valorcofins` | Number | COFINS tax amount. |
> | `chavenf` | String | Access key of the electronic invoice (chave de acesso). |
> | `situacao` | String | Status of the invoice when its details were read. |
> | `produto` | String | Items of the invoice (JSON array: codigo, cfop, qtde, unidade, valorunitario, valortotal). |
> | `pedido` | String | Sales orders of the invoice (JSON array: numero). |
> | `additional_fields` | String | Fields returned by Applix that are not in its API documentation (JSON object), kept so no data is lost. |

> [accordion] Customers
>
> Stream name: `clientes`. One row per customer.
>
> **Sync Strategy:**
>
> * Full table
> * Primary key(s): `row_key`
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `row_key` | String | Primary key: hash of the CNPJ/CPF, or, for customers without one, of type, names, email and phone. |
> | `cnpjcpfcliente` | String | CNPJ or CPF of the customer (null when missing). |
> | `tipocliente` | String | Type of customer (FISICA or JURIDICA). |
> | `nomecliente` | String | Legal name of the customer. |
> | `nomefantasia` | String | Trade name of the customer. |
> | `inscricaoestadual` | String | State registration (inscrição estadual). |
> | `rg_numero` | String | RG (identity document) number. |
> | `rg_uf` | String | State that issued the RG. |
> | `rg_dataexpedicao` | Datetime | Issue date of the RG. |
> | `rg_raw` | String | RG data as sent by Applix when it is not an object. |
> | `endereco_rua` | String | Address: street. |
> | `endereco_bairro` | String | Address: neighbourhood. |
> | `endereco_numero` | String | Address: street number. |
> | `endereco_complemento` | String | Address: complement. |
> | `endereco_cep` | String | Address: postal code (CEP). |
> | `endereco_cidade` | String | Address: city. |
> | `endereco_uf` | String | Address: state (UF). |
> | `endereco_codigoibge` | Integer | Address: IBGE code of the city. |
> | `endereco_raw` | String | Address as sent by Applix when it is not an object. |
> | `telefone` | String | Phone number of the customer. |
> | `email` | String | Email of the customer. |
> | `agente` | String | Agent (system user) linked to the customer. |
> | `classificacao_grupocliente` | String | Classification: customer group. |
> | `classificacao_regiao` | String | Classification: region. |
> | `classificacao_segmento` | String | Classification: market segment. |
> | `classificacao_porte` | String | Classification: size (e.g. ATACADO). |
> | `classificacao_origem` | String | Classification: lead origin. |
> | `classificacao_raw` | String | Classification as sent by Applix when it is not an object. |
> | `credito_situacao` | Integer | Credit status code of the customer. |
> | `credito_raw` | String | Credit data as sent by Applix when it is not an object. |
> | `padrao_vendedor` | String | Default salesperson of the customer. |
> | `padrao_raw` | String | Defaults as sent by Applix when they are not an object. |
> | `contato` | String | Contacts of the customer (JSON array: nome, telefone, email, classeemail, cargo, departamento). |
> | `contratos` | String | Contracts of the customer (JSON array: contrato, descricao). |
> | `personalizado` | String | Custom fields of the customer (JSON object). |
> | `situacao` | String | Status of the customer (e.g. ATIVA). |
> | `ultimaalteracao` | Datetime | When the customer was last changed in Applix (local time). |
> | `additional_fields` | String | Fields returned by Applix that are not in its API documentation (JSON object), kept so no data is lost. |

> [accordion] Products
>
> Stream name: `produtos`. One row per product.
>
> **Sync Strategy:**
>
> * Full table
> * Primary key(s): `codigo`
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `codigo` | String | Code of the product. |
> | `descricao` | String | Description of the product. |
> | `ncm` | String | NCM (Mercosur tax classification) code of the product. |
> | `codigocategoria` | String | Code of the product category. |
> | `categoria` | String | Name of the product category. |
> | `unidademedida` | String | Unit of measure of the product (e.g. UN, KG, M). |
> | `especificacao` | String | Detailed specification of the product. |
> | `situacao` | String | Status of the product (ATIVO or INATIVO). |
> | `additional_fields` | String | Fields returned by Applix that are not in its API documentation (JSON object), kept so no data is lost. |

> [accordion] Stock Balance
>
> Stream name: `saldo_estoque`. One row per product with its stock by storage location and lot.
>
> **Sync Strategy:**
>
> * Full table
> * Primary key(s): `codigo`
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `codigo` | String | Code of the product. |
> | `unidademedida` | String | Unit of measure of the product. |
> | `saldo` | String | Stock balance by company and storage location (JSON array: empresa, localarmazenagem, qtdeestoque, qtdereservada and lotes with lote and qtdenolote). |
> | `additional_fields` | String | Fields returned by Applix that are not in its API documentation (JSON object), kept so no data is lost. |

> [accordion] Price Lists
>
> Stream name: `tabela_precos`. One row per price list with its versions and product prices.
>
> **Sync Strategy:**
>
> * Full table
> * Primary key(s): `tabelapreco`
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `tabelapreco` | String | Name of the price list. |
> | `basetroca` | String | Whether the price list is a trade-in base (SIM or NAO). |
> | `situacao` | String | Status of the price list (ATIVO or INATIVO). |
> | `versao` | String | Versions of the price list (JSON array: numero, iniciovalidade, fimvalidade and produto, the list of product codes with precovenda, datainclusao and ultimaalteracao). |
> | `additional_fields` | String | Fields returned by Applix that are not in its API documentation (JSON object), kept so no data is lost. |

> [accordion] Product Categories
>
> Stream name: `categorias_produto`. One row per product category.
>
> **Sync Strategy:**
>
> * Full table
> * Primary key(s): `codigo`
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `codigo` | String | Code of the product category. |
> | `descricao` | String | Description of the product category. |
> | `codigopai` | String | Code of the parent category, when the category is nested. |
> | `additional_fields` | String | Fields returned by Applix that are not in its API documentation (JSON object), kept so no data is lost. |

> [accordion] Payment Terms
>
> Stream name: `condicoes_pagamento`. One row per payment term.
>
> **Sync Strategy:**
>
> * Full table
> * Primary key(s): `codigo`
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `codigo` | String | Code of the payment term. |
> | `descricao` | String | Description of the payment term (e.g. 20 days, no interest). |
> | `tipo` | String | Type of the payment term (e.g. DDL, days after delivery). |
> | `prazos` | String | Installment terms of the payment condition, as Applix stores them. |
> | `situacao` | String | Status of the payment term (ATIVO or INATIVO). |
> | `additional_fields` | String | Fields returned by Applix that are not in its API documentation (JSON object), kept so no data is lost. |

> [accordion] Collection Methods
>
> Stream name: `formas_cobranca`. One row per collection method.
>
> **Sync Strategy:**
>
> * Full table
> * Primary key(s): `row_key`
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `row_key` | String | Hash of the fields that identify the row in Applix; primary key of the table. |
> | `codigo` | String | Code of the collection method. |
> | `empresa` | String | CNPJ of the company that owns the collection method. |
> | `descricao` | String | Description of the collection method. |
> | `situacao` | String | Status of the collection method (ATIVO or INATIVO). |
> | `datainclusao` | Datetime | When the record was created in Applix (local time). |
> | `ultimaalteracao` | Datetime | When the record was last changed in Applix (local time). |
> | `additional_fields` | String | Fields returned by Applix that are not in its API documentation (JSON object), kept so no data is lost. |

> [accordion] Customer Groups
>
> Stream name: `grupos_cliente`. One row per customer group.
>
> **Sync Strategy:**
>
> * Full table
> * Primary key(s): `codigo`
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `codigo` | String | Code of the customer group. |
> | `descricao` | String | Description of the customer group. |
> | `additional_fields` | String | Fields returned by Applix that are not in its API documentation (JSON object), kept so no data is lost. |

> [accordion] Services
>
> Stream name: `servicos`. One row per service.
>
> **Sync Strategy:**
>
> * Full table
> * Primary key(s): `codigo`
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `codigo` | String | Code of the service. |
> | `descricao` | String | Description of the service. |
> | `especificacao` | String | Detailed specification of the service. |
> | `situacao` | String | Status of the service (ATIVO or INATIVO). |
> | `additional_fields` | String | Fields returned by Applix that are not in its API documentation (JSON object), kept so no data is lost. |

> [accordion] Scrap Balances
>
> Stream name: `sucatas_receber`. One row per scrap balance document (scrap to receive or to pay).
>
> **Sync Strategy:**
>
> * Full table
> * Primary key(s): `row_key`
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `row_key` | String | Hash of the fields that identify the row in Applix; primary key of the table. |
> | `empresa` | String | Company of the record. |
> | `cnpjcpfcliente` | String | CNPJ or CPF of the customer. |
> | `tipo` | String | Direction of the balance (PAGAR or RECEBER). |
> | `controle` | String | Control code of the record. |
> | `documento` | String | Document number. |
> | `dataemissao` | Date | Issue date of the document. |
> | `datavencimento` | Date | Due date of the document. |
> | `saldoemabertopc` | Number | Open balance in pieces. |
> | `saldoemabertokg` | Number | Open balance in kilograms. |
> | `datainclusao` | Datetime | When the record was created in Applix (local time). |
> | `additional_fields` | String | Fields returned by Applix that are not in its API documentation (JSON object), kept so no data is lost. |

> [accordion] Salespeople
>
> Stream name: `vendedores`. One row per salesperson.
>
> **Sync Strategy:**
>
> * Full table
> * Primary key(s): `vendedor`
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `vendedor` | String | System user of the salesperson (identifier). |
> | `tipo` | String | Type of the salesperson record (e.g. VENDEDOR). |
> | `cnpjcpf` | String | CNPJ or CPF of the salesperson. |
> | `nome` | String | Name of the salesperson. |
> | `email` | String | Email of the salesperson. |
> | `situacao` | String | Status of the salesperson (ATIVO or INATIVO). |
> | `endereco_rua` | String | Address: street. |
> | `endereco_bairro` | String | Address: neighbourhood. |
> | `endereco_numero` | String | Address: street number. |
> | `endereco_complemento` | String | Address: complement. |
> | `endereco_cep` | String | Address: postal code (CEP). |
> | `endereco_cidade` | String | Address: city. |
> | `endereco_uf` | String | Address: state (UF). |
> | `endereco_raw` | String | Address as sent by Applix when it is not an object. |
> | `equipe` | String | Sales teams of the salesperson (JSON array of objects with nome, lider, responsavel). |
> | `additional_fields` | String | Fields returned by Applix that are not in its API documentation (JSON object), kept so no data is lost. |

## Implementation Notes

### How changes are captured

Accounts, boletos, orders and contracts change status (paid, cancelled, invoiced) long after they are created, and Applix has no filter for "changed since". So:

* **Accounts receivable and payable** are read by due date, in 30-day periods, from the Start Date up to five years ahead (future installments and bills). Every extraction reads the whole range again, so a payment or a cancellation always shows up.
* **Boletos** are read for every customer, in each status (open, settled, cancelled), on every extraction. This means three requests per customer, so extractions take longer for companies with many customers.
* **Cash and bank balances** are read month by month from the Start Date; the current month shows the balance so far.
* **Contracts** are read in full on every extraction (from the year 2000 on), and so are their details, because installments are paid or renegotiated long after the contract starts. Each renewal of a contract is its own row.
* **Orders, quotes and invoices** are read by date from the Start Date on every extraction, so their status is always current. Their **detail** streams make one request per document, so they are incremental. The first extraction reads every detail (and saves its progress as it goes, so an interrupted first extraction continues where it stopped; progress is not saved while Applix cannot find any of the details requested, in case the problem is on Applix's side). Later extractions read the details again for:

  * documents dated in the last 30 days before the most recent extraction;
  * documents up to one year old whose status is not final yet (for example an order not yet invoiced or cancelled), until they reach a final status, and once more when they do.

  A document whose details Applix cannot find is requested again when its status changes (for example when it is invoiced), and otherwise once a week, until its details are found (a warning is shown when details are missing).

  A document changed after reaching a final status (for example an authorized invoice cancelled later), or created already final with a date more than 30 days back, keeps its previous details until a Full Sync of the detail stream. The list streams (`pedidos`, `orcamentos`, `notas_fiscais`) always show the current status.

### Data Quality Considerations

* **Completeness checks:** each list is read in full and checked against the total Applix reports before it is loaded. When Applix returns fewer rows than that total, they are only accepted if the extraction can confirm that Applix's total counts more than the filtered data (for example, the whole table); if it can confirm the opposite, the extraction of that stream fails instead of loading a cut-off list. If it cannot tell either way, the data is read twice, loaded only when both reads are identical, and a warning says its completeness could not be fully verified. If the data changes while it is being read (for example, documents created during business hours), the list is read again; if it keeps changing, the extraction of that stream fails and the next extraction tries again.
* **If an extraction fails:** registries, cash and bank balances, and contracts with their details are read completely before anything is written, so a failed extraction leaves those tables as they were. Accounts receivable and payable, boletos, orders, quotes, invoices and their details are too large for that and are loaded period by period: if one of them fails midway, the run is marked as failed and, depending on your destination, the table may hold only the periods read before the failure until the next successful extraction, which reads everything again.
* **Boletos:** if Applix returns no boletos for any customer, the extraction shows a warning, because the table will be empty.
* **Dates and times:** dates and times are in Applix's local time (Brazil), without a time zone.
* **Quote numbers:** Applix's documentation does not list the quote number in the quotes list. When Applix sends it, it identifies the quote; when it does not, the quote's details cannot be requested (a warning is shown) and two quotes identical in every field are kept as one row. That is why **Quote Details** is not selected by default: select it only if the `numero` column of **Quotes** is filled.
* **Customers without a CNPJ/CPF:** they are kept as separate rows, with `cnpjcpfcliente` empty (null) and a `row_key` built from their type, names, email and phone.
* **Accounts with the same `id`:** an account split across cost centres or projects, or the installments of a contract, can appear as several rows with the same `id`, each identified by `row_key`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.