State registration lookup in the API
Look up a CNPJ's or CPF's state registrations in the CCC via the API, in any state, with status and authorized tax documents, before issuing an NF-e.
Tip: Concepts on this page: State registration and CCC, Summary and detailed, Data freshness and Certificates.
The API returns the state registrations of a CNPJ or a CPF from the CCC, with number, state, type, status, restrictions and, at the detailed level, activity, address and authorized tax documents. For a CNPJ, they are an optional resource of Lookup CNPJ, requested in expand; for a CPF, they are the main content of Lookup CPF. Both require an API key.
Request
State registrations appear in two operations, always requested in expand:
| Operation | Response content | expand | States queried |
|---|---|---|---|
| Lookup CNPJ | The CNPJ record, as in CNPJ lookup, plus the stateRegistry field | Optional: include stateRegistry | Default ORIGIN, the establishment’s state |
| Lookup CPF | taxId, legalName, updatedAt and the requested resources | Required: stateRegistry, suframa or both | The states or ALL must be sent |
In both operations, registrations come from live queries or from cached data, depending on their age, and the parameters are the same:
| Parameter | Values | Effect |
|---|---|---|
expand | stateRegistry, alone or with other resources, as in stateRegistry,suframa | Includes stateRegistry in the response |
stateRegistry. | ORIGIN, state abbreviations or ALL. Defaults to ORIGIN for a CNPJ; required for a CPF | States whose registrations go into registrations |
stateRegistry. | SUMMARY (default) or DETAILED | Level of detail of each registration, described in Response fields |
maxAge | A duration, such as 1d or 30d. Defaults to 45d | Maximum age accepted for all data in the request |
stateRegistry. | A duration, such as 1d or 30d | Max age accepted for the registrations only, in place of maxAge |
stateRegistry. accepts these values, which add up:
ORIGIN: the state of the establishment’s address. Accepted only in Lookup CNPJ.- State abbreviation: such as
SPorMG.ORIGIN,MGrequests the establishment’s state and also MG. ALL: all 27 states, counting the Federal District.
Send several values separated by commas or by repeating the parameter. registrations holds only the registrations in the requested states.
stateRegistry., stateRegistry. and stateRegistry. are accepted only with stateRegistry in expand. Without it, the request is rejected with 400 REQUEST_, and errors holds an item with the code DEPENDENCIES, as shown in Limits and errors. Keyless requests do not accept expand, so registrations are not available through Public access.
Lookup CNPJ
In Lookup CNPJ, request expand=stateRegistry. Without other parameters, the response holds the registrations in the establishment’s state, at the SUMMARY level:
GET /v2/establishments/37335118000180?expand=stateRegistry HTTP/1.1
Host: api.cnpja.com
Authorization: YOUR_API_KEY To also request another state and the detailed level, combine the parameters:
GET /v2/establishments/37335118000180?expand=stateRegistry&stateRegistry.states=ORIGIN,MG&stateRegistry.view=DETAILED HTTP/1.1
Host: api.cnpja.com
Authorization: YOUR_API_KEY The response holds the CNPJ record, as in CNPJ lookup, and the stateRegistry field. stateRegistry can be requested together with other resources, as in expand=company..
Lookup CPF
Lookup CPF returns the registrations of an individual, a natural person with a state or SUFRAMA registration, such as a rural producer (RURAL_). It is not a CPF lookup at the Receita Federal, and the masked CPF of partners cannot be used in this operation, as explained in Individuals with a registration.
Request rules:
- With
stateRegistryinexpand,stateRegistry.is also required and does not acceptstates ORIGIN, since there is no origin address: send the states orALL. stateRegistry.has the same levels as for a CNPJ, andview maxAgeandstateRegistry.work the same way.maxAge
GET /v2/individuals/CPF_NUMBER?expand=stateRegistry&stateRegistry.states=SP,MG HTTP/1.1
Host: api.cnpja.com
Authorization: YOUR_API_KEY The response has taxId, legalName, updatedAt and stateRegistry, with the same fields as for a CNPJ. legalName comes from the CCC or SUFRAMA, whichever was updated most recently.
Important:
404INDIVIDUAL_means no registration was found for the CPF. The CCC is queried only in the states inNOT_ FOUND stateRegistry., so request every relevant state before concluding that the CPF has no state registration. On a CPF’s first lookup there is no cached data to fall back on, and a CCC failure also results in astates 404: on an unexpected404, retry the request later.
Response fields
Lookup CNPJ response with expand=stateRegistry, trimmed to the registrations:
{
"taxId": "37335118000180",
"stateRegistry": {
"updatedAt": "2026-01-27T03:00:00.000Z",
"registrations": [
{
"updatedAt": "2026-01-27T03:00:00.000Z",
"number": "936389130",
"state": "SP",
"type": { "code": "STATE_TAXPAYER", "label": "Contribuinte" },
"statusDate": "2020-06-05",
"isEnabled": true,
"hasRestriction": false
}
],
"taxRestrictions": []
}
} stateRegistry has three fields:
| Field | Content |
|---|---|
updatedAt | Last live query of the registrations at the CCC, in any state, not only the requested ones |
registrations | List of registrations in the requested states, empty when there are none |
taxRestrictions | List of restrictions on interstate tax documents |
The level of detail defines the fields of each registration:
| Level | Fields of each registration |
|---|---|
SUMMARY (default) | Number, state, type and status: updatedAt, number, state, type, statusDate, isEnabled, hasRestriction |
DETAILED | The same, plus activity, address, sublimit and authorized tax documents: activityStartDate, activityEndDate, primaryActivity, address, hasExceededSublimit, authorizedTaxDocuments |
The level also changes how updates and billing work, as described in Sources and updates and Billing. Prefer SUMMARY when it is enough to know whether the registration exists and is enabled.
A registration at the DETAILED level, trimmed:
{
"updatedAt": "2026-01-27T03:00:00.000Z",
"number": "936389130",
"state": "SP",
"type": { "code": "STATE_TAXPAYER", "label": "Contribuinte" },
"statusDate": "2020-06-05",
"isEnabled": true,
"hasRestriction": false,
"activityStartDate": "2020-06-05",
"activityEndDate": null,
"hasExceededSublimit": false,
"primaryActivity": {
"code": "6311900",
"label": "Tratamento de dados, provedores de serviços de aplicação e serviços de hospedagem na internet"
},
"address": {
"street": "Avenida Brigadeiro Faria Lima",
"number": "2369",
"city": "São Paulo",
"state": "SP",
"postalCode": "01452922"
},
"authorizedTaxDocuments": [{ "code": "NFE", "label": "NF-e" }]
} Each item in registrations has:
| Field | Content |
|---|---|
updatedAt | Last update of the registration from the CCC, which can be earlier than stateRegistry. |
number | State registration number, 8 to 14 characters depending on the state |
state | State of the registration |
type | Registration type, with code and label, described in Codes and values |
statusDate | Date of the registration’s current status |
isEnabled | true when the registration is enabled as a taxpayer in the state, and false otherwise |
hasRestriction | true when the CNPJ or CPF has a restriction as a recipient in the registration’s state |
activityStartDate | Date the taxpayer started its activity in the state (DETAILED) |
activityEndDate | Date the activity ended, or null (DETAILED) |
primaryActivity | Primary economic activity registered in the state, with the CNAE code and description (DETAILED) |
address | Address registered for the registration, in the same format as the CNPJ address, without coordinates (DETAILED) |
hasExceededSublimit | true for a Simples Nacional optant whose gross revenue exceeded the state sublimit, in which case ICMS is no longer paid through Simples Nacional (DETAILED) |
authorizedTaxDocuments | Electronic tax documents the registration is authorized to issue, such as NF-e and CT-e (DETAILED) |
Each item in taxRestrictions means a state has blocked the CNPJ or CPF as a recipient of interstate tax documents:
| Field | Content |
|---|---|
issuer | State that issued the restriction |
recipient | State blocked as recipient |
taxRestrictionsholds every known restriction, without thestateRegistry.filter applied tostates registrations.- Address and activity come from the state’s registry and can differ from the CNPJ record at the Receita Federal.
Pre-invoice verification
What to check before issuing an NF-e is in Before issuing an invoice. In the API, shorten only the registrations’ age limit and keep the default for the rest of the record:
GET /v2/establishments/37335118000180?expand=stateRegistry&stateRegistry.maxAge=1d HTTP/1.1
Host: api.cnpja.com
Authorization: YOUR_API_KEY The rest of the CNPJ record keeps the 45d default, and registrations are queried live if they are more than 1 day old. Each check maps to these fields:
| Check | Fields |
|---|---|
| Reading date | stateRegistry. and registrations[]., compared with the limit you asked for |
| Registration in the customer’s state | registrations[]. and isEnabled |
| Type | type., such as STATE_ or NON_ |
| Restrictions | hasRestriction and taxRestrictions |
| Authorized documents | authorizedTaxDocuments, with stateRegistry. |
| Record of the check | The CCC_ certificate, described in Certificate |
Codes and values
Base your logic on code. The label is for display only and changes with the language, as explained in Response format.
Registration types
type. | Type |
|---|---|
STATE_ | State taxpayer |
TAX_ | Tax substitution |
NON_ | Non-taxpayer |
INTERSTATE_ | Interstate taxpayer |
RURAL_ | Rural producer |
The meaning of each type is in Types and status. The registration status has no code of its own: use isEnabled, with its date in statusDate, and hasRestriction for restrictions.
Authorized tax documents
authorizedTaxDocuments[]. | Document |
|---|---|
NFE | NF-e |
NFCE | NFC-e |
CTE_, CTE_, CTE_, CTE_, CTE_, CTE_ | CT-e for road, air, waterway, rail, pipeline and multimodal transport |
CTE_ | CT-e OS |
BPE, BPE_, BPE_ | BP-e, BP-e TA and BP-e TM |
NFCOM | NFCom |
NF3E | NF3-e |
NFAG | NFAg |
NFGAS | NFGas |
What each document is is explained in Authorized tax documents.
Sources and updates
Registrations and restrictions come only from the CCC, queried live per state. In Lookup CPF, legalName comes from the CCC or SUFRAMA, whichever of the two sources was queried most recently.
Registrations come from cached data when they are within the age limit, which is stateRegistry. or, without it, maxAge, with a 45d default. If they are older, or were never queried, they are queried live at the CCC before the response. The general rules are in Max age and partial success.
The age checked is stateRegistry. with SUMMARY, and that of each requested state with DETAILED, or with SUMMARY for a CPF with no known state registration yet. Which states each level queries live is explained in Summary and detailed.
stateRegistry. shows the last live query in any state, and registrations[]. that of each registration. To know whether a registration is within the limit you asked for, compare its updatedAt with that limit.
Partial success
Each live query has up to 30 seconds to complete. If the CCC query fails or exceeds that time, the request goes on and the response comes with status 206, a partial success:
stateRegistryholds the registrations already in cached data, which may be older than the limit you asked for, or comes back empty if they were never queried.- The failed query is not charged, under the metering rules. With
DETAILED, this applies to each state whose query failed. The other resources in the request are returned as usual. - The response does not say which resource failed. Compare
stateRegistry., or withupdatedAt DETAILEDtheupdatedAtof each registration, with the limit you asked for. - With
DETAILED, a state whose query failed and that has no cached registration is missing fromregistrations. On a206, retry the request later before concluding that there is no registration.
Important: treat
206as success, but do not use stale registrations for decisions that need recent data, such as issuing an invoice. See Max age and partial success.
Certificate
The CCC_ certificate, the Comprovante de Inscrições no Cadastro Centralizado de Contribuintes, carries the registrations as a PDF, as explained in What a certificate is. It is issued by the certificate operations:
- Issue CNPJ dossier: for the state of the establishment’s address, with no option to choose another. It is left out of the PDF for establishments with no state, such as those located abroad.
- Issue CPF dossier: for a single state where the CPF has a known state registration, with no option to choose the state. When the CPF has no known state registration, the CCC is not queried and the certificate is left out: look up the CPF first with
expand=stateRegistryand the states instateRegistry..states
GET /v2/establishments/37335118000180/dossier?certificates=CCC_REGISTRATIONS HTTP/1.1
Host: api.cnpja.com
Authorization: YOUR_API_KEY - The certificate comes from live queries at the CCC and follows the dossier’s
maxAge. - The certificate consumes quota even when it is left out of the PDF because the CCC has no record of the CNPJ, under the metering rules.
Billing
In Lookup CNPJ, stateRegistry is charged separately from the registration data. In both operations, consumption depends on the level and the requested states, as the metering rules set for Lookup CNPJ, Lookup CPF and Issue certificates.
Important: with
stateRegistry., each requested state with no registration is queried live on every request, regardless of the age limit, so, withview=DETAILED stateRegistry., a CNPJ with no registration at all consumes 27 live queries per request. The same applies to Lookup CPF withstates=ALL DETAILEDand, on a CPF’s first lookup, also withSUMMARY. See how to spend less in All states: mind the cost.
Frequent errors
| Status | Code | Cause | Action |
|---|---|---|---|
400 | REQUEST_ | stateRegistry., stateRegistry. or stateRegistry. without stateRegistry in expand, or a value in the wrong format | Include stateRegistry in expand and fix the parameter shown in errors, following the accepted values in Request |
400 | REQUEST_ | For a CPF, a missing expand or stateRegistry., or ORIGIN was sent | Send expand and, with stateRegistry, the states or ALL |
401 | API_ | 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 |
404 | ESTABLISHMENT_ | The CNPJ is not registered with the Receita Federal | Check the CNPJ before repeating: the 404 is also charged, under the metering rules |
404 | INDIVIDUAL_ | No state or SUFRAMA registration was found for the CPF in the requested states | Extend stateRegistry. to the relevant states, or retry the request later in case the CCC failed |
Other errors are in Limits and errors.
Use cases
- Invoice issuance: support the check, before issuing the NF-e, that the recipient has an enabled registration with no restriction in the state, with a short
stateRegistry..maxAge - Customer onboarding: tell from the registration’s type and status whether a customer is an ICMS taxpayer, as support for setting the tax treatment of the sale.
- Supplier qualification: check periodically that suppliers’ registrations are still enabled, and keep the CCC certificate as a record of the query.
- State footprint: find out in which states a CNPJ is registered with
stateRegistry.andstates=ALL SUMMARY, keeping in mind how the other states are refreshed, as described in Summary and detailed. - Carriers and issuers: check in
authorizedTaxDocumentswhether the registration is authorized for the expected document, such as CT-e or NFC-e. - Rural producers: support the check, in Lookup CPF, of the registration of individual producers who sell to your company.
In the app
On the platform, registrations appear in the State registrations section of the company record, with details queried per state, and can be included in spreadsheet exports for the states you choose, as explained in States for state registrations. Lookups by CPF are only available in the API.
Notes
- State registrations are available only in Lookup CNPJ and Lookup CPF. Lookup company and Search CNPJ neither return nor filter by them.
- For an establishment with no state, such as those located abroad,
ORIGINmatches no state and, withSUMMARY, the registrations are not queried live. - Store the registration number as text, never as a number, to keep leading zeros, as explained in Identifiers as text.
- State registrations and the tax regime are separate data: the Simples Nacional option is in Tax regime, and SUFRAMA registrations are in SUFRAMA.
- Every parameter is in Lookup CNPJ and Lookup CPF, and the
expandrules in Response expansion.