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.
The following response will be included in the query's response:
{
"cnpj": 13384727000161,
"tags": [
"onboarding",
"faturamento"
],
"reference": "156454"
}
Return Messages
Status Code
Status Code | Message | Actions |
---|---|---|
200 | Sucesso | - |
206 | Retorno Parcial | Evaluate internal code (table below) |
408 | Timeout | Evaluate internal code (table below) |
401 | Token Inválido / Expirado | Analyze token |
403 | Usuário não possui permissão para acessar este recurso | Contact Support |
404 | Parâmetros inválidos | Review the name of the service(s) |
502 | Falha na chamada | Contact Support |
Internal Codes
Internal Codes | Description | Definitions |
---|---|---|
601 | Lentidão ao gerar captcha | Contact Support in case of recurrence |
602 | Lentidão do site | Evaluate service consumption |
603 | Site fora do ar | Wait for site return |
604 | Em manutenção | Contact Support for return deadline |
605 | Parâmetros faltantes para a fonte | Contact Support in case of doubt |
606 | Não encontrado | Data does not exist in the original source database |
607 | Menor de idade | The consulted document belongs to a minor |
608 | Não foi possível emitir | The site did not allow to issue the proof |
609 | Parâmetro(s) inválido(s) | Verify the values of the provided parameters |
610 | Limite de tentativas excedido | The daily attempt limit has been exceeded |
611 | Franquia excedida | The contracted amount has been exceeded |
612 | Franquia inativa | The franchise has been deactivated |
613 | Franquia expirada | The franchise has not been renewed |
614 | PEP / VIP | The document belongs to a prominent person, and the data cannot be disclosed |
615 | Documento bloqueado na base de dados de origem | The document is blocked, and it will not be possible to consult it |
616 | Documento inativo | The document is inactive, and it will not be possible to consult it |
617 | Informações Pessoais identificáveis mínimas (PII) | Minimal Personally Identifiable Information (PII) |
618 | Pessoa falecida | The document belongs to a deceased holder |
619 | Não possui histórico de crédito | No credit history to present |
620 | Documento Inválido | The consulted document is invalid |
621 | Limite de erros excedido, temporariamente bloqueado | Message dedicated to the excess of errors in micro-deposit validation |
622 | Serviço temporariamente indisponível | The query service is currently unavailable. If you have any questions, contact support. |
623 | Usuário não possui permissão para acessar este recurso | The queried service is currently not available. If you have any questions, contact support. |
624 | O CPF informado possui restrições para este serviço | The queried CPF is temporarily blocked from being validated through this service |
625 | Banco de destino não respondeu à requisição, tente novamente mais tarde | Temporary instability at the destination bank. Try again later. |
650 | Problemas na busca | Contact 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.
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
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://..."
}
}