# Simples Nacional, MEI and tax regime in the API

> Get a CNPJ's tax regime, Simples Nacional and SIMEI opt-in, history and certificate via the API, and search companies by tax regime.

> **Tip:** Concepts on this page: [Tax regime](https://cnpja.com/en-us/docs/data/tax-regime), [Data freshness](https://cnpja.com/en-us/docs/data/freshness) and [Certificates](https://cnpja.com/en-us/docs/data/certificates).

The API returns the company's current [tax regime](https://cnpja.com/en-us/docs/glossary#regime-tributário--tax-regime), which also identifies an MEI, its Simples Nacional and SIMEI start dates and, on request, its IBS and CBS regular regime start dates and the history of previous periods and upcoming events. The regime is part of the company data and always requires an [API key](https://cnpja.com/en-us/docs/api/first-request). What each regime means and how CNPJá determines it are in [Tax regime](https://cnpja.com/en-us/docs/data/tax-regime).

> **Important:** this page describes the data and does not constitute tax, accounting or legal advice, as the [Terms of Use](https://cnpja.com/en-us/legal/terms#data) state.

## Request

The regime appears in three operations:

| Operation | Field | History and IBS/CBS dates | Updates |
|---|---|---|---|
| [Lookup CNPJ](https://cnpja.com/en-us/docs/api/reference#tag/establishments/GET/v2/establishments/%7btaxId%7d) | `company.taxRegime`, with `expand=company.taxRegime` | With `company.taxRegime.view=DETAILED` | A live query or cached data, depending on age |
| [Lookup company](https://cnpja.com/en-us/docs/api/reference#tag/companies/GET/v2/companies/%7bid%7d) | `taxRegime`, always present | No | Cached data only |
| [Search CNPJ](https://cnpja.com/en-us/docs/api/reference#tag/establishments/GET/v2/establishments) | `company.taxRegime` in each record, and in the `company.taxRegime.*` filters | No | Cached data only |

The Search CNPJ filters are in [Search by regime](#search-by-regime).

### Lookup CNPJ

The regime is an optional resource: request it in `expand`, as explained in [CNPJ lookup](https://cnpja.com/en-us/docs/api/cnpj-lookup). Without it, `company.taxRegime` is absent from the response.

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

| Parameter | Values | Effect |
|---|---|---|
| `company.taxRegime.view` | `SUMMARY` (default) or `DETAILED` | `SUMMARY` returns the regime type and the Simples Nacional and SIMEI start dates. `DETAILED` adds the IBS and CBS regular regime start dates, in `regularIbsStartDate` and `regularCbsStartDate`, and the history in `timeline` |
| `company.taxRegime.maxAge` | A duration, such as `1d` or `30d` | [Max age](https://cnpja.com/en-us/docs/glossary#idade-máxima--maximum-data-age) accepted for the regime only, instead of `maxAge` |

- Both are accepted only with `company.taxRegime` in `expand`. Without it, the request is rejected with `400` `REQUEST_VALIDATION_FAILED`, and `errors` includes an item with the `DEPENDENCIES` code, as shown in [Limits and errors](https://cnpja.com/en-us/docs/api/limits-and-errors).
- `company.taxRegime` can be requested together with other resources, as in `expand=company.taxRegime,stateRegistry`.
- Requests without a key do not accept `expand`, so the regime is not available through [Public access](https://cnpja.com/en-us/docs/api/public-access).

### Lookup company

Lookup company takes the CNPJ root, the first 8 characters, and always returns the regime in `taxRegime`, at the `SUMMARY` level, with no additional parameters:

```http
GET /v2/companies/37335118 HTTP/1.1
Host: api.cnpja.com
Authorization: YOUR_API_KEY
```

The operation uses cached data only and does not accept `maxAge`. To update the regime, look up one of the company's CNPJs in Lookup CNPJ, as described in [Sources and updates](#sources-and-updates).

## Response fields

Lookup CNPJ response, trimmed to the regime fields:

```json
{
  "taxId": "37335118000180",
  "company": {
    "id": "37335118",
    "legalName": "CNPJA TECNOLOGIA LTDA",
    "taxRegime": {
      "updatedAt": "2026-01-27T03:00:00.000Z",
      "type": { "code": "PRESUMED_PROFIT", "label": "Lucro Presumido" }
    }
  }
}
```

The same fields appear in `taxRegime` in Lookup company and in `company.taxRegime` in each Search CNPJ record:

| Field | Content |
|---|---|
| `updatedAt` | Date and time of the last update of the regime, never `null`. For a company never read in the Simples Nacional, it is the date of the registry or ECF reading that set the regime |
| `type` | Regime type, with `code` and `label`, described in [Codes and values](#codes-and-values) |
| `simplesNacionalStartDate` | Start of the current Simples Nacional period, or `null`. Present only when `type.code` is `SIMPLES_NACIONAL`, `SIMPLES_NACIONAL_HYBRID` or `SIMPLES_NACIONAL_SIMEI`; for other regimes, it is absent |
| `simeiStartDate` | Start of the current SIMEI period, or `null`. Present only when `type.code` is `SIMPLES_NACIONAL_SIMEI`; for other regimes, it is absent |
| `regularIbsStartDate` | Start of the current IBS regular regime period, or `null`. Present only when `type.code` is `SIMPLES_NACIONAL_HYBRID`, and only in Lookup CNPJ with `company.taxRegime.view=DETAILED` |
| `regularCbsStartDate` | Start of the current CBS regular regime period, or `null`. Present only when `type.code` is `SIMPLES_NACIONAL_HYBRID`, and only in Lookup CNPJ with `company.taxRegime.view=DETAILED` |
| `timeline` | History of previous periods and upcoming events. Present only in Lookup CNPJ with `company.taxRegime.view=DETAILED` |

- An MEI has `type.code` set to `SIMPLES_NACIONAL_SIMEI`, and a Simples Nacional hybrid optant has `SIMPLES_NACIONAL_HYBRID`: neither has `SIMPLES_NACIONAL`. To cover every Simples Nacional optant, check all three codes, as explained in [MEI and hybrid Simples](https://cnpja.com/en-us/docs/data/tax-regime#mei-and-hybrid-simples).
- When present, `simplesNacionalStartDate` and `simeiStartDate` can be `null`, as with an estimated MEI. Base the opt-in check on `type.code`, not on the dates.
- When present, `regularIbsStartDate` or `regularCbsStartDate` can be `null` if the company opts into the regular regime of only one of the two taxes, but at least one of them has a date.

> **Important:** no response field says that the regime was [estimated](https://cnpja.com/en-us/docs/data/tax-regime#estimated). When the Simples Nacional or SIMEI opt-in is decisive, confirm it with a short `company.taxRegime.maxAge` or with the [Simples Nacional certificate](#certificate). When the Simples Nacional hybrid classification is decisive, also use `company.taxRegime.view=DETAILED`, where age counts only from the last live query at the Simples Nacional.

## Regime history

With `company.taxRegime.view=DETAILED`, Lookup CNPJ adds `company.taxRegime.timeline`, with the previous periods of the regime and the upcoming events already scheduled, such as a Simples Nacional exclusion with a set date.

```http
GET /v2/establishments/37335118000180?expand=company.taxRegime&company.taxRegime.view=DETAILED HTTP/1.1
Host: api.cnpja.com
Authorization: YOUR_API_KEY
```

Illustrative response, which does not correspond to the CNPJ in the request above, trimmed to the regime of a company that left the Simples Nacional:

```json
{
  "company": {
    "taxRegime": {
      "updatedAt": "2026-01-27T03:00:00.000Z",
      "type": { "code": "PRESUMED_PROFIT", "label": "Lucro Presumido" },
      "timeline": [
        {
          "type": { "code": "SIMPLES_NACIONAL_PERIOD", "label": "Período Anterior do Simples Nacional" },
          "startDate": "2020-06-05",
          "endDate": "2023-12-31",
          "details": "Excluída por Ato Administrativo praticado pela Receita Federal do Brasil"
        },
        {
          "type": { "code": "PRESUMED_PROFIT_PERIOD", "label": "Período Anterior do Lucro Presumido" },
          "startDate": "2024-01-01",
          "endDate": "2024-12-31",
          "details": null
        }
      ]
    }
  }
}
```

For a Simples Nacional hybrid company, `DETAILED` also adds `regularIbsStartDate` and `regularCbsStartDate`, described in [Response fields](#response-fields). Illustrative response, trimmed to the regime of a company in the CBS regular regime only:

```json
{
  "company": {
    "taxRegime": {
      "updatedAt": "2027-01-27T03:00:00.000Z",
      "type": { "code": "SIMPLES_NACIONAL_HYBRID", "label": "Simples Híbrido" },
      "simplesNacionalStartDate": "2020-06-05",
      "regularIbsStartDate": null,
      "regularCbsStartDate": "2027-01-01",
      "timeline": []
    }
  }
}
```

Each `timeline` item has:

| Field | Content |
|---|---|
| `type` | Entry type, with `code` and `label`, listed in [Codes and values](#codes-and-values) |
| `startDate` | Start of the period or date of the event |
| `endDate` | End of the period. For upcoming events, it is always `null`, as it is for a self-employed cargo transporter period still in progress |
| `details` | A description, such as the reason for a Simples Nacional exclusion, or `null` |

The source of each entry type is in [Timeline](https://cnpja.com/en-us/docs/data/tax-regime#timeline). Sort the items by `startDate` to build a timeline.

## Search by regime

[Search CNPJ](https://cnpja.com/en-us/docs/api/reference#tag/establishments/GET/v2/establishments) filters establishments by the company's regime:

| Filter | Selects |
|---|---|
| `company.taxRegime.type.code.in` | Regime types, separated by commas, such as `SIMPLES_NACIONAL_SIMEI` or `ACTUAL_PROFIT,PRESUMED_PROFIT` |
| `company.taxRegime.simplesNacionalStartDate.gte` and `company.taxRegime.simplesNacionalStartDate.lte` | Start of the current Simples Nacional period |
| `company.taxRegime.simeiStartDate.gte` and `company.taxRegime.simeiStartDate.lte` | Start of the current SIMEI period |
| `company.taxRegime.regularIbsStartDate.gte` and `company.taxRegime.regularIbsStartDate.lte` | Start of the current IBS regular regime period |
| `company.taxRegime.regularCbsStartDate.gte` and `company.taxRegime.regularCbsStartDate.lte` | Start of the current CBS regular regime period |

To find active head offices in SP that opt into Simples Nacional, excluding MEIs:

```http
GET /v2/establishments?company.taxRegime.type.code.in=SIMPLES_NACIONAL,SIMPLES_NACIONAL_HYBRID&type.code.in=HEAD&status.code.in=ACTIVE&address.state.in=SP HTTP/1.1
Host: api.cnpja.com
Authorization: YOUR_API_KEY
```

- `SIMPLES_NACIONAL` includes neither hybrid optants nor MEIs. For every Simples Nacional optant, use `company.taxRegime.type.code.in=SIMPLES_NACIONAL,SIMPLES_NACIONAL_HYBRID,SIMPLES_NACIONAL_SIMEI`, and for hybrid optants only, `company.taxRegime.type.code.in=SIMPLES_NACIONAL_HYBRID`.
- The filters use the same regime as Lookup CNPJ, the [estimated regime](https://cnpja.com/en-us/docs/data/tax-regime#estimated) included.
- `SIMPLES_NACIONAL_HYBRID` and the `regularIbsStartDate` and `regularCbsStartDate` filters select only companies whose IBS or CBS regular regime option was already found by a live query. Until then, a Simples Nacional optant with the option appears as `SIMPLES_NACIONAL`, as explained in [IBS and CBS](https://cnpja.com/en-us/docs/data/tax-regime#ibs-and-cbs).
- Records include `company.taxRegime` without `regularIbsStartDate`, `regularCbsStartDate` and `timeline`, even when filtered by these dates. To get them, look up the CNPJ with `company.taxRegime.view=DETAILED`.
- Since the regime belongs to the company, the filters return all of its establishments. Combine them with `type.code.in=HEAD` to get one record per company.

Operators, sorting, pagination and the other filters are in [CNPJ search](https://cnpja.com/en-us/docs/api/cnpj-search).

## Codes and values

Base your logic on `code`. The `label` is for display only and changes with the language, as explained in [Response format](https://cnpja.com/en-us/docs/api/responses).

### Regime types

| `type.code` | Regime |
|---|---|
| `ACTUAL_PROFIT` | Actual profit |
| `PRESUMED_PROFIT` | Presumed profit |
| `ARBITRATED_PROFIT` | Arbitrated profit |
| `SIMPLES_NACIONAL` | Simples Nacional, except hybrid and SIMEI |
| `SIMPLES_NACIONAL_HYBRID` | Simples Nacional hybrid: Simples Nacional with the IBS or CBS regular regime |
| `SIMPLES_NACIONAL_SIMEI` | SIMEI, for MEIs |
| `NOT_APPLICABLE` | Not applicable: every establishment closed or void |

### History entries

| `timeline[].type.code` | Entry |
|---|---|
| `ACTUAL_PROFIT_PERIOD` | Previous actual profit period |
| `PRESUMED_PROFIT_PERIOD` | Previous presumed profit period |
| `ARBITRATED_PROFIT_PERIOD` | Previous arbitrated profit period |
| `SIMPLES_NACIONAL_PERIOD` | Previous Simples Nacional period |
| `SIMPLES_NACIONAL_INCLUSION` | Upcoming Simples Nacional inclusion |
| `SIMPLES_NACIONAL_EXCLUSION` | Upcoming Simples Nacional exclusion |
| `SIMEI_PERIOD` | Previous SIMEI period |
| `SIMEI_EXCLUSION` | Upcoming SIMEI exclusion |
| `SIMEI_CARGO_TRANSPORTER_PERIOD` | Period as a SIMEI self-employed cargo transporter |
| `REGULAR_IBS_PERIOD` | Previous IBS regular regime period |
| `REGULAR_IBS_OPTION` | Upcoming IBS regular regime option |
| `REGULAR_IBS_OPTION_CANCELLATION` | Upcoming cancellation of the IBS regular regime option |
| `REGULAR_CBS_PERIOD` | Previous CBS regular regime period |
| `REGULAR_CBS_OPTION` | Upcoming CBS regular regime option |
| `REGULAR_CBS_OPTION_CANCELLATION` | Upcoming cancellation of the CBS regular regime option |

## Sources and updates

The regime's sources and how each one is updated are in [Sources and freshness](https://cnpja.com/en-us/docs/data/tax-regime#sources-and-freshness). With `expand=company.taxRegime`, Lookup CNPJ compares the age of the regime with `company.taxRegime.maxAge` or, without it, with `maxAge` (default `45d`). If the limit is exceeded, the Simples Nacional is queried live before the response. With `DETAILED`, age counts only from the last live query at the Simples Nacional, so the request can require a live query where `SUMMARY` would come from cached data.

Limits follow the syntax described in [Max age](https://cnpja.com/en-us/docs/api/max-age). A separate limit keeps `maxAge` at the default for the CNPJ registration data and requires a more recent regime:

```http
GET /v2/establishments/37335118000180?expand=company.taxRegime&company.taxRegime.maxAge=7d HTTP/1.1
Host: api.cnpja.com
Authorization: YOUR_API_KEY
```

- The live query also updates the regime returned by Lookup company and Search CNPJ, which never make live queries.
- A lower `maxAge` updates only the opt-ins to Simples Nacional, SIMEI and the IBS and CBS regular regime: the regime declared in the ECF has no live query.

### Partial success

Each live query has up to 30 seconds. If the query to the Simples Nacional fails or exceeds that time, the response comes with `206`, a [partial success](https://cnpja.com/en-us/docs/glossary#sucesso-parcial--partial-success):

- The regime keeps its cached data, which may be older than the requested limit.
- The regime is not charged. The other resources of the request are returned and charged normally.
- The response does not say which resource failed. Compare `company.taxRegime.updatedAt` with the requested limit and repeat the request later.

> **Important:** treat `206` as a success, but do not use an outdated regime for decisions that depend on the current Simples Nacional opt-in, such as issuing an invoice. See [Max age](https://cnpja.com/en-us/docs/api/max-age).

## Certificate

The `SIMPLES_NACIONAL_OPTION` certificate, the Simples Nacional opt-in certificate, issued by [Issue CNPJ dossier](https://cnpja.com/en-us/docs/api/reference#tag/establishments/GET/v2/establishments/%7btaxId%7d/dossier), shows as a PDF the company's status in Simples Nacional and SIMEI as the source had it on the query date. The certificate is not issued or attested by CNPJá and does not replace querying the source where the law requires it, as explained in [What a certificate is not](https://cnpja.com/en-us/docs/data/certificates#not-cnd). Use it when you need to file the opt-in check as a PDF, for example in an internal audit or when applying a tax rule that depends on the opt-in.

```http
GET /v2/establishments/37335118000180/dossier?certificates=SIMPLES_NACIONAL_OPTION HTTP/1.1
Host: api.cnpja.com
Authorization: YOUR_API_KEY
```

- The certificate comes from live queries at the Simples Nacional and refers to the company: it is the same for the head office and every branch.
- The certificate follows the dossier's `maxAge` and comes from a live query or from the cache, depending on age.
- In a `206`, the certificate comes in its cached version, or is left out of the PDF when there is none.

The other certificates and the dossier rules are in [Certificates](https://cnpja.com/en-us/docs/api/certificates).

## Billing

With `expand=company.taxRegime`, Lookup CNPJ meters the regime as a separate resource, live or cached depending on age, on top of the registration data, while Lookup company and Search CNPJ return the regime with no usage of its own. The usage of each operation is in the Metering Rules: [Lookup CNPJ](https://cnpja.com/en-us/legal/metering#api-cnpj), [Lookup company](https://cnpja.com/en-us/legal/metering#api), [Search CNPJ](https://cnpja.com/en-us/legal/metering#api) and, for the `SIMPLES_NACIONAL_OPTION` certificate, [Issue certificates](https://cnpja.com/en-us/legal/metering#api-certificates).

## Frequent errors

| Status | Code | Cause | Action |
|---|---|---|---|
| `400` | `REQUEST_VALIDATION_FAILED` | `company.taxRegime.view` or `company.taxRegime.maxAge` without `company.taxRegime` in `expand`, or a value in the wrong format, including in a `company.taxRegime.*` filter | Include `company.taxRegime` in `expand` and fix the parameter shown in `errors` |
| `401` | `API_KEY_MISSING` | Request without an API key, or a public request with query parameters, such as `expand` | Send the key in the `Authorization` header, as explained in [First request](https://cnpja.com/en-us/docs/api/first-request) |
| `404` | `ESTABLISHMENT_NOT_FOUND` | The CNPJ is not registered with the Receita Federal | Check the CNPJ before repeating. The `404` is charged, as shown in the [metering rules](https://cnpja.com/en-us/legal/metering#charged-without-result) |
| `404` | `COMPANY_NOT_FOUND` | No company in the cached data has the root sent to Lookup company | Look up one of the company's CNPJs in Lookup CNPJ, which adds it to the cached data. The `404` is charged as well |

The other errors are in [Limits and errors](https://cnpja.com/en-us/docs/api/limits-and-errors).

## Use cases

- **Invoicing support:** check whether a customer or supplier is listed as a Simples Nacional optant, with `type.code` set to `SIMPLES_NACIONAL`, `SIMPLES_NACIONAL_HYBRID` or `SIMPLES_NACIONAL_SIMEI`, which can affect, for example, how taxes are shown and withheld. Use a short `company.taxRegime.maxAge` when the rule depends on the current opt-in, and file the `SIMPLES_NACIONAL_OPTION` certificate when you need a record of the check.
- **IBS and CBS regular regime:** identify Simples Nacional optants that pay IBS, CBS or both under the regular regime, with `type.code` set to `SIMPLES_NACIONAL_HYBRID`, and get the start dates with `DETAILED`. In Search CNPJ, use `company.taxRegime.type.code.in=SIMPLES_NACIONAL_HYBRID` or the `company.taxRegime.regularIbsStartDate.*` and `company.taxRegime.regularCbsStartDate.*` filters.
- **Credit and supplier analysis support:** use the regime as one indicator of size and accounting formality. With `DETAILED`, the history shows Simples Nacional exclusions and regime changes over the years.
- **MEI onboarding:** identify an MEI by `type.code` set to `SIMPLES_NACIONAL_SIMEI` and apply the rules of your own operation, such as revenue or credit limits.
- **Prospecting:** find in Search CNPJ actual profit companies, Simples Nacional optants or MEIs in a region or activity, combined with CNAE, size and incorporation date filters. For every Simples Nacional optant, filter by the three Simples Nacional codes, as shown in [Search by regime](#search-by-regime).
- **Data enrichment:** add the regime to your customer base with Lookup company, which returns the regime together with the rest of the company data, from cached data.

## In the app

On the platform, the regime appears in the **Tax regime** section of the record, in the **Tax regime** filter group of the search and as a resource of exports and bulk lookups, as shown in [Where it appears in the app](https://cnpja.com/en-us/docs/data/tax-regime#app).

## Notes

- [Lookup CPF](https://cnpja.com/en-us/docs/api/reference#tag/individuals/GET/v2/individuals/%7btaxId%7d) does not accept `company.taxRegime`: the regime exists only for companies.
- Request `DETAILED` only when you need the history, the IBS and CBS regular regime start dates or a recent check of the Simples Nacional hybrid classification, because it tends to require more live queries.
- The API does not return the company's gross revenue or its Simples Nacional annex, as stated in the regime's [Limitations](https://cnpja.com/en-us/docs/data/tax-regime#limitations).
