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

# Superlógica Assinaturas as a data source

> Bring data from Superlógica Assinaturas to Nekt.

Superlógica Assinaturas is a subscription management platform that helps businesses manage their recurring revenue, customer subscriptions, and billing processes. It provides tools for managing clients, subscriptions, and recurring payments.

<img height="30" src="https://mintcdn.com/nekt/xwmbAwE5H07KpoBm/assets/logo/logo-superlogica-assinaturas.png?fit=max&auto=format&n=xwmbAwE5H07KpoBm&q=85&s=42bbe0d204803a84b4706d06d06554ef" data-path="assets/logo/logo-superlogica-assinaturas.png" />

## Configuring Superlógica Assinaturas 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 Superlógica Assinaturas option from the list of connectors.

Click **Next** and you'll be prompted to add your access.

### 1. Add account access

You'll need to provide the following credentials to connect to Superlógica Assinaturas:

* **App Token**: The app token from Superlógica.
* **Access Token**: The access token from Superlógica.
* **Start Date**: The earliest date from which records will be synced (e.g., `YYYY-MM-DD`). Used for data extractions like the aggregated MRR stream.

If you don't know how to generate the tokens, please [check this documentation](https://assinaturas.superlogica.com/hc/pt-br/articles/360004013613-Como-criar-o-app-e-access-token).

<Note>
  The tokens are valid for 1 year, after that to continue using the APIs a new one must be generated.
</Note>

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. You can select all streams or pick specific ones that matter most to you.

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

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

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

# Streams and Fields

Below you'll find all available data streams from Superlógica Assinaturas and their corresponding fields:

