# Migrate from SintegraWS

> How to replace the SintegraWS RF, ST, SN and SF plugins with the Lookup CNPJ operation of the CNPJá API, in one request: parameters, fields and errors.

This guide shows how to move an integration with the SintegraWS API to the CNPJá API: operations, parameters, response fields and behavior differences.

## Overview

- The SintegraWS `RF`, `ST`, `SN` and `SF` plugins become a single operation, [Lookup CNPJ](https://cnpja.com/en-us/docs/api/reference#tag/establishments/GET/v2/establishments/%7btaxId%7d). The plugin is replaced by optional resources in `expand`, and one request can bring all of them.
- The token leaves the query string and goes, on its own, in the `Authorization` header.
- The HTTP status now gives the result. Only errors carry `status`, `code` and `message` in the body, and `code` is stable text, such as `ESTABLISHMENT_NOT_FOUND`, instead of a number.
- Values are no longer formatted: CNPJ, CEP and CNAE without punctuation, `YYYY-MM-DD` dates, numeric share capital, E.164 phones and classifications as `code` and `label` pairs.
- You choose the maximum data age with `maxAge`, and billing separates cached queries from live queries.
- Looking up a state registration by its number has no equivalent.

Effort: medium. Switching the URL and authentication is small; most of the work is rewriting the field mapping and the error handling.

## Prerequisites

- **Account and key:** [sign up](https://cnpja.com/en-us/signup) and create a key in [API keys](https://cnpja.com/en-us/organizations/current/api-keys). The walkthrough is in [First request](https://cnpja.com/en-us/docs/api/first-request).
- **Authentication:** send the key as the entire value of the `Authorization` header, with no prefix: `Authorization: YOUR_API_KEY`. With `Bearer`, the request is rejected with `401` `API_KEY_INVALID`. See [Authentication](https://cnpja.com/en-us/docs/api/reference#description/authentication) and [Keys and security](https://cnpja.com/en-us/docs/api/authentication).
- **Base URL:** `https://api.cnpja.com/v2`.
- **What changes:** nothing from the SintegraWS account carries over. The token and the credits purchased there don't work at CNPJá, and usage now follows your organization's plan quotas, renewed every month.

## Matching operations

| SintegraWS | CNPJá | Notes |
|---|---|---|
| `execute-api.php` with `plugin=RF` | [Lookup CNPJ](https://cnpja.com/en-us/docs/api/reference#tag/establishments/GET/v2/establishments/%7btaxId%7d) | No `expand`. See [CNPJ lookup](https://cnpja.com/en-us/docs/api/cnpj-lookup). |
| `execute-api.php` with `plugin=ST` and `cnpj` | [Lookup CNPJ](https://cnpja.com/en-us/docs/api/reference#tag/establishments/GET/v2/establishments/%7btaxId%7d) with `expand=stateRegistry` | State registrations from the [CCC](https://dfe-portal.svrs.rs.gov.br/Nfe/Ccc). See [State registrations](https://cnpja.com/en-us/docs/api/state-registrations). |
| `execute-api.php` with `plugin=ST`, `ie` and `uf` | No equivalent | The API doesn't look up by state registration number. |
| `execute-api.php` with `plugin=SN` | [Lookup CNPJ](https://cnpja.com/en-us/docs/api/reference#tag/establishments/GET/v2/establishments/%7btaxId%7d) with `expand=company.taxRegime` | With `company.taxRegime.view=DETAILED` for previous periods and future events. See [Tax regime](https://cnpja.com/en-us/docs/api/tax-regime). |
| `execute-api.php` with `plugin=SF` | [Lookup CNPJ](https://cnpja.com/en-us/docs/api/reference#tag/establishments/GET/v2/establishments/%7btaxId%7d) with `expand=suframa` | [SUFRAMA registrations](https://www4.suframa.gov.br/cadsuf/#/menu-externo). See [SUFRAMA](https://cnpja.com/en-us/docs/api/suframa). |
| `url_comprovante` from the `SF` plugin | [Issue CNPJ dossier](https://cnpja.com/en-us/docs/api/reference#tag/establishments/GET/v2/establishments/%7btaxId%7d/dossier) with `certificates=SUFRAMA_REGISTRATION` | Returns the PDF directly, with no temporary URL. See [Certificates](https://cnpja.com/en-us/docs/api/certificates). |
| `cnpjs_do_grupo` from the `RF` plugin | [Lookup company](https://cnpja.com/en-us/docs/api/reference#tag/companies/GET/v2/companies/%7bid%7d) | By the 8-character CNPJ root; lists the establishments in `establishments`. |

## Request example

SintegraWS, `RF` plugin:

```http
GET /api/v1/execute-api.php?token=YOUR_TOKEN&cnpj=37335118000180&plugin=RF HTTP/1.1
Host: www.sintegraws.com.br
```

CNPJá:

```http
GET /v2/establishments/37335118000180 HTTP/1.1
Host: api.cnpja.com
Authorization: YOUR_API_KEY
```

CNPJá, with the `RF`, `ST`, `SN` and `SF` plugins in a single request:

```http
GET /v2/establishments/37335118000180?expand=company.taxRegime,stateRegistry,suframa HTTP/1.1
Host: api.cnpja.com
Authorization: YOUR_API_KEY
```

## Parameters

| SintegraWS | CNPJá | Notes |
|---|---|---|
| `token` | `Authorization` header | Key with no prefix. |
| `cnpj` | `taxId` in the path | 14 characters without punctuation; uppercase letters are accepted for alphanumeric CNPJs. |
| `plugin=RF` | No `expand` | The CNPJ registration always comes back. |
| `plugin=ST` | `expand=stateRegistry` | `stateRegistry.states` picks the UFs: `ORIGIN` (default), UFs such as `SP`, or `ALL`. `stateRegistry.view=DETAILED` adds the address, activity and dates of each registration. |
| `plugin=SN` | `expand=company.taxRegime` | `company.taxRegime.view=DETAILED` adds `timeline` and, for `SIMPLES_NACIONAL_HYBRID`, `regularIbsStartDate` and `regularCbsStartDate`. |
| `plugin=SF` | `expand=suframa` | |
| `ie` | No equivalent | |
| `uf` | No equivalent | It only existed for the `ie` lookup. To choose the UFs of a CNPJ's registrations, use `stateRegistry.states`. |
| No equivalent | `maxAge` | Maximum accepted data age, default `45d`. See [Max age and partial success](https://cnpja.com/en-us/docs/api/max-age). |
| No equivalent | `company.taxRegime.maxAge`, `stateRegistry.maxAge`, `suframa.maxAge` | Maximum age for a single resource; requires the resource in `expand`. |

Send multiple `expand` values comma-separated or by repeating the parameter. See [Response expansion](https://cnpja.com/en-us/docs/api/reference#description/response-expansion).

## Response fields

In the tables, CNPJá paths are relative to the Lookup CNPJ response, unless stated otherwise.

### Request control

| SintegraWS | CNPJá | Notes |
|---|---|---|
| `code`, `status`, `message` | HTTP status and, for errors, `code` and `message` | See the code table under Behavior differences. |
| `ultima_atualizacao` (`RF` plugin) | `updatedAt` | ISO 8601 date-time in UTC, instead of `dd/mm/aaaa hh:mm:ss`. |
| `cache` (`RF` plugin) | No equivalent | The maximum age is the one you ask for in `maxAge`, and each resource reports its last update in its own `updatedAt`. |
| `extra` | No equivalent | |

### Identification and status (RF plugin)

| SintegraWS | CNPJá | Notes |
|---|---|---|
| `cnpj` | `taxId` | No punctuation. |
| `tipo` | `type.code` | `MATRIZ` becomes `HEAD`; `FILIAL` becomes `BRANCH`. |
| `abertura` | `incorporationDate` | `YYYY-MM-DD`. |
| `nome` | `company.legalName` | |
| `fantasia` | `tradeName` | `null` when there is no trade name. |
| `situacao` | `status.code` | See the code table below. |
| `data_situacao` | `statusDate` | `YYYY-MM-DD`. |
| `motivo_situacao` | `statusReason.code`, `statusReason.label` | Present only when the establishment is not active. |
| `situacao_especial` | `specialStatus.code`, `specialStatus.label` | Present only when there is a special status. |
| `data_situacao_especial` | `specialStatusDate` | Same condition as `specialStatus`. |

| `situacao` | `status.code` |
|---|---|
| `ATIVA` | `ACTIVE` |
| `BAIXADA` | `CLOSED` |
| `INAPTA` | `NONCOMPLIANT` |
| `SUSPENSA` | `SUSPENDED` |
| `NULA` | `VOID` |

### Address and contacts (RF plugin)

| SintegraWS | CNPJá | Notes |
|---|---|---|
| `logradouro` | `address.street` | |
| `tipo_logradouro` | No equivalent | |
| `numero` | `address.number` | |
| `complemento` | `address.details` | |
| `bairro` | `address.district` | |
| `municipio` | `address.city` | |
| `uf` | `address.state` | |
| `cep` | `address.postalCode` | 8 digits, instead of `00.000-000`. |
| `ibge.codigo_municipio` | `address.municipality` | 7 digits. |
| `ibge.codigo_uf` | No equivalent | The UF comes as an abbreviation in `address.state`. |
| `telefone` | `phones[].number` | A list; each number in E.164, such as `+551123958400`, with the type in `phones[].type.code`. |
| `email` | `emails[].address` | A list, with the type in `emails[].type.code`. |

### Activities (RF plugin)

| SintegraWS | CNPJá | Notes |
|---|---|---|
| `atividade_principal[0].code` | `primaryActivity.code` | An object, instead of a one-item list. 7-digit [CNAE](https://concla.ibge.gov.br/busca-online-cnae.html?view=estrutura). |
| `atividade_principal[0].text` | `primaryActivity.label` | |
| `atividades_secundarias[].code` | `secondaryActivities[].code` | 7-digit CNAE, without punctuation. |
| `atividades_secundarias[].text` | `secondaryActivities[].label` | |

### Company and partners (RF plugin)

| SintegraWS | CNPJá | Notes |
|---|---|---|
| `natureza_juridica` | `company.legalNature.code`, `company.legalNature.label` | `206-2 - Sociedade Empresária Limitada` becomes `2062` and a separate label. |
| `sigla_natureza_juridica` | No equivalent | |
| `porte` | `company.size.code` | `ME` becomes `MICRO`; `EPP` becomes `SMALL`; `DEMAIS` becomes `OTHER`. |
| `capital_social` | `company.shareCapital` | A number, such as `56758501`, instead of formatted text. |
| `efr` | `company.federativeEntity.code`, `company.federativeEntity.label` | Present only for public-administration [legal natures](https://concla.ibge.gov.br/estrutura/natjur-estrutura/natureza-juridica-2021). |
| `qsa[]` | `company.partners[]` | See [Partners and people](https://cnpja.com/en-us/docs/api/partners). |
| `qsa[].nome` | `company.partners[].person.legalName` | |
| `qsa[].qual` | `company.partners[].role.code`, `company.partners[].role.label` | `37-Sócio Pessoa Jurídica Domiciliado no Exterior` becomes `37` and a separate label. |
| `qsa[].pais_origem` | `company.partners[].person.domicileCountry.code`, `.label` | Two-letter country code, such as `US`, present for every partner, not only foreign ones. |
| `qsa[].nome_rep_legal` | `company.partners[].legalRepresentative.person.legalName` | `legalRepresentative` exists only when there is a representative, instead of empty text. |
| `qsa[].qual_rep_legal` | `company.partners[].legalRepresentative.role.code`, `.label` | |
| `cnpjs_do_grupo[].cnpj` | `establishments[].taxId` in Lookup company | |
| `cnpjs_do_grupo[].uf` | `establishments[].address.state` in Lookup company | |
| `cnpjs_do_grupo[].tipo` | `establishments[].type.code` in Lookup company | `HEAD` or `BRANCH`. |

Partners also carry fields with no SintegraWS counterpart, such as `person.type`, `person.taxId` (masked CPF or CNPJ), `person.ageGroup`, `admissionDate` and `person.id`.

### State registrations (ST plugin)

With `expand=stateRegistry`. Fields marked DETAILED require `stateRegistry.view=DETAILED`.

| SintegraWS | CNPJá | Notes |
|---|---|---|
| `cnpj` | `taxId` | |
| `nome_empresarial` | `company.legalName` | |
| `nome_fantasia` | `tradeName` | |
| `situacao_cnpj` | `stateRegistry.registrations[].hasRestriction` | Boolean for a restriction as recipient in the UF: `false` when the source returns `Sem restrição`. The CNPJ status at the [Receita Federal](https://solucoes.receita.fazenda.gov.br/Servicos/cnpjreva/) is in `status.code`. |
| `porte_empresa` | `company.size.code` | |
| `inscricao_estadual` | `stateRegistry.registrations[].number` | |
| `uf` | `stateRegistry.registrations[].state` | |
| `tipo_inscricao` | `stateRegistry.registrations[].type.code`, `.label` | |
| `contribuinte_icms` | `stateRegistry.registrations[].type.code` | There is no boolean: the type separates, for example, a taxpayer (`STATE_TAXPAYER`) from a non-taxpayer (`NON_TAXPAYER`). |
| `situacao_ie` | `stateRegistry.registrations[].isEnabled` | Boolean for an enabled registration; doesn't separate `Inativo` from `Baixado`. |
| `situacao_ie_desc` | No equivalent | |
| `data_situacao_cadastral` | `stateRegistry.registrations[].statusDate` | `YYYY-MM-DD`, instead of `dd-MM-yyyy`. |
| `informacao_ie_como_destinatario` | No equivalent | |
| `data_inicio_atividade` | `stateRegistry.registrations[].activityStartDate` | DETAILED. |
| `data_fim_atividade` | `stateRegistry.registrations[].activityEndDate` | DETAILED. |
| `cnae_principal.code`, `cnae_principal.text` | `stateRegistry.registrations[].primaryActivity.code`, `.label` | DETAILED. |
| `logradouro`, `numero`, `complemento`, `bairro` | `stateRegistry.registrations[].address.street`, `.number`, `.details`, `.district` | DETAILED. |
| `municipio`, `cep` | `stateRegistry.registrations[].address.city`, `.postalCode` | DETAILED. |
| `ibge.codigo_municipio` | `stateRegistry.registrations[].address.municipality` | DETAILED. |
| `ibge.codigo_uf` | No equivalent | |
| `regime_tributacao` | `stateRegistry.registrations[].hasExceededSublimit` | DETAILED. A boolean, instead of text: `true` when the CCC regime indicates an exceeded sublimit, and `false` for the others, such as the normal one. |
| `outras_ies[]` | The other items of `stateRegistry.registrations[]` | Request the UFs in `stateRegistry.states`, or `ALL`. |
| `outras_ies[].inscricao_estadual`, `.uf`, `.situacao_ie` | `stateRegistry.registrations[].number`, `.state`, `.isEnabled` | |

### Simples Nacional (SN plugin)

With `expand=company.taxRegime`. `timeline` requires `company.taxRegime.view=DETAILED`.

| SintegraWS | CNPJá | Notes |
|---|---|---|
| `cnpj` | `taxId` | |
| `cnpj_matriz` | No direct field | In Lookup company, the head office is the `establishments[]` item whose `type.code` is `HEAD`. |
| `nome_empresarial` | `company.legalName` | |
| `situacao_simples_nacional` | `company.taxRegime.type.code`, `company.taxRegime.simplesNacionalStartDate` | `SIMPLES_NACIONAL`, `SIMPLES_NACIONAL_HYBRID` or `SIMPLES_NACIONAL_SIMEI` for optants, with `SIMPLES_NACIONAL_HYBRID` for those that also opt into the IBS or CBS regular regime; start of the current period, present only for these codes. |
| `situacao_simei` | `company.taxRegime.type.code`, `company.taxRegime.simeiStartDate` | `SIMPLES_NACIONAL_SIMEI` for optants; start of the current period, present only for `SIMPLES_NACIONAL_SIMEI`. |
| `situacao_simples_nacional_anterior` | `company.taxRegime.timeline[]` with `type.code` equal to `SIMPLES_NACIONAL_PERIOD` | Each period with `startDate`, `endDate` and `details`. |
| `situacao_simei_anterior` | `company.taxRegime.timeline[]` with `type.code` equal to `SIMEI_PERIOD` | |
| `eventos_futuros_simples_nacional` | `company.taxRegime.timeline[]` with `type.code` equal to `SIMPLES_NACIONAL_INCLUSION` or `SIMPLES_NACIONAL_EXCLUSION` | |
| `eventos_futuros_simples_simei` | `company.taxRegime.timeline[]` with `type.code` equal to `SIMEI_EXCLUSION` | |
| `agendamentos` | No equivalent | |

When `company.taxRegime.type.code` is `SIMPLES_NACIONAL_HYBRID`, `company.taxRegime.view=DETAILED` also returns `company.taxRegime.regularIbsStartDate` and `company.taxRegime.regularCbsStartDate`, the start of the current IBS and CBS regular regime periods, which come only from live queries at the Simples Nacional. Either may be `null` when the company opts into only one of the two. The previous periods and upcoming events of these regimes come in `company.taxRegime.timeline[]` with `type.code` equal to `REGULAR_IBS_PERIOD`, `REGULAR_IBS_OPTION`, `REGULAR_IBS_OPTION_CANCELLATION`, `REGULAR_CBS_PERIOD`, `REGULAR_CBS_OPTION` or `REGULAR_CBS_OPTION_CANCELLATION`.


### SUFRAMA (SF plugin)

With `expand=suframa`.

| SintegraWS | CNPJá | Notes |
|---|---|---|
| `cnpj` | `taxId` | |
| `razao_social`, `nome_empresarial` | `company.legalName` | |
| `inscricao_suframa` | `suframa.registrations[].number` | A list, instead of a single registration. |
| `situacao_cadastral` | `suframa.registrations[].status.code` | `ACTIVE`, `INACTIVE`, `BLOCKED` or `CANCELLED`. |
| `data_validade_cadastral` | No equivalent | |
| `endereco_eletronico` | `suframa.registrations[].emails[].address` | A list. |
| `telefone` | `suframa.registrations[].phones[].number` | A list, in E.164. |
| `natureza_juridica.codigo`, `.descricao` | `company.legalNature.code`, `.label` | Comes from the Receita Federal registration. |
| `endereco.logradouro`, `.numero`, `.complemento`, `.bairro` | `suframa.registrations[].address.street`, `.number`, `.details`, `.district` | |
| `endereco.municipio`, `.uf`, `.cep` | `suframa.registrations[].address.city`, `.state`, `.postalCode` | |
| `atividade_principal`, with `codigo` and `descricao` | `suframa.registrations[].primaryActivity.code`, `.label` | 7-digit CNAE, instead of 17. |
| `atividades_secundarias[]`, with `code` and `text`, or `atividade_secundaria[]`, with `codigo` and `descricao` | `suframa.registrations[].secondaryActivities[].code`, `.label` | 7-digit CNAE, instead of 17. |
| `atividade_exercida` of the primary and secondary activities | No equivalent | |
| `incentivos[]` | [Mapa dos Incentivos Fiscais](https://www.gov.br/suframa/pt-br/zfm/mapa-dos-incentivos-fiscais-ultima-versao-28-09.xlsx) | SUFRAMA no longer publishes the incentives of each registration and now points to this official spreadsheet, so the API doesn't return them. The criteria SUFRAMA applied are in [Estimate incentives](https://cnpja.com/en-us/docs/data/suframa#incentives), to estimate the incentives and confirm them in the spreadsheet. |
| `url_comprovante` | Issue CNPJ dossier with `certificates=SUFRAMA_REGISTRATION` | The PDF in the response, instead of a URL valid for 10 minutes. |

Each registration also carries `registrationDate`, `hasApprovedProject`, `approvalDate` and `updatedAt`, with no SintegraWS counterpart.

## Behavior differences

### Freshness and caching

In CNPJá, each resource comes from the cache while it is within `maxAge` and is queried live, before the response, when it is older or was never fetched. `maxAge` ranges from `5m` to `1y`, with a `45d` default, and each resource reports its last update in its own `updatedAt`. Each resource also accepts a limit of its own, such as `stateRegistry.maxAge`. See [Max age and partial success](https://cnpja.com/en-us/docs/api/max-age).

### Partial success

When a live query fails or runs past its [time limit](https://cnpja.com/en-us/docs/api/limits-and-errors#timeout-and-size), the response is `206`, with the same shape as `200`: the affected resource keeps its cached data, or comes back empty if it was never fetched, and is not billed. With no cached data to fall back on, such as on a CNPJ's first lookup, the request fails instead of returning `206`. Treat `206` as success and compare each resource's `updatedAt` with the limit you asked for. See [Partial success](https://cnpja.com/en-us/docs/api/reference#description/partial-success).

### Errors

SintegraWS reports the result in `code`, `status` and `message` in the body; in CNPJá, the HTTP status gives the result. Every error body carries `status`, `code`, `message` and `traceId`. Handle errors by `code`, which is stable, and use `message` for display only. See [Limits and errors](https://cnpja.com/en-us/docs/api/limits-and-errors).

| SintegraWS `code` | CNPJá |
|---|---|
| `0` Pesquisa realizada com sucesso | `200`, or `206` on partial success |
| `1` not registered at the Receita Federal (`RF` plugin) | `404` `ESTABLISHMENT_NOT_FOUND` |
| `1` not registered at SINTEGRA (`ST` plugin) | `200` with an empty `stateRegistry.registrations` |
| `1` not registered at SUFRAMA (`SF` plugin) | `200` with an empty `suframa.registrations` |
| `2` Invalid CNPJ | `400` `REQUEST_VALIDATION_FAILED` |
| `3` Invalid token | `401` `API_KEY_MISSING`, `API_KEY_INVALID` or `API_KEY_REVOKED` |
| `5` Credits exhausted | `402`, when the month's quota or the overage budget is used up, with one of the codes in [Error codes](https://cnpja.com/en-us/docs/api/limits-and-errors#error-codes). The ways out are in [Quota used up](https://cnpja.com/en-us/docs/billing/quota-exhausted#ways-out) |
| `6` Plugin doesn't exist | `400` `REQUEST_VALIDATION_FAILED`, with `errors[].code` equal to `ENUM`, for an invalid `expand` value |
| `7` Source instability | `206` with the cached resource; with no cache, the request fails and should be retried later |
| `8` Internal error | `500` `UNEXPECTED_ERROR` |


### Limits

With a key, the requests-per-second and concurrent-request limits apply to the whole organization, across all of its keys, and follow its plan; without a key, they apply to each source IP. The values are in [Usage limits](https://cnpja.com/en-us/docs/api/limits-and-errors#usage-limits). Above them, the response is `429`, not billed. Each request has a maximum duration, and the client timeout must stay above it, as shown in [Timeout and size](https://cnpja.com/en-us/docs/api/limits-and-errors#timeout-and-size).

### Billing

Each resource in the response is billed separately, as a live query, which costs more, or a cached query, and each unit has its own quota in the plan, renewed every month. On Pro, the quota of each unit can grow with [packs](https://cnpja.com/en-us/docs/billing/packs-and-budget#packs), and the organization can set a budget to pay for each query beyond the quota at the per-query overage price, so an exhausted quota does not have to stop the integration. When a quota runs out with no overage budget, or the month's budget runs out, every request made with one of the organization's keys gets `402`, as explained in [Quota used up](https://cnpja.com/en-us/docs/billing/quota-exhausted#api); on Free, which has no packs or budget, this happens as soon as the quota runs out. Requests without a key, rejected requests and server failures are not billed, as listed in [What is not charged](https://cnpja.com/en-us/legal/metering#not-charged). Requesting the `RF`, `ST`, `SN` and `SF` plugins in one request bills the registration, `company.taxRegime`, `stateRegistry` and `suframa` separately. With `stateRegistry.view=DETAILED`, billing grows with the registrations and the requested UFs. A `404` is billed too, as detailed in [What is charged even without a useful result](https://cnpja.com/en-us/legal/metering#charged-without-result). Responses carry no cost headers: track usage under [Usage](https://cnpja.com/en-us/organizations/current/usage). See [Queries and quota](https://cnpja.com/en-us/docs/billing/queries-and-quotas), what each operation consumes in the [Metering Rules](https://cnpja.com/en-us/legal/metering#api) and [Pricing](https://cnpja.com/en-us/pricing).

### Language and labels

`label` values and error messages come in Portuguese by default; send `Accept-Language: en-US` to get them in English. Codes, field names and official source data are never translated. Use `code` in your logic and `label` for display only. See [Language](https://cnpja.com/en-us/docs/api/reference#description/language).

### Missing values

Where SintegraWS returns empty or masked text, such as `********`, CNPJá returns `null`, an empty list or omits the field, depending on the case. See [Response format](https://cnpja.com/en-us/docs/api/responses).

## No equivalent

- Lookup by state registration number (`ie` with `uf`).
- The sandbox CNPJ. Validate the integration with real CNPJs, using the key.
- The temporary certificate URL (`url_comprovante`). Issue CNPJ dossier returns the PDF in the response.
- SUFRAMA `data_validade_cadastral`.
- `sigla_natureza_juridica`, `tipo_logradouro`, `situacao_ie_desc`, `informacao_ie_como_destinatario`, `agendamentos`, `ibge.codigo_uf` and `extra`.
- The other SintegraWS APIs, such as Receita Federal CPF, SII RUT, Consulta Saldo and Validação Dados Bancários.

## Step by step

1. Create the account and an API key, as in [First request](https://cnpja.com/en-us/docs/api/first-request).
2. Replace `execute-api.php` with `GET https://api.cnpja.com/v2/establishments/` followed by the CNPJ without punctuation.
3. Remove `token` from the URL and send the key in the `Authorization` header, with no prefix.
4. Replace each `plugin` with the matching `expand` value, and merge into one request the plugins you called in sequence for the same CNPJ.
5. Set `maxAge` and each resource's own limit according to how current the data must be.
6. Rewrite the response parsing with the tables above, using `code` instead of text and converting dates, CEP, phones and share capital.
7. Handle errors by HTTP status and `code`, accept `206` as success, and retry `429`, `500` and `504` with a delay.
8. Review the flows that looked up by state registration number, which have no equivalent.
9. Validate the integration with the key, including the `expand` resources, and follow usage in [Usage](https://cnpja.com/en-us/organizations/current/usage).
10. Move traffic gradually and compare responses before turning off the SintegraWS integration.

## Sources for this comparison

What this page says about SintegraWS comes from its public documentation:

- API Receita Federal: the `RF` plugin, the request parameters, the registration fields and the response codes.
- API SINTEGRA: the `ST` plugin and the state registration fields.
- API Simples Nacional: the `SN` plugin and the Simples Nacional and SIMEI fields.
- API SUFRAMA: the `SF` plugin and the SUFRAMA registration fields.
- SintegraWS APIs: the API catalog.

Sources accessed on November 19, 2026.

Third-party trademarks on this page are used only to identify them, with no affiliation or endorsement ([Terms of Use](https://cnpja.com/en-us/legal/terms#data)).
