### NFCom Preview Request Example Source: https://integranotas.com.br/doc/nfcom/preview Example JSON request for the NFCom preview endpoint. Includes fields for emission data, recipient, subscriber, items, and billing. The example shows a complete request with all required fields. ```json { "numero": "3", "serie": "1", "data_emissao": "2024-06-20T13:23:00-03:00", "finalidade_emissao": "0", "tipo_faturamento": "0", "indicador_prepago": "0", "indicador_cessao_meios_rede": "0", "destinatario": { "nome": "HELIO WOLFF", "cpf": "06844990960", "cnpj": "", "id_outros": "", "inscricao_estadual": null, "indicador_inscricao_estadual": "9", "endereco": { "logradouro": "LOJA", "complemento": null, "numero": "SN", "bairro": "BANANAL", "codigo_municipio": "4314035", "nome_municipio": "Pareci Novo", "uf": "RS", "codigo_pais": "1058", "nome_pais": "Brasil", "cep": "95783000", "telefone": null, "email": null } }, "assinante": { "codigo": "123", "tipo": "3", "servico": "4", "numero_contrato": "12345678", "data_inicio": "2022-01-01", "data_fim": "2022-01-01", "numero_terminal": null, "uf": null }, "itens": [ { "numero_item": "1", "codigo_produto": "123", "descricao": "LP 1MB", "codigo_classificacao": "0400401", "cfop": "5301", "unidade_medida": "1", "quantidade": "1", "valor_unitario": "10.00", "valor_desconto": "0", "valor_outras_despesas": "0", "valor_bruto": "10.00", "indicador_devolucao": "0", "informacoes_adicionais": "teste", "imposto": { "icms": { "situacao_tributaria": "00", "valor_base_calculo": "10.00", "aliquota": "18.00", "valor": "1.80" }, "fcp": { "aliquota": null, "valor": null } } } ], "cobranca": { "data_competencia": "2024-06-01", "data_vencimento": "2024-06-30", "codigo_barras": "19872982798277298279287298728278272872872" }, "informacoes_adicionais_contribuinte": "" } ``` -------------------------------- ### Native HTTP Example - Homologation and Production Source: https://integranotas.com.br/doc/emitente/webhook Two HTTP request examples for the webhook endpoint: one for the homologation (testing) environment and one for production. The exact URLs are not shown in the source, but the examples are provided as separate blocks. ```http POST __ __Testar Token de homologação Request Response __ ``` ```http __Enviar __ ``` -------------------------------- ### Backup Request Example (JSON) Source: https://integranotas.com.br/doc/cte/backup Example request body for the backup endpoint. Requires 'ano' (year, 2000-3000), 'mes' (month, 1-12), and 'emails' array. The response is HTTP 200. ```json { "ano": 2019, "mes": 12, "emails": [ "contato@cloud-dfe.com.br" ] } ``` -------------------------------- ### Request Example (JSON) Source: https://integranotas.com.br/doc/nfe/apropriacao_credito_combustivel Example request payload for the API, including chave, numero_evento, and itens array. ```json { "chave": "50191213188739000110550010000012151581978542", "numero_evento": 1, "itens": [ { "numero_item": "1", "valor_ibs": "10.00", "valor_cbs": "10.00", "unidade": "UN", "quantidade": "1.00" } ] } ``` -------------------------------- ### PHP native example: GET /v1/mdfe/status Source: https://integranotas.com.br/doc/mdfe/status Native PHP cURL example to call the MDFe status endpoint. Replace 'INFORME SEU TOKEN AQUI' with your token. Uses the hom-api base URL and disables SSL verification. ```php $curl = curl_init(); $token = "INFORME SEU TOKEN AQUI"; curl_setopt_array($curl, array( CURLOPT_URL => 'https://hom-api.integranotas.com.br/v1/mdfe/status', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_CONNECTTIMEOUT => 30, CURLOPT_TIMEOUT => 50, CURLOPT_SSL_VERIFYHOST => 0, CURLOPT_SSL_VERIFYPEER => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'GET', CURLOPT_HTTPHEADER => array( "Authorization: {$token}", "Content-Type: application/json" ) )); $response = curl_exec($curl); curl_close($curl); echo $response; ``` -------------------------------- ### Exemplo nativo: Requisição cURL para preview de NF-e Source: https://integranotas.com.br/doc/nfe/preview Exemplo de código PHP que envia uma requisição POST para o endpoint https://hom-api.integranotas.com.br/v1/nfe/preview, utilizando cURL. O token de autenticação deve ser substituído no campo 'token'. O corpo da requisição contém um JSON completo com dados da NF-e, incluindo destinatário, itens, frete, cobrança, pagamento e informações adicionais. ```php $curl = curl_init(); $token = "INFORME SEU TOKEN AQUI"; curl_setopt_array($curl, array( CURLOPT_URL => 'https://hom-api.integranotas.com.br/v1/nfe/preview', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_CONNECTTIMEOUT => 30, CURLOPT_TIMEOUT => 50, CURLOPT_SSL_VERIFYHOST => 0, CURLOPT_SSL_VERIFYPEER => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_HTTPHEADER => array( "Authorization: {$token}", "Content-Type: application/json" ), CURLOPT_POSTFIELDS => '{ "natureza_operacao": "VENDA DENTRO DO ESTADO", "serie": "1", "numero": "1035", "data_emissao": "2020-10-15T03:00:00-03:00", "data_entrada_saida": "2020-10-15T03:00:00-03:00", "tipo_operacao": "1", "finalidade_emissao": "1", "consumidor_final": "0", "presenca_comprador": "9", "notas_referenciadas": [ { "nfe": { "chave": "50191213188739000110550010000012151581978542" } } ], "destinatario": { "cnpj": "15493535500128", "nome": "EMPRESA MODELO", "indicador_inscricao_estadual": "1", "inscricao_estadual": "212055510", "endereco": { "logradouro": "AVENIDA TESTE", "numero": "444", "bairro": "CENTRO", "codigo_municipio": "2408003", "nome_municipio": "Mossoro", "uf": "RN", "cep": "59653120", "codigo_pais": "1058", "nome_pais": "BRASIL", "telefone": "8499995555" } }, "itens": [ { "numero_item": "1", "codigo_produto": "000297", "descricao": "SAL GROSSO 50KGS", "codigo_ncm": "55110011", "cfop": "5102", "unidade_comercial": "SC", "quantidade_comercial": 10, "valor_unitario_comercial": "22.45", "valor_bruto": "224.50", "unidade_tributavel": "SC", "quantidade_tributavel": "10.00", "valor_unitario_tributavel": "22.45", "origem": "0", "inclui_no_total": "1", "imposto": { "valor_aproximado_tributos": 9.43, "icms": { "situacao_tributaria": "101", "modalidade_base_calculo": "3", "valor_base_calculo": "0.00", "modalidade_base_calculo_st": "4", "aliquota_reducao_base_calculo": "0.00", "aliquota": "0.00", "aliquota_final": "0.00", "valor": "0.00", "aliquota_margem_valor_adicionado_st": "0.00", "aliquota_reducao_base_calculo_st": "0.00", "valor_base_calculo_st": "0.00", "aliquota_st": "0.00", "valor_st": "0.00" }, "pis": { "situacao_tributaria": "01", "valor_base_calculo": 224.5, "aliquota": "1.65", "valor": "3.70" }, "cofins": { "situacao_tributaria": "01", "valor_base_calculo": 224.5, "aliquota": "7.60", "valor": "17.06" } }, "valor_desconto": 0, "valor_frete": 0, "valor_seguro": 0, "valor_outras_despesas": 0, "informacoes_adicionais": "Valor aproximado tributos R$: 9,43 (4,20%) Fonte: IBPT" } ], "frete": { "modalidade_frete": "0", "volumes": [ { "quantidade": "10", "especie": null, "marca": "TESTE", "numero": null, "peso_liquido": 500, "peso_bruto": 500 } ] }, "cobranca": { "fatura": { "numero": "001", "valor_original": "224.50", "valor_desconto": "0.00", "valor_liquido": "224.50" } }, "pagamento": { "formas_pagamento": [ { "meio_pagamento": "01", "valor": "224.50", "tipo_integracao": "2" } ] }, "informacoes_adicionais_contribuinte": "PV: 3325 * Rep: DIRETO * Motorista: * Forma Pagto: 04 DIAS * teste de observação para a nota fiscal * Valor aproximado tributos R$9,43 (4,20%) Fonte: IBPT", "pessoas_autorizadas": [ { "cnpj": "96256273000170" }, { "cnpj": "80681257000195" } ] }' )); $response = curl_exec($curl); curl_close($curl); echo $response; ``` -------------------------------- ### PHP Native Example - Get NFS-e Info Source: https://integranotas.com.br/doc/nfse/info Uses cURL to send a GET request to the NFS-e info endpoint. Replace the token placeholder and the {ibge} path parameter with the city's IBGE code. The response is printed to the output. ```php $curl = curl_init(); $token = "INFORME SEU TOKEN AQUI"; curl_setopt_array($curl, array( CURLOPT_URL => 'https://hom-api.integranotas.com.br/v2/nfse/info/{ibge}', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_CONNECTTIMEOUT => 30, CURLOPT_TIMEOUT => 50, CURLOPT_SSL_VERIFYHOST => 0, CURLOPT_SSL_VERIFYPEER => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'GET', CURLOPT_HTTPHEADER => array( "Authorization: {$token}", "Content-Type: application/json" ) )); $response = curl_exec($curl); curl_close($curl); echo $response; ``` -------------------------------- ### GET [Endpoint] Source: https://integranotas.com.br/doc/dfe/nfe/mostra Example of a native API call to retrieve a document by access key. The response includes document details such as key, CNPJ, XML, PDF, and events. ```APIDOC ## GET [Endpoint] ### Description Example of a native API call to retrieve a document by access key. The response includes document details such as key, CNPJ, XML, PDF, and events. ### Method GET ### Endpoint [Endpoint] ### Parameters #### Query Parameters - **Chave de acesso** (string) - Required - The access key of the document. ### Request Example GET [Endpoint]?Chave%20de%20acesso=41190806338788000127550010000010011537233885 ### Response #### Success Response (200) - **sucesso** (boolean) - Indicates if the request was successful. - **codigo** (integer) - Response code. - **mensagem** (string) - Response message. - **doc** (object) - Document details. - **chave** (string) - Access key. - **cnpj** (string) - CNPJ. - **razao** (string) - Company name. - **data** (string) - Date and time. - **valor** (string) - Value. - **cstat** (string) - Status code. - **nsu** (string) - NSU. - **relacao** (string) - Relation. - **xml** (string) - XML content in base64. - **pdf** (string) - PDF content in base64. - **eventos** (array) - List of events. - **tipo** (string) - Event type. - **seq** (string) - Sequence. - **nsu** (string) - NSU. - **descricao** (string) - Description. - **data** (string) - Date and time. - **xml** (string) - XML content in base64. #### Response Example { "sucesso": true, "codigo": 1000, "mensagem": "Sucesso.", "doc": { "chave": "41190806338788000127550010000010011537233885", "cnpj": "06338788000127", "razao": "EMPRESA TESTE", "data": "2019-08-29T08:32:38-03:00", "valor": "10.00", "cstat": "100", "nsu": "523", "relacao": "D", "xml": "PG5mZVByb2MgdmVyc2FvPSI0LjAwIiB4bW...Byb2M+", "pdf": "PG5mZVByb2MgdaSda1d0dI0LjAwIiB4bW...Byb2M+", "eventos": [ { "tipo": "610600", "seq": "1", "nsu": "1213", "descricao": "Registro de Autorização de CT-e para a NF-e", "data": "2021-06-20 14:00:10", "xml": "PG5mZVByb2MgdmVyc2FvPSI0LjAwIiB4bW...Byb2M+" } ] } } ``` -------------------------------- ### Exemplo nativo PHP - Buscar métricas (cURL) Source: https://integranotas.com.br/doc/soft/metricas Exemplo de requisição POST para a rota de métricas da Softhouse. Deve ser usado com o token da softhouse e o período no formato MM/AAAA. A resposta é impressa com echo. ```php $curl = curl_init(); $token = "INFORME SEU TOKEN AQUI"; curl_setopt_array($curl, array( CURLOPT_URL => 'https://hom-api.integranotas.com.br/v1/soft/metrics', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_CONNECTTIMEOUT => 30, CURLOPT_TIMEOUT => 50, CURLOPT_SSL_VERIFYHOST => 0, CURLOPT_SSL_VERIFYPEER => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_HTTPHEADER => array( "Authorization: {$token}", "Content-Type: application/json" ), CURLOPT_POSTFIELDS => '{ "periodo": "04/2020" }' )); $response = curl_exec($curl); curl_close($curl); echo $response; ``` -------------------------------- ### PHP native example: Query NFC-e status with cURL Source: https://integranotas.com.br/doc/nfce/status Uses cURL to send a GET request to the NFC-e status endpoint. Requires a valid token. The response is printed to the output. ```php $curl = curl_init(); $token = "INFORME SEU TOKEN AQUI"; curl_setopt_array($curl, array( CURLOPT_URL => 'https://hom-api.integranotas.com.br/v1/nfce/status', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_CONNECTTIMEOUT => 30, CURLOPT_TIMEOUT => 50, CURLOPT_SSL_VERIFYHOST => 0, CURLOPT_SSL_VERIFYPEER => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'GET', CURLOPT_HTTPHEADER => array( "Authorization: {$token}", "Content-Type: application/json" ) )); $response = curl_exec($curl); curl_close($curl); echo $response; ``` -------------------------------- ### PHP Native Example - Query NFCom Status Source: https://integranotas.com.br/doc/nfcom/status Uses cURL to send a GET request to the NFCom status endpoint. Requires a valid token to be set in the 'token' variable. The response is printed to the output. ```php $curl = curl_init(); $token = "INFORME SEU TOKEN AQUI"; curl_setopt_array($curl, array( CURLOPT_URL => 'https://hom-api.integranotas.com.br/v1/nfcom/status', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_CONNECTTIMEOUT => 30, CURLOPT_TIMEOUT => 50, CURLOPT_SSL_VERIFYHOST => 0, CURLOPT_SSL_VERIFYPEER => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'GET', CURLOPT_HTTPHEADER => array( "Authorization: {$token}", "Content-Type: application/json" ) )); $response = curl_exec($curl); curl_close($curl); echo $response; ``` -------------------------------- ### GET /v1/soft/emitente/{doc} Source: https://integranotas.com.br/doc/soft/emitente/mostra Busca os dados do emitente. Requer o token da softhouse no header de autorização. ```APIDOC ## GET /v1/soft/emitente/{doc} ### Description Busca os dados do emitente. Requer o token da softhouse no header de autorização. ### Method GET ### Endpoint https://hom-api.integranotas.com.br/v1/soft/emitente/{doc} ### Parameters #### Path Parameters - **doc** (string) - Required - Documento do emitente. #### Headers - **Authorization** (string) - Required - Token da softhouse. - **Content-Type** (string) - Required - application/json ### Request Example ``` curl -X GET 'https://hom-api.integranotas.com.br/v1/soft/emitente/{doc}' \ -H 'Authorization: INFORME SEU TOKEN AQUI' \ -H 'Content-Type: application/json' ``` ### Response #### Success Response (200) - Resposta em JSON com os dados do emitente. #### Response Example ```json { "dados_do_emitente": "..." } ``` ``` -------------------------------- ### Exemplo nativo em PHP - Buscar emitente com cURL Source: https://integranotas.com.br/doc/soft/emitente/mostra Exemplo de requisição GET para o endpoint /v1/soft/emitente/{doc} usando cURL. Substitua {doc} pelo documento do emitente e informe seu token no campo $token. A resposta é impressa com echo. ```php $curl = curl_init(); $token = "INFORME SEU TOKEN AQUI"; curl_setopt_array($curl, array( CURLOPT_URL => 'https://hom-api.integranotas.com.br/v1/soft/emitente/{doc}', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_CONNECTTIMEOUT => 30, CURLOPT_TIMEOUT => 50, CURLOPT_SSL_VERIFYHOST => 0, CURLOPT_SSL_VERIFYPEER => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'GET', CURLOPT_HTTPHEADER => array( "Authorization: {$token}", "Content-Type: application/json" ) )); $response = curl_exec($curl); curl_close($curl); echo $response; ``` -------------------------------- ### POST /v1/soft/metrics Source: https://integranotas.com.br/doc/soft/metricas Busca as métricas de todos os emitentes. Deve ser utilizado com cautela, recomendamos chamar 1 vez por dia. Nessa requisição deve ser passado o token da softhouse. ```APIDOC ## POST /v1/soft/metrics ### Description Busca as métricas de todos os emitentes. Deve ser utilizado com cautela, recomendamos chamar 1 vez por dia. Nessa requisição deve ser passado o token da softhouse. ### Method POST ### Endpoint https://hom-api.integranotas.com.br/v1/soft/metrics ### Parameters #### Request Body - **periodo** (string) - Required - Período no formato MM/AAAA (exemplo: "04/2020") ### Request Example { "periodo": "04/2020" } ### Response #### Success Response (200) - **response** (object) - Resposta da API com as métricas dos emitentes. #### Response Example { "response": "..." } ``` -------------------------------- ### Exemplo nativo PHP - Listar emitentes (cURL) Source: https://integranotas.com.br/doc/soft/emitente/lista Exemplo de requisição GET para o endpoint /v1/soft/emitente usando cURL em PHP. Deve ser passado o token da softhouse no header Authorization. O exemplo usa o ambiente de homologação (hom-api.integranotas.com.br). ```php $curl = curl_init(); $token = "INFORME SEU TOKEN AQUI"; curl_setopt_array($curl, array( CURLOPT_URL => 'https://hom-api.integranotas.com.br/v1/soft/emitente', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_CONNECTTIMEOUT => 30, CURLOPT_TIMEOUT => 50, CURLOPT_SSL_VERIFYHOST => 0, CURLOPT_SSL_VERIFYPEER => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'GET', CURLOPT_HTTPHEADER => array( "Authorization: {$token}", "Content-Type: application/json" ) )); $response = curl_exec($curl); curl_close($curl); echo $response; ``` -------------------------------- ### PHP Native Example for NFS-e Offline API Source: https://integranotas.com.br/doc/nfse/offline Native PHP example using cURL to call the NFS-e offline endpoint. Requires a valid token. The example uses the hom-api base URL and disables SSL verification. ```php $curl = curl_init(); $token = "INFORME SEU TOKEN AQUI"; curl_setopt_array($curl, array( CURLOPT_URL => 'https://hom-api.integranotas.com.br/v1/nfse/offline', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_CONNECTTIMEOUT => 30, CURLOPT_TIMEOUT => 50, CURLOPT_SSL_VERIFYHOST => 0, CURLOPT_SSL_VERIFYPEER => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'GET', CURLOPT_HTTPHEADER => array( "Authorization: {$token}", "Content-Type: application/json" ) )); $response = curl_exec($curl); curl_close($curl); echo $response; ``` -------------------------------- ### Exemplo nativo em PHP: atualizar webhook do emitente Source: https://integranotas.com.br/doc/emitente/webhook Exemplo de requisição POST para atualizar a URL do webhook. Deve ser passado o token do emitente no cabeçalho Authorization. O corpo da requisição contém a nova URL do webhook. ```PHP $curl = curl_init(); $token = "INFORME SEU TOKEN AQUI"; curl_setopt_array($curl, array( CURLOPT_URL => 'https://hom-api.integranotas.com.br/v1/emitente/webhook', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_CONNECTTIMEOUT => 30, CURLOPT_TIMEOUT => 50, CURLOPT_SSL_VERIFYHOST => 0, CURLOPT_SSL_VERIFYPEER => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_HTTPHEADER => array( "Authorization: {$token}", "Content-Type: application/json" ), CURLOPT_POSTFIELDS => '{ "webhook": "https://integranotas.com.br/webhook" }' )); $response = curl_exec($curl); curl_close($curl); echo $response; ```