Skip to content
State registration lookup in the API
API · Features

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:

OperationResponse contentexpandStates queried
Lookup CNPJThe CNPJ record, as in CNPJ lookup, plus the stateRegistry fieldOptional: include stateRegistryDefault ORIGIN, the establishment’s state
Lookup CPFtaxId, legalName, updatedAt and the requested resourcesRequired: stateRegistry, suframa or bothThe 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:

ParameterValuesEffect
expandstateRegistry, alone or with other resources, as in stateRegistry,suframaIncludes stateRegistry in the response
stateRegistry.statesORIGIN, state abbreviations or ALL. Defaults to ORIGIN for a CNPJ; required for a CPFStates whose registrations go into registrations
stateRegistry.viewSUMMARY (default) or DETAILEDLevel of detail of each registration, described in Response fields
maxAgeA duration, such as 1d or 30d. Defaults to 45dMaximum age accepted for all data in the request
stateRegistry.maxAgeA duration, such as 1d or 30dMax age accepted for the registrations only, in place of maxAge

stateRegistry.states accepts these values, which add up:

  • ORIGIN: the state of the establishment’s address. Accepted only in Lookup CNPJ.
  • State abbreviation: such as SP or MG. ORIGIN,MG requests 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.states, stateRegistry.view and stateRegistry.maxAge are accepted only with stateRegistry in expand. Without it, the request is rejected with 400 REQUEST_VALIDATION_FAILED, 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.taxRegime,stateRegistry.

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_PRODUCER). 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 stateRegistry in expand, stateRegistry.states is also required and does not accept ORIGIN, since there is no origin address: send the states or ALL.
  • stateRegistry.view has the same levels as for a CNPJ, and maxAge and stateRegistry.maxAge work the same way.
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: 404 INDIVIDUAL_NOT_FOUND means no registration was found for the CPF. The CCC is queried only in the states in stateRegistry.states, 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 a 404: on an unexpected 404, 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:

FieldContent
updatedAtLast live query of the registrations at the CCC, in any state, not only the requested ones
registrationsList of registrations in the requested states, empty when there are none
taxRestrictionsList of restrictions on interstate tax documents

The level of detail defines the fields of each registration:

LevelFields of each registration
SUMMARY (default)Number, state, type and status: updatedAt, number, state, type, statusDate, isEnabled, hasRestriction
DETAILEDThe 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:

FieldContent
updatedAtLast update of the registration from the CCC, which can be earlier than stateRegistry.updatedAt
numberState registration number, 8 to 14 characters depending on the state
stateState of the registration
typeRegistration type, with code and label, described in Codes and values
statusDateDate of the registration’s current status
isEnabledtrue when the registration is enabled as a taxpayer in the state, and false otherwise
hasRestrictiontrue when the CNPJ or CPF has a restriction as a recipient in the registration’s state
activityStartDateDate the taxpayer started its activity in the state (DETAILED)
activityEndDateDate the activity ended, or null (DETAILED)
primaryActivityPrimary economic activity registered in the state, with the CNAE code and description (DETAILED)
addressAddress registered for the registration, in the same format as the CNPJ address, without coordinates (DETAILED)
hasExceededSublimittrue for a Simples Nacional optant whose gross revenue exceeded the state sublimit, in which case ICMS is no longer paid through Simples Nacional (DETAILED)
authorizedTaxDocumentsElectronic 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:

FieldContent
issuerState that issued the restriction
recipientState blocked as recipient
  • taxRestrictions holds every known restriction, without the stateRegistry.states filter applied to 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:

CheckFields
Reading datestateRegistry.updatedAt and registrations[].updatedAt, compared with the limit you asked for
Registration in the customer’s stateregistrations[].state and isEnabled
Typetype.code, such as STATE_TAXPAYER or NON_TAXPAYER
RestrictionshasRestriction and taxRestrictions
Authorized documentsauthorizedTaxDocuments, with stateRegistry.view=DETAILED
Record of the checkThe CCC_REGISTRATIONS 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.codeType
STATE_TAXPAYERState taxpayer
TAX_SUBSTITUTIONTax substitution
NON_TAXPAYERNon-taxpayer
INTERSTATE_TAXPAYERInterstate taxpayer
RURAL_PRODUCERRural 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[].codeDocument
NFENF-e
NFCENFC-e
CTE_ROAD, CTE_AIR, CTE_WATERWAY, CTE_RAIL, CTE_PIPELINE, CTE_MULTIMODALCT-e for road, air, waterway, rail, pipeline and multimodal transport
CTE_OTHERCT-e OS
BPE, BPE_AIR, BPE_METROPOLITANBP-e, BP-e TA and BP-e TM
NFCOMNFCom
NF3ENF3-e
NFAGNFAg
NFGASNFGas

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.maxAge 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.updatedAt 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.updatedAt shows the last live query in any state, and registrations[].updatedAt 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:

  • stateRegistry holds 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.updatedAt, or with DETAILED the updatedAt of each registration, with the limit you asked for.
  • With DETAILED, a state whose query failed and that has no cached registration is missing from registrations. On a 206, retry the request later before concluding that there is no registration.

Important: treat 206 as 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_REGISTRATIONS 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=stateRegistry and the states in stateRegistry.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.view=DETAILED, each requested state with no registration is queried live on every request, regardless of the age limit, so, with stateRegistry.states=ALL, a CNPJ with no registration at all consumes 27 live queries per request. The same applies to Lookup CPF with DETAILED and, on a CPF’s first lookup, also with SUMMARY. See how to spend less in All states: mind the cost.

Frequent errors

StatusCodeCauseAction
400REQUEST_VALIDATION_FAILEDstateRegistry.states, stateRegistry.view or stateRegistry.maxAge without stateRegistry in expand, or a value in the wrong formatInclude stateRegistry in expand and fix the parameter shown in errors, following the accepted values in Request
400REQUEST_VALIDATION_FAILEDFor a CPF, a missing expand or stateRegistry.states, or ORIGIN was sentSend expand and, with stateRegistry, the states or ALL
401API_KEY_MISSINGRequest without an API key, or a public request with query parameters, such as expandSend the key in the Authorization header, as explained in First request
404ESTABLISHMENT_NOT_FOUNDThe CNPJ is not registered with the Receita FederalCheck the CNPJ before repeating: the 404 is also charged, under the metering rules
404INDIVIDUAL_NOT_FOUNDNo state or SUFRAMA registration was found for the CPF in the requested statesExtend stateRegistry.states 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.states=ALL and SUMMARY, keeping in mind how the other states are refreshed, as described in Summary and detailed.
  • Carriers and issuers: check in authorizedTaxDocuments whether 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, ORIGIN matches no state and, with SUMMARY, 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 expand rules in Response expansion.

Informational content that may change without notice. It is not tax, accounting or legal advice, and CNPJá's terms and policies prevail over this page.