<AccordionGroup>
  <Accordion title="Clients">
    Stream for managing client information. It fetches all clients, including active, inactive, and frozen records.

    **Fields:**

    | Field                            | Type   | Description                  |
    | :------------------------------- | :----- | :--------------------------- |
    | `id_sacado_sac`                  | String | Payer ID (Primary Key)       |
    | `st_nome_sac`                    | String | Client name                  |
    | `st_nomeref_sac`                 | String | Reference name               |
    | `st_cgc_sac`                     | String | Client CPF/CNPJ              |
    | `st_email_sac`                   | String | Client email                 |
    | `st_telefone_sac`                | String | Client phone                 |
    | `st_endereco_sac`                | String | Client address               |
    | `st_complemento_sac`             | String | Address complement           |
    | `st_cidade_sac`                  | String | Client city                  |
    | `st_estado_sac`                  | String | Client state                 |
    | `st_cep_sac`                     | String | Client ZIP code              |
    | `st_bairro_sac`                  | String | Neighborhood                 |
    | `st_pais_sac`                    | String | Country                      |
    | `st_paisentrega_sac`             | String | Delivery country             |
    | `st_numero_sac`                  | String | Number                       |
    | `st_inscricao_sac`               | String | State registration           |
    | `st_inscmunicipal_sac`           | String | Municipal registration       |
    | `dt_cadastro_sac`                | String | Registration date            |
    | `dt_alteracao_sincro`            | String | Modification date            |
    | `fl_desativar_sac`               | String | Deactivate flag              |
    | `fl_status_sac`                  | String | Client status                |
    | `dt_desativacao_sac`             | String | Deactivation date            |
    | `st_sexo_sac`                    | String | Gender                       |
    | `st_nacionalidade_sac`           | String | Nationality                  |
    | `dt_nascimento_sac`              | String | Birth date                   |
    | `st_naturalidade_sac`            | String | Place of birth               |
    | `st_carteiraidentidade_sac`      | String | Identity card                |
    | `dt_emissaocarteira_sac`         | String | ID card issue date           |
    | `st_orgao_sac`                   | String | Issuing agency               |
    | `fl_pessoajuridica_sac`          | String | Legal entity flag            |
    | `fl_entidadepublica_sac`         | String | Public entity flag           |
    | `st_celular_sac`                 | String | Mobile phone                 |
    | `st_fax_sac`                     | String | Fax number                   |
    | `tx_observacao_sac`              | String | Observations                 |
    | `tx_contatos_sac`                | String | Contacts                     |
    | `st_diavencimento_sac`           | String | Due day                      |
    | `vl_txpis_sac`                   | String | PIS tax                      |
    | `vl_txinss_sac`                  | String | INSS tax                     |
    | `vl_txirrf_sac`                  | String | IRRF tax                     |
    | `vl_txcontribuicaosocial_sac`    | String | Social contribution tax      |
    | `vl_txcofins_sac`                | String | COFINS tax                   |
    | `vl_txissqn_sac`                 | String | ISSQN tax                    |
    | `vl_txdesconto_sac`              | String | Discount tax                 |
    | `fl_reterissqn_sac`              | String | Withhold ISSQN               |
    | `fl_reterpis_sac`                | String | Withhold PIS                 |
    | `fl_reterinss_sac`               | String | Withhold INSS                |
    | `fl_reterirrf_sac`               | String | Withhold IRRF                |
    | `fl_retercontribuicaosocial_sac` | String | Withhold social contribution |
    | `fl_retercofins_sac`             | String | Withhold COFINS              |
    | `st_contrato_sac`                | String | Contract                     |
    | `st_sincro_sac`                  | String | Synchronization              |
    | `st_codemp_sac`                  | String | Company code                 |
    | `st_senha_sac`                   | String | Password                     |
    | `campo1`                         | String | Custom field 1               |
    | `campo2`                         | String | Custom field 2               |
    | `campo3`                         | String | Custom field 3               |
    | `campo4`                         | String | Custom field 4               |
    | `id_grupo_grp`                   | String | Group ID                     |
    | `st_sacadornome_sac`             | String | Drawer name                  |
    | `st_sacadorcgc_sac`              | String | Drawer CGC                   |
    | `st_sincroorder_sac`             | String | Synchronization order        |
    | `nome_cliente`                   | String | Client name (calculated)     |
    | `nome_formatado`                 | String | Formatted name (calculated)  |
    | `st_nomestatus_sac`              | String | Name and status (calculated) |
  </Accordion>

  <Accordion title="Assinaturas">
    Stream for managing subscription and recurring payment information.

    **Fields:**

    | Field                           | Type   | Description                       |
    | :------------------------------ | :----- | :-------------------------------- |
    | `id_sacado_sac`                 | String | Client ID                         |
    | `st_nome_sac`                   | String | Client name                       |
    | `st_nomeref_sac`                | String | Client reference name             |
    | `st_endereco_sac`               | String | Client address                    |
    | `st_complemento_sac`            | String | Address complement                |
    | `st_bairro_sac`                 | String | Neighborhood                      |
    | `st_cidade_sac`                 | String | City                              |
    | `st_estado_sac`                 | String | State                             |
    | `st_pais_sac`                   | String | Country                           |
    | `st_cep_sac`                    | String | ZIP code                          |
    | `st_enderecoentrega_sac`        | String | Delivery address                  |
    | `st_numeroentrega_sac`          | String | Delivery address number           |
    | `st_complementoentrega_sac`     | String | Delivery address complement       |
    | `st_bairroentrega_sac`          | String | Delivery address neighborhood     |
    | `st_cidadeentrega_sac`          | String | Delivery address city             |
    | `st_estadoentrega_sac`          | String | Delivery address state            |
    | `st_paisentrega_sac`            | String | Delivery address country          |
    | `st_cepentrega_sac`             | String | Delivery address ZIP code         |
    | `st_rg_sac`                     | String | RG document                       |
    | `st_cgc_sac`                    | String | CPF/CNPJ document                 |
    | `st_ddd_sac`                    | String | Area code                         |
    | `st_telefone_sac`               | String | Phone number                      |
    | `st_email_sac`                  | String | Email address                     |
    | `fl_status_sac`                 | String | Client status                     |
    | `st_diavencimento_sac`          | String | Due day                           |
    | `st_inscricao_sac`              | String | State registration                |
    | `st_codigocontabil_sac`         | String | Accounting code                   |
    | `st_sincro_sac`                 | String | Synchronization                   |
    | `dt_desativacao_sac`            | String | Deactivation date                 |
    | `dt_congelamento_sac`           | String | Freezing date                     |
    | `dt_ignorarstatus_sac`          | String | Ignore status date                |
    | `st_sincro_sac1`                | String | Synchronization 1                 |
    | `dt_desativacao_sac1`           | String | Deactivation date 1               |
    | `st_numero_sac`                 | String | Number                            |
    | `st_fax_sac`                    | String | Fax number                        |
    | `fl_pagamentopref_sac`          | String | Preferred payment flag            |
    | `fl_pessoajuridica_sac`         | String | Legal entity flag                 |
    | `dt_cadastro_sac`               | String | Registration date                 |
    | `st_identificador_plc`          | String | Client plan identifier            |
    | `st_identificadorextra_plc`     | String | Extra identifier                  |
    | `id_planocliente_plc`           | String | Client plan ID                    |
    | `dt_contrato_plc`               | String | Contract date                     |
    | `dt_cancelamento_plc`           | String | Cancellation date                 |
    | `fl_trial_plc`                  | String | Trial flag                        |
    | `dt_trialinicio_plc`            | String | Trial start date                  |
    | `dt_trialfim_plc`               | String | Trial end date                    |
    | `fl_autocontratar_plc`          | String | Auto contract flag                |
    | `st_emailindicacao_plc`         | String | Referral email                    |
    | `id_vendedor_for`               | String | Seller ID                         |
    | `fl_autorecontratar_plc`        | String | Auto renew flag                   |
    | `nm_parcelasadesao_plc`         | String | Adhesion installments number      |
    | `nm_parcelasrecorrencia_plc`    | String | Recurrence installments number    |
    | `fl_periodicidade_plc`          | String | Contract periodicity flag         |
    | `vl_aproxrenovacao_plc`         | String | Approximate renewal value         |
    | `vl_descontorenovacao_plc`      | String | Renewal discount value            |
    | `dt_ultimarenovacao_recb`       | String | Last renewal date                 |
    | `id_proximarenovacao_recb`      | String | Next renewal ID                   |
    | `fl_primeiropag_plc`            | String | First payment flag                |
    | `id_ticket_tic`                 | String | Ticket ID                         |
    | `fl_diferencacancelamento_plc`  | String | Cancellation difference flag      |
    | `st_nome_cup`                   | String | Coupon name                       |
    | `dt_primeiropag_plc`            | String | First payment date                |
    | `st_frete_plc`                  | String | Shipping                          |
    | `fl_trialdesativado_plc`        | String | Trial deactivated flag            |
    | `fl_tipocancelamento_plc`       | String | Cancellation type flag            |
    | `id_planoclienteorigem_plc`     | String | Origin client plan ID             |
    | `id_plano_pla`                  | String | Plan ID                           |
    | `st_nome_pla`                   | String | Plan name                         |
    | `id_grade_gpl`                  | String | Grade ID                          |
    | `nm_contratofim_pla`            | String | Contract end number               |
    | `fl_autorecontratar_pla`        | String | Auto renew plan flag              |
    | `fl_autocontratar_pla`          | String | Auto contract plan flag           |
    | `fl_periodicidade_pla`          | String | Plan periodicity flag             |
    | `nm_parcelas_pla`               | String | Number of installments            |
    | `st_nome_gpl`                   | String | Grade name                        |
    | `dt_vencimentorenovacao_recb`   | String | Renewal due date                  |
    | `st_nome_fav`                   | String | Beneficiary name                  |
    | `st_fantasia_fav`               | String | Beneficiary trade name            |
    | `id_mensalidade_mens`           | String | Monthly fee ID                    |
    | `id_cliente_mens`               | String | Monthly fee client ID             |
    | `id_empresa_mens`               | String | Company ID                        |
    | `st_descricao_mens`             | String | Monthly fee description           |
    | `st_valor_mens`                 | String | Monthly fee value                 |
    | `st_qntd_mens`                  | String | Monthly fee quantity              |
    | `dt_atualizacao_mens`           | String | Update date                       |
    | `id_produto_prd`                | String | Product ID                        |
    | `id_conta_cb`                   | String | Account ID                        |
    | `fl_online_mens`                | String | Online flag                       |
    | `fl_jan_mens`                   | String | January flag                      |
    | `fl_fev_mens`                   | String | February flag                     |
    | `fl_mar_mens`                   | String | March flag                        |
    | `fl_abr_mens`                   | String | April flag                        |
    | `fl_mai_mens`                   | String | May flag                          |
    | `fl_jun_mens`                   | String | June flag                         |
    | `fl_jul_mens`                   | String | July flag                         |
    | `fl_ago_mens`                   | String | August flag                       |
    | `fl_set_mens`                   | String | September flag                    |
    | `fl_out_mens`                   | String | October flag                      |
    | `fl_nov_mens`                   | String | November flag                     |
    | `fl_dez_mens`                   | String | December flag                     |
    | `fl_periodicidade_mens`         | String | Periodicity flag                  |
    | `dt_inicio_mens`                | String | Monthly fee start date            |
    | `dt_fim_mens`                   | String | Monthly fee end date              |
    | `st_complemento_mens`           | String | Monthly fee complement            |
    | `id_planocliente_plc1`          | String | Client plan ID 1                  |
    | `id_tabela_rta`                 | String | Table ID                          |
    | `nm_diavencimento_mens`         | String | Monthly fee due day               |
    | `id_filial_fil`                 | String | Branch ID                         |
    | `id_vendedor_mens`              | String | Seller ID monthly                 |
    | `st_label_mens`                 | String | Label monthly                     |
    | `dt_importacaofaturamento_mens` | String | Billing import date               |
    | `id_endereco_sen`               | String | Address ID                        |
    | `fl_adicional_mens`             | String | Additional flag                   |
    | `st_identificador_mens`         | String | Monthly identifier                |
    | `fl_fimforcado_mens`            | String | Forced end flag                   |
    | `vl_txjuros_mens`               | String | Interest tax value                |
    | `vl_txmulta_mens`               | String | Fine tax value                    |
    | `vl_txdesconto_mens`            | String | Discount tax value                |
    | `dt_fimantigo_mens`             | String | Old end date                      |
    | `nome_formatado`                | String | Formatted name (calculated field) |
    | `quantidade`                    | String | Quantity                          |
    | `total`                         | String | Total amount                      |
    | `mrr`                           | String | Monthly Recurring Revenue         |
    | `ultimo_fim`                    | String | Last end date                     |
  </Accordion>

  <Accordion title="Assinaturas MRR">
    Lean aggregated stream providing MRR/total metrics per active and deactivated contract-plan. It hits the same endpoint as `assinaturas` but uses an aggregated view. Join keys and aggregated metrics are kept - join back to `assinaturas`/`clientes` for client/contract/plan details.

    | Field                 | Type   | Description                                                           |
    | :-------------------- | :----- | :-------------------------------------------------------------------- |
    | `id_planocliente_plc` | String | Client plan (contract) ID. Join key to `assinaturas`. (Primary Key)   |
    | `id_plano_pla`        | String | Plan ID. (Primary Key)                                                |
    | `id_sacado_sac`       | String | Client ID. Join key to `clientes`.                                    |
    | `quantidade`          | String | Aggregated monthly-fee quantity for the plan.                         |
    | `total`               | String | Aggregated total amount for the plan.                                 |
    | `mrr`                 | String | Monthly Recurring Revenue (normalized by periodicity by Superlógica). |
    | `ultimo_fim`          | String | Last end date of the aggregated mensalidades.                         |
    | `st_periodicidade`    | String | Plan periodicity label (e.g., Anual).                                 |
  </Accordion>

  <Accordion title="Cobranças">
    Stream for retrieving charge and receivable information.

    **Fields:**

    | Field                           | Type   | Description                                   |
    | :------------------------------ | :----- | :-------------------------------------------- |
    | `id_sacado_sac`                 | String | Client ID                                     |
    | `st_nome_sac`                   | String | Client name                                   |
    | `st_nomeref_sac`                | String | Client reference name                         |
    | `st_sincro_sac`                 | String | Client synchronization field                  |
    | `dt_desativacao_sac`            | String | Client deactivation date                      |
    | `dt_congelamento_sac`           | String | Client freezing date                          |
    | `dt_ignorarstatus_sac`          | String | Client ignore-status date                     |
    | `nm_anocartaovencimento_sac`    | String | Client card expiration year                   |
    | `nm_mescartaovencimento_sac`    | String | Client card expiration month                  |
    | `nm_cartao_sac`                 | String | Client card number                            |
    | `st_telefone_sac`               | String | Client phone number                           |
    | `st_email_sac`                  | String | Client email address                          |
    | `st_cep_sac`                    | String | Client ZIP code                               |
    | `fl_pagamentopref_sac`          | String | Client preferred payment flag                 |
    | `fl_pessoajuridica_sac`         | String | Client legal entity flag                      |
    | `st_banco_sac`                  | String | Client bank                                   |
    | `st_cgc_sac`                    | String | Client CPF/CNPJ document                      |
    | `st_cartaobandeira_sac`         | String | Client card brand                             |
    | `id_recebimento_recb`           | String | Charge (receivable) ID                        |
    | `dt_vencimento_recb`            | String | Charge due date                               |
    | `dt_recebimento_recb`           | String | Date the charge was received                  |
    | `dt_geracao_recb`               | String | Charge generation date                        |
    | `dt_liquidacao_recb`            | String | Charge settlement date                        |
    | `fl_status_recb`                | String | Charge status flag                            |
    | `vl_total_recb`                 | String | Charge total value                            |
    | `vl_emitido_recb`               | String | Charge issued value                           |
    | `dt_cancelamento_recb`          | String | Charge cancellation date                      |
    | `st_nossonumero_recb`           | String | Boleto internal reference number              |
    | `st_observacaointerna_recb`     | String | Internal observation                          |
    | `st_observacaoexterna_recb`     | String | External observation (e.g. installment label) |
    | `st_complementocomposicao_recb` | String | Composition complement                        |
    | `id_formapagamento_recb`        | String | Payment method ID                             |
    | `id_conta_cb`                   | String | Bank account ID                               |
    | `vl_txjuros_recb`               | String | Interest tax value                            |
    | `vl_txmulta_recb`               | String | Fine tax value                                |
    | `vl_txdesconto_recb`            | String | Discount tax value                            |
    | `st_md5_recb`                   | String | MD5 checksum                                  |
    | `id_nota_not`                   | String | Linked invoice ID                             |
    | `st_nf_recb`                    | String | Invoice reference                             |
    | `st_cielotid_recb`              | String | Cielo transaction ID                          |
    | `st_cartaodetalhes_recb`        | String | Card details                                  |
    | `fl_remessastatus_recb`         | String | Bank file (remessa) status flag               |
    | `st_label_recb`                 | String | Charge label                                  |
    | `id_transacao_ctr`              | String | Transaction ID                                |
    | `fl_cieloforcarpagamento_recb`  | String | Force Cielo payment flag                      |
    | `dt_competencia_recb`           | String | Charge competence (accrual) date              |
    | `st_documentoex_recb`           | String | External document reference                   |
    | `fl_acordofrentedecaixa_recb`   | String | Front-desk agreement flag                     |
    | `nm_visto_recb`                 | String | Approved-by number                            |
    | `fl_primeiranotificacao_recb`   | String | First notification sent flag                  |
    | `fl_segundanotificacao_recb`    | String | Second notification sent flag                 |
    | `fl_terceiranotificacao_recb`   | String | Third notification sent flag                  |
    | `fl_quintanotificacao_recb`     | String | Fifth notification sent flag                  |
    | `fl_sextanotificacao_recb`      | String | Sixth notification sent flag                  |
    | `id_filial_fil`                 | String | Branch ID                                     |
    | `st_errocartao_recb`            | String | Card error message                            |
    | `st_tokenfacilitador_recb`      | String | Payment facilitator token                     |
    | `vl_taxacobranca_recb`          | String | Charging fee value                            |
    | `st_cielotidcancelamento_recb`  | String | Cielo cancellation transaction ID             |
    | `st_label_mens`                 | String | Monthly fee label                             |
    | `fl_ignorarbloqueioauto_recb`   | String | Ignore auto-block flag                        |
    | `id_endereco_sen`               | String | Address ID                                    |
    | `id_forma_frecb`                | String | Payment method form ID                        |
    | `st_marcador_recb`              | String | Charge marker/tag                             |
    | `fl_motivocancelar_recb`        | String | Cancellation reason flag                      |
    | `fl_remessastatuscr_recb`       | String | Credit bank file status flag                  |
    | `id_formaboleto_frecb`          | String | Boleto payment form ID                        |
    | `tx_remessamsg_recb`            | String | Bank file (remessa) message                   |
    | `id_adesao_plc`                 | String | Adhesion contract ID                          |
    | `st_motivocanceloutros_recb`    | String | Other cancellation reason                     |
    | `st_tokendaconta_recb`          | String | Account token                                 |
    | `nm_descontoatedia_recb`        | String | Discount valid until day                      |
    | `ar_nomeformas_calc`            | String | Payment method names (calculated field)       |
    | `vl_valorcreditado_calc`        | String | Credited value (calculated field)             |
    | `id_pedido_ped`                 | String | Order ID                                      |
    | `fl_conta_homologada`           | String | Homologated account flag                      |
    | `fl_cofre`                      | String | Vault (card storage) flag                     |
    | `st_descricao_cb`               | String | Bank account description                      |
    | `tipo_conta`                    | String | Account type                                  |
    | `nome_formatado`                | String | Formatted client name (calculated field)      |
    | `publickey`                     | String | Public key for the charge's boleto            |
    | `link_2via`                     | String | Second-copy (2ª via) link for the charge      |
    | `publickey_json`                | String | Public key for the JSON boleto                |
    | `link_2via_json`                | String | Second-copy (2ª via) JSON link for the charge |
    | `comconfirmacaoleitura`         | String | Read confirmation flag                        |
    | `acessovistoonline`             | String | Online view access flag                       |
    | `descontovalorfixo`             | String | Fixed discount value                          |
    | `msgdiasparadesconto`           | String | Discount deadline message                     |
    | `descontoatedia`                | String | Discount valid until date                     |
    | `vl_txdesconto_emp`             | String | Company-level discount tax value              |
    | `vl_txjuros_emp`                | String | Company-level interest tax value              |
    | `vl_txmulta_emp`                | String | Company-level fine tax value                  |
    | `tx_bancaria`                   | String | Bank fee                                      |
  </Accordion>

  <Accordion title="Contratos Ativos">
    Stream for retrieving only the active (non-trial) Superlógica contracts.

    This stream generates an "as of today" snapshot. It is deliberately un-deduplicated (contains no primary keys) to match the external system's exact record counts and preserve pagination artifacts.

    **Fields:**

    | Field                           | Type   | Description                       |
    | :------------------------------ | :----- | :-------------------------------- |
    | `id_sacado_sac`                 | String | Client ID                         |
    | `st_nome_sac`                   | String | Client name                       |
    | `st_nomeref_sac`                | String | Client reference name             |
    | `st_endereco_sac`               | String | Client address                    |
    | `st_complemento_sac`            | String | Address complement                |
    | `st_bairro_sac`                 | String | Neighborhood                      |
    | `st_cidade_sac`                 | String | City                              |
    | `st_estado_sac`                 | String | State                             |
    | `st_pais_sac`                   | String | Country                           |
    | `st_cep_sac`                    | String | ZIP code                          |
    | `st_enderecoentrega_sac`        | String | Delivery address                  |
    | `st_numeroentrega_sac`          | String | Delivery address number           |
    | `st_complementoentrega_sac`     | String | Delivery address complement       |
    | `st_bairroentrega_sac`          | String | Delivery address neighborhood     |
    | `st_cidadeentrega_sac`          | String | Delivery address city             |
    | `st_estadoentrega_sac`          | String | Delivery address state            |
    | `st_paisentrega_sac`            | String | Delivery address country          |
    | `st_cepentrega_sac`             | String | Delivery address ZIP code         |
    | `st_rg_sac`                     | String | RG document                       |
    | `st_cgc_sac`                    | String | CPF/CNPJ document                 |
    | `st_ddd_sac`                    | String | Area code                         |
    | `st_telefone_sac`               | String | Phone number                      |
    | `st_email_sac`                  | String | Email address                     |
    | `fl_status_sac`                 | String | Client status                     |
    | `st_diavencimento_sac`          | String | Due day                           |
    | `st_inscricao_sac`              | String | State registration                |
    | `st_codigocontabil_sac`         | String | Accounting code                   |
    | `st_sincro_sac`                 | String | Synchronization                   |
    | `dt_desativacao_sac`            | String | Deactivation date                 |
    | `dt_congelamento_sac`           | String | Freezing date                     |
    | `dt_ignorarstatus_sac`          | String | Ignore status date                |
    | `st_sincro_sac1`                | String | Synchronization 1                 |
    | `dt_desativacao_sac1`           | String | Deactivation date 1               |
    | `st_numero_sac`                 | String | Number                            |
    | `st_fax_sac`                    | String | Fax number                        |
    | `fl_pagamentopref_sac`          | String | Preferred payment flag            |
    | `fl_pessoajuridica_sac`         | String | Legal entity flag                 |
    | `dt_cadastro_sac`               | String | Registration date                 |
    | `st_identificador_plc`          | String | Client plan identifier            |
    | `st_identificadorextra_plc`     | String | Extra identifier                  |
    | `id_planocliente_plc`           | String | Client plan ID                    |
    | `dt_contrato_plc`               | String | Contract date                     |
    | `dt_cancelamento_plc`           | String | Cancellation date                 |
    | `fl_trial_plc`                  | String | Trial flag                        |
    | `dt_trialinicio_plc`            | String | Trial start date                  |
    | `dt_trialfim_plc`               | String | Trial end date                    |
    | `fl_autocontratar_plc`          | String | Auto contract flag                |
    | `st_emailindicacao_plc`         | String | Referral email                    |
    | `id_vendedor_for`               | String | Seller ID                         |
    | `fl_autorecontratar_plc`        | String | Auto renew flag                   |
    | `nm_parcelasadesao_plc`         | String | Adhesion installments number      |
    | `nm_parcelasrecorrencia_plc`    | String | Recurrence installments number    |
    | `fl_periodicidade_plc`          | String | Contract periodicity flag         |
    | `vl_aproxrenovacao_plc`         | String | Approximate renewal value         |
    | `vl_descontorenovacao_plc`      | String | Renewal discount value            |
    | `dt_ultimarenovacao_recb`       | String | Last renewal date                 |
    | `id_proximarenovacao_recb`      | String | Next renewal ID                   |
    | `fl_primeiropag_plc`            | String | First payment flag                |
    | `id_ticket_tic`                 | String | Ticket ID                         |
    | `fl_diferencacancelamento_plc`  | String | Cancellation difference flag      |
    | `st_nome_cup`                   | String | Coupon name                       |
    | `dt_primeiropag_plc`            | String | First payment date                |
    | `st_frete_plc`                  | String | Shipping                          |
    | `fl_trialdesativado_plc`        | String | Trial deactivated flag            |
    | `fl_tipocancelamento_plc`       | String | Cancellation type flag            |
    | `id_planoclienteorigem_plc`     | String | Origin client plan ID             |
    | `id_plano_pla`                  | String | Plan ID                           |
    | `st_nome_pla`                   | String | Plan name                         |
    | `id_grade_gpl`                  | String | Grade ID                          |
    | `nm_contratofim_pla`            | String | Contract end number               |
    | `fl_autorecontratar_pla`        | String | Auto renew plan flag              |
    | `fl_autocontratar_pla`          | String | Auto contract plan flag           |
    | `fl_periodicidade_pla`          | String | Plan periodicity flag             |
    | `nm_parcelas_pla`               | String | Number of installments            |
    | `st_nome_gpl`                   | String | Grade name                        |
    | `dt_vencimentorenovacao_recb`   | String | Renewal due date                  |
    | `st_nome_fav`                   | String | Beneficiary name                  |
    | `st_fantasia_fav`               | String | Beneficiary trade name            |
    | `id_mensalidade_mens`           | String | Monthly fee ID                    |
    | `id_cliente_mens`               | String | Monthly fee client ID             |
    | `id_empresa_mens`               | String | Company ID                        |
    | `st_descricao_mens`             | String | Monthly fee description           |
    | `st_valor_mens`                 | String | Monthly fee value                 |
    | `st_qntd_mens`                  | String | Monthly fee quantity              |
    | `dt_atualizacao_mens`           | String | Update date                       |
    | `id_produto_prd`                | String | Product ID                        |
    | `id_conta_cb`                   | String | Account ID                        |
    | `fl_online_mens`                | String | Online flag                       |
    | `fl_jan_mens`                   | String | January flag                      |
    | `fl_fev_mens`                   | String | February flag                     |
    | `fl_mar_mens`                   | String | March flag                        |
    | `fl_abr_mens`                   | String | April flag                        |
    | `fl_mai_mens`                   | String | May flag                          |
    | `fl_jun_mens`                   | String | June flag                         |
    | `fl_jul_mens`                   | String | July flag                         |
    | `fl_ago_mens`                   | String | August flag                       |
    | `fl_set_mens`                   | String | September flag                    |
    | `fl_out_mens`                   | String | October flag                      |
    | `fl_nov_mens`                   | String | November flag                     |
    | `fl_dez_mens`                   | String | December flag                     |
    | `fl_periodicidade_mens`         | String | Periodicity flag                  |
    | `dt_inicio_mens`                | String | Monthly fee start date            |
    | `dt_fim_mens`                   | String | Monthly fee end date              |
    | `st_complemento_mens`           | String | Monthly fee complement            |
    | `id_planocliente_plc1`          | String | Client plan ID 1                  |
    | `id_tabela_rta`                 | String | Table ID                          |
    | `nm_diavencimento_mens`         | String | Monthly fee due day               |
    | `id_filial_fil`                 | String | Branch ID                         |
    | `id_vendedor_mens`              | String | Seller ID monthly                 |
    | `st_label_mens`                 | String | Label monthly                     |
    | `dt_importacaofaturamento_mens` | String | Billing import date               |
    | `id_endereco_sen`               | String | Address ID                        |
    | `fl_adicional_mens`             | String | Additional flag                   |
    | `st_identificador_mens`         | String | Monthly identifier                |
    | `fl_fimforcado_mens`            | String | Forced end flag                   |
    | `vl_txjuros_mens`               | String | Interest tax value                |
    | `vl_txmulta_mens`               | String | Fine tax value                    |
    | `vl_txdesconto_mens`            | String | Discount tax value                |
    | `dt_fimantigo_mens`             | String | Old end date                      |
    | `nome_formatado`                | String | Formatted name (calculated field) |
  </Accordion>

  <Accordion title="Contratos Pendentes">
    Stream for retrieving pending Superlógica contracts. Contains the same fields as the `Contratos Ativos` stream.
  </Accordion>

  <Accordion title="Contratos Trial">
    Stream for retrieving trial Superlógica contracts. Contains the same fields as the `Contratos Ativos` stream.
  </Accordion>

  <Accordion title="Despesas (Expenses)">
    Stream for managing expense movements. Hits `/financeiro/caixa` filtered to the expense side.

    | Field                  | Type   | Description                                                                                                                                                               |
    | :--------------------- | :----- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
    | `id_movimentacao_mov`  | String | Expense movement ID. Absent for virtual/projected movements (fl\_virtual\_mov=1); synthesized from id\_contabanco\_mov/id\_origemvirtual\_mov in post\_process for those. |
    | `fl_status_mov`        | String | Movement status flag                                                                                                                                                      |
    | `isrecebimento`        | String | Revenue flag (0=expense, 1=revenue)                                                                                                                                       |
    | `dt_vencimento_mov`    | String | Due date                                                                                                                                                                  |
    | `dt_recebimento_recb`  | String | Receipt date                                                                                                                                                              |
    | `dt_liquidacao_mov`    | String | Settlement (payment) date                                                                                                                                                 |
    | `dt_ordenacao`         | String | Sort date                                                                                                                                                                 |
    | `vl_valor_mov`         | String | Movement value                                                                                                                                                            |
    | `id_contabanco_mov`    | String | Per-movement reference ID (not the bank account ID). Equals id\_origemvirtual\_mov for virtual movements; used as the id\_movimentacao\_mov fallback when absent.         |
    | `id_conta_cb`          | String | Bank account ID                                                                                                                                                           |
    | `id_favorecido_fav`    | String | Beneficiary/payee ID                                                                                                                                                      |
    | `fornecedor_formatado` | String | Formatted supplier/payee name                                                                                                                                             |
  </Accordion>

  <Accordion title="Nota Fiscal (Invoices)">
    Stream from the Superlógica Assinaturas API that retrieves invoices and their corresponding line items.

    | Field           | Type   | Description                                                                                                                                                                                                                                                                                                                             |
    | :-------------- | :----- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
    | `id_sacado_sac` | String | Payer ID                                                                                                                                                                                                                                                                                                                                |
    | `st_nome_sac`   | String | Payer Name                                                                                                                                                                                                                                                                                                                              |
    | `servicos`      | String | Service line items of the invoice as a JSON-encoded array - one entry per service sold, with product/service ID (id\_produto\_prd/codigo), description, quantity, unit value, line total and municipal service code data. Kept as a JSON string so sub-field changes on the Superlógica side don't trigger downstream schema evolution. |
    | `produtos`      | String | Product line-item arrays                                                                                                                                                                                                                                                                                                                |
    | `erros`         | String | Transmission errors                                                                                                                                                                                                                                                                                                                     |
  </Accordion>

  <Accordion title="Planos">
    Stream for managing subscription plans.
  </Accordion>

  <Accordion title="Produtos e Serviços">
    Stream for managing products and services.
  </Accordion>

  <Accordion title="Receitas Eventuais">
    Stream for managing eventual (one-off) revenues.
  </Accordion>
