Skip to main content

Definição

This document aims to describe how the Composite Query Rest API works, its purpose, the call parameters, and their respective query returns. The content of this documentation and the specifications of the Composite Query are subject to change without notice.

Request

Composite Query

Through the Composite Query endpoint, it is possible to create a completely customizable composition by providing only the document number, e.g., CNPJ, and parameterizing the sources of the query that you want to call at that moment.

Query URL

For the request process, the access token will be required. If you don't have it yet, contact suporte netrin, the document number you want to inquire about, e.g., CNPJ, and the name(s) of the service(s) you want to search.

With this information parameterized, a GET request must be made to the URL: https://api.netrin.com.br/v1/consulta-composta.

Query Markup

Tags and Reference

The composite query allows the addition of tags to the query using the tags parameter, separated by commas. These tags are used for customization and categorization of the data. Another available parameter is reference, which allows including a numeric reference associated with the query, for example, from your partner within the ERP system. Both parameters are optional, meaning you can choose whether to use them or not in your API call.

URL example: https://api.netrin.com.br/v1/consulta-composta?cnpj=13384727000161&token=00000000&s=receita-federal-cnpj&tags=onboarding,faturamento&reference=156454

The following response will be included in the query's response:

{
"cnpj": 13384727000161,
"tags": [
"onboarding",
"faturamento"
],
"reference": "156454"
}

Return Messages

Status Code

Status CodeMessageActions
200Sucesso-
206Retorno ParcialEvaluate internal code (table below)
408TimeoutEvaluate internal code (table below)
401Token Inválido / ExpiradoAnalyze token
403Usuário não possui permissão para acessar este recursoContact Support
404Parâmetros inválidosReview the name of the service(s)
502Falha na chamadaContact Support

Internal Codes

Internal CodesDescriptionDefinitions
601Lentidão ao gerar captchaContact Support in case of recurrence
602Lentidão do siteEvaluate service consumption
603Site fora do arWait for site return
604Em manutençãoContact Support for return deadline
605Parâmetros faltantes para a fonteContact Support in case of doubt
606Não encontradoData does not exist in the original source database
607Menor de idadeThe consulted document belongs to a minor
608Não foi possível emitirThe site did not allow to issue the proof
609Parâmetro(s) inválido(s)Verify the values of the provided parameters
610Limite de tentativas excedidoThe daily attempt limit has been exceeded
611Franquia excedidaThe contracted amount has been exceeded
612Franquia inativaThe franchise has been deactivated
613Franquia expiradaThe franchise has not been renewed
614PEP / VIPThe document belongs to a prominent person, and the data cannot be disclosed
615Documento bloqueado na base de dados de origemThe document is blocked, and it will not be possible to consult it
616Documento inativoThe document is inactive, and it will not be possible to consult it
617Informações Pessoais identificáveis mínimas (PII)Minimal Personally Identifiable Information (PII)
618Pessoa falecidaThe document belongs to a deceased holder
619Não possui histórico de créditoNo credit history to present
620Documento InválidoThe consulted document is invalid
621Limite de erros excedido, temporariamente bloqueadoMessage dedicated to the excess of errors in micro-deposit validation
622Serviço temporariamente indisponívelThe query service is currently unavailable. If you have any questions, contact support.
623Usuário não possui permissão para acessar este recursoThe queried service is currently not available. If you have any questions, contact support.
624O CPF informado possui restrições para este serviçoThe queried CPF is temporarily blocked from being validated through this service
625Banco de destino não respondeu à requisição, tente novamente mais tardeTemporary instability at the destination bank. Try again later.
650Problemas na buscaContact Support in case of recurrence

Example of return

{
"cpf": 00000000000,
"receitaFederal": {
"code": "603",
"message": "Site fora do ar"
},
"sintegra": {
"code": "604",
"message": "Em manutenção"
}
}

Consultation receipts

In order to ensure the accuracy of the information, the service will provide, whenever possible, an appointment confirmation in PDF or HTML format.

In the JSON, the tag will be named "urlConfirmation" and will be accompanied by the URL to a repository that will expire in 3 months from the date of the appointment. It is of utmost importance that the solution development includes a routine to download this file from the link, as it will enable the retrieval of the document in case of tax audits.

caution

Netrin will not retain appointment confirmations, so it is necessary to download and store the document in your own system, as it will no longer be available after this period.

In some situations, due to the nature of historical data, the mentioned tag may not be present in the deliveries.

Finally, if there is an error in generating the confirmation, the "urlConfirmation" tag will be filled with the message "Não foi possível gerar o link do comprovante." (Unable to generate the confirmation link)

Request Demonstration

Example of Query

In this example, we will provide the CNPJ number 13384727000161 for Netrin and address the query to the following services:

  • Federal Revenue Service: receita-federal-cnpj
  • Sintegra: sintegra
  • Simples Nacional: simples-nacional

Structured URL: https://api.netrin.com.br/v1/consulta-composta?cnpj=13384727000161&token=00000000-0000-0000-0000-000000000000&s=receita-federal-cnpj&s=simples-nacional&s=sintegra

Note: If you want to make this call, replace the token 00000000-0000-0000-0000-000000000000 with your unique token.

{
"cnpj": "13384727000161",
"receitaFederal": {
"razaoSocial": "NETRIN CONSULTORIA E SERVICOS EM TECNOLOGIA DA INFORMACAO LTDA.",
"nomeFantasia": "********",
"naturezaJuridica": "206-2 - Sociedade Empresária Limitada",
"logradouro": "AV THEODOMIRO PORTO DA FONSECA",
"numero": "3101",
"complemento": "EDIF 08 SALA E",
"bairro": "DUQUE DE CAXIAS",
"municipio": "SAO LEOPOLDO",
"cep": "93.020-080",
"uf": "RS",
"email": "contabilidade@meta.com.br",
"telefone": "(51) 2101-1371/ (51) 2101-1300",
"efr": "*****",
"situacaoCadastral": "ATIVA",
"dataSituacaocadastral": "17/03/2011",
"dataInicioAtividade": "17/03/2011",
"atividadeEconomica": "62.02-3-00 - Desenvolvimento e licenciamento de programas de computador customizáveis",
"atividadesEconomicasSecundarias": [
"62.03-1-00 - Desenvolvimento e licenciamento de programas de computador não-customizáveis",
"62.01-5-01 - Desenvolvimento de programas de computador sob encomenda",
"62.04-0-00 - Consultoria em tecnologia da informação",
"62.09-1-00 - Suporte técnico, manutenção e outros serviços em tecnologia da informação"
],
"tipoCNPJ": "MATRIZ",
"situacaoEspecial": "********",
"dataSituacaoEspecial": "********",
"motivoSituacao": "",
"porte": "DEMAIS",
"capitalSocial": "R$447.755,00 (Quatrocentos e quarenta e sete mil e setecentos e cinquenta e cinco reais)",
"urlComprovante": "https://..."
},
"simplesNacional": {
"nomeEmpresarial": "NETRIN CONSULTORIA E SERVICOS EM TECNOLOGIA DA INFORMACAO LTDA.",
"situacaoSimplesNacional": "NÃO optante pelo Simples Nacional",
"situacaoSimei": "NÃO enquadrado no SIMEI",
"urlComprovante": "https://..."
},
"sintegra": {
"code": 606,
"message": "Não encontrado",
"urlComprovante": "https://..."
}
}