Skip to main content

Validate CNPJ

Use the WsAcesso_validateCnpj method to validate the provided CNPJ.
This method is used exclusively to verify whether the CNPJ has a valid structure and can be used in the other PBM flows.


Step 1: Get the Authentication Token and Headers

Before making any query, you must authenticate and obtain a valid JWT token.
All endpoints in this flow use the same authentication headers.

For more details, see: Authentication and Headers


Step 2: CNPJ Validation

Use the WsAcesso_validateCnpj method to validate the structure of the provided CNPJ.

Parameters

ParameterTypeRequiredDescriptionValue
cnpjStringYesCompany CNPJMap Input

GraphQL Query Example

query {
WsAcesso_validateCnpj(cnpj: "12345678000195") {
cnpjIsValid
}
}

Response Example

Valid CNPJ:

{
"data": {
"validateCnpj": {
"cnpjIsValid": true
}
}
}

Invalid CNPJ:

{
"data": {
"validateCnpj": {
"cnpjIsValid": false
}
}
}