</AccordionGroup>

## Data Model

The following diagram illustrates the relationships between the core data streams in Superlógica Assinaturas. The arrows indicate the join keys that link the different entities.

```mermaid theme={null}
graph TD;
    subgraph "Core Entities"
        Clients("Clients");
        Assinaturas("Assinaturas");
        Cobrancas("Cobranças");
        AssinaturasMRR("Assinaturas MRR");
        ContratosAtivos("Contratos Ativos");
        NotaFiscal("Nota Fiscal");
    end

    Assinaturas -- "id_sacado_sac" --> Clients;
    AssinaturasMRR -- "id_sacado_sac" --> Clients;
    AssinaturasMRR -- "id_planocliente_plc" --> Assinaturas;
    ContratosAtivos -- "id_sacado_sac" --> Clients;
    NotaFiscal -- "id_sacado_sac" --> Clients;
    Cobrancas -- "id_sacado_sac" --> Clients;

## Implementation Notes

### Despesas Stream Behavior

For the `Despesas` stream, virtual/projected movements (`fl_virtual_mov="1"`) do not naturally contain an `id_movimentacao_mov` field in the API response. To avoid dropping this data, the connector synthesizes the primary key for these records using the `id_contabanco_mov` or `id_origemvirtual_mov` field.

### Data Sync Behavior

- **Nota Fiscal API Window**: Without explicitly provided start and end dates (`dtInicio`/`dtFim`), the Superlógica Assinaturas API silently applies a restrictive default date window when fetching the Nota Fiscal stream. To prevent massive data gaps, the connector automatically applies wide range filters under the hood to guarantee that all invoice records are thoroughly fetched.
- **Nested Schema Flattening**: The `servicos` field in the **Nota Fiscal** stream is emitted as a JSON-encoded string instead of an array of objects. This ensures that any sub-field changes made on the Superlógica side do not trigger downstream schema evolutions or failures in your Lakehouse. Ensure you use JSON extraction functions in your queries if you wish to analyze the underlying fields.

### Deduplication and Sync Behavior

- **Contratos Ativos**: This stream intentionally does not declare any primary keys. By avoiding deduplication, the table reflects the exact raw row output from the source (including any identical records arising from the source's pagination artifacts), ensuring the total row count precisely matches what the external system reports for active, non-trial contracts "as of today". When syncing this stream, it is recommended to use the **Full table** sync type so the entire target table is replaced in each run, preserving the source's original counts.

### API Limits & Behavior

- **Page Size Limits:** Superlógica's maximum allowed page size is `200` items. Requests exceeding this limit will be rejected by the API. The connector strictly adheres to this to avoid extraction failures.
- **Data Completeness & Windowing:** Several Superlógica endpoints (like contracts) silently default to "as of today" snapshots if specific date filters are not provided. Attempting to pass extremely large date ranges results in API timeouts. To prevent massive data undercounting, the connector implements specialized **year-by-year windowed pagination** (starting from 2015) to guarantee the safe and complete extraction of your account's entire history.
- **Charges History:** The `cobrancas` endpoint utilizes an internal bypass parameter (`semFiltroPorData=true`) to override restrictive API defaults, ensuring all historical records are retrieved.
- **Transient Routing Errors:** Superlógica's API gateway may occasionally return an HTTP 404 error with the body message `Could not route request`. This represents a known backend routing hiccup, not a missing endpoint. The connector automatically treats this specific error as a transient issue and safely retries the request, preventing momentary network blips from aborting an otherwise successful extraction (such as during large syncs).
- **Disjoint Datasets:** Some financial streams, such as `receitas_eventuais` (composition/one-off revenues), split data into mutually exclusive sets. The connector automatically cycles through these disjoint structures to form a single cohesive table for you.
```
