# Consultar NF-e por Chave de Acesso

## Endpoint

<mark style="color:blue;">`GET`</mark> [`https://sandbox-api.invoisys.com.br/api/nfe/getbychaveSTD`](https://sandbox-api.invoisys.com.br/api/nfe/getbychaveSTD/)`/{chave}`

#### Path Parameters

| Name  | Type    | Description             |
| ----- | ------- | ----------------------- |
| chave | integer | Chave de acesso da NF-e |

#### Headers

| Name          | Type   | Description                           |
| ------------- | ------ | ------------------------------------- |
| Content-type  | string | `application/x-www-form-urlencoded`​​ |
| Accept        | string | `application/jso​n​`                  |
| Authorization | string | `bearer <valor​>​`                    |

{% tabs %}
{% tab title="Exemplos de retorno" %}
{% tabs %}
{% tab title="200 - NF-e encontrada" %}

```javascript
{
  "id": 0000,
  "createDate": "2018-12-12T14:25:54.607",
  "modifyDate": null,
  "chaveDeAcesso": "00000000000000",
  "codigoAleatorioNF": 12341234,
  "uf": {
    "id": 13,
    "codigo": 26,
    "sigla": "PE",
    "nome": "PERNAMBUCO",
    "timeZone": -3
  },
  "naturezaDaOperacao": "Natureza",
  "tipoDePagamento": {
    "key": 2,
    "value": "Outros"
  },
  "serie": 2,
  "numero": 99,
  "dataHoraEmissao": "2018-12-12T13:25:53.72",
  "dataHoraEntradaEmContingencia": null,
  "dataPrestacaoServico": null,
  "dataHoraSaidaOuEntrada": null,
  "justificativaEntradaEmContingencia": null,
  "tipoNF": {
    "key": 1,
    "value": "Saída"
  },
  "localDestinoOperacao": {
    "key": 1,
    "value": "Operação interna"
  },
  "municipioFatorGerador": {
    "id": 1806,
    "uf": {
      "id": 13,
      "codigo": 26,
      "sigla": "PE",
      "nome": "PERNAMBUCO",
      "timeZone": -3
    },
    "codigo": 2611606,
    "nome": "RECIFE",
    "nomeReduzido": "RECIFE",
    "codigoDoMunicipioSIAFI": 2531
  },
  "tipoImpressaoDanfe": {
    "key": 1,
    "value": "DANFE normal, Retrato"
  },
  "tipoEmissao": {
    "key": 1,
    "value": "Normal"
  },
  "digitoVerificador": 7,
  "ambiente": {
    "key": 2,
    "value": "Homologação"
  },
  "finalidade": {
    "key": 1,
    "value": "Normal"
  },
  "consumidorFinal": true,
  "indicadorPresenca": {
    "key": 0,
    "value": "Não se aplica"
  },
  "processoDeEmissao": {
    "key": 0,
    "value": "Emissão de NF-e com aplicativo do contribuinte"
  },
  "versaoAplicativo": "1.0.0",
  "emitente": {
    "id": 9233,
    "cnpj": "00000000000",
    "razaoSocial": "RAZÃO SOCIAL",
    "nomeFantasia": "NOME FANTASIA"
  },
  "itens": [
    {
      "id": 0,
      "ordem": 1,
      "codigo": "ITEM",
      "ean": "SEM GTIN",
      "description": "NOTA FISCAL EMITIDA EM AMBIENTE DE HOMOLOGACAO - SEM VALOR FISCAL",
      "ncm": 00000000,
      "cest": null,
      "cfop": 5151,
      "unidadeMedidaComercial": {
        "key": 48,
        "value": "Peça"
      },
      "quantidadeComercial": 1,
      "valorUnitarioComercial": 10,
      "valorTotalBruto": 10,
      "eanTributario": "SEM GTIN",
      "unidadeMedidaTributaria": {
        "key": 48,
        "value": "Peça"
      },
      "quantidadeTributavel": 1,
      "valorUnitarioTributario": 10,
      "indicadorTotal": true,
      "valorTotalTributos": 0,
      "valorDesconto": 0,
      "produtoOrigemId": null,
      "numeroPedido": null,
      "numeroItemPedido": 0,
      "numeroFCI": null
    }
  ],
  "eventos": [
    {
      "data": "2018-12-12T13:25:54.6066667",
      "tipo": {
        "key": 54,
        "value": "Autorização de NF-e"
      },
      "statusSEFAZ": "100",
      "descricaoSEFAZ": "Autorizado o uso da NF-e",
      "xml": ""
    },
    {
      "data": "2018-12-12T13:25:54.6066667",
      "tipo": {
        "key": 53,
        "value": "Envio de NF-e Normal"
      },
      "statusSEFAZ": "",
      "descricaoSEFAZ": "",
      "xml": ""
    }
  ],
  "erro": false,
  "statusSEFAZ": "100",
  "descricaoSEFAZ": "Autorizado o uso da NF-e",
  "xml": "",
  "xmlCancelamento": null,
  "protocoloDeAutorizacao": "00000000",
  "status": {
    "key": 0,
    "value": "Autorizado"
  },
  "totalNFe": 10,
  "desconto": 0,
  "troco": 0,
  "dataDeAutorizacao": "2018-12-12T13:25:54",
  "destinatario": {
    "id": 1333,
    "cnpj": null,
    "cpf": "00000000000",
    "nome": "NF-E EMITIDA EM AMBIENTE DE HOMOLOGACAO - SEM VALOR FISCAL",
    "email": "teste@teste.com.br",
    "endereco": {
      "logradouro": "Rua Teste",
      "numero": "999",
      "bairro": "Teste",
      "idMunicipio": 4268,
      "idUF": 21,
      "municipio": {
        "id": 4268,
        "uf": {
          "id": 21,
          "codigo": 41,
          "sigla": "PR",
          "nome": "PARANA",
          "timeZone": -3
        },
        "codigo": 4113304,
        "nome": "LARANJEIRAS DO SUL",
        "nomeReduzido": "LARANJEIRAS DO SUL",
        "codigoDoMunicipioSIAFI": 7659
      }
    }
  },
  "cnae": null,
  "nFesReferenciadas": [],
  "retirada": null,
  "entrega": null,
  "pessoasAutorizadasAcessarXML": [],
  "transporte": {
    "modalidadeFrete": {
      "key": 0,
      "value": "Por conta do emitente"
    },
    "transportadora": null,
    "retencaoTransporte": null,
    "veiculoTransporte": null,
    "reboques": [],
    "volumes": []
  },
  "cobranca": null,
  "pagamento": {
    "detalhesPagamento": [
      {
        "tipoDePagamento": {
          "key": 0,
          "value": "À vista"
        },
        "meioDePagamento": {
          "key": 1,
          "value": "Dinheiro"
        },
        "valorDoPagamento": 10,
        "cartao": null
      }
    ],
    "valorDoTroco": 0
  },
  "cartasDeCorrecao": [],
  "informacoesAdicionais": null
}
```

{% endtab %}

{% tab title="404 - NF-e inexistente" %}

```javascript
{
  "Excecao": "NFe não encontrada"
}
```

{% endtab %}
{% endtabs %}
{% endtab %}
{% endtabs %}

{% hint style="info" %}

#### Swagger

[Você pode acessar nossa API e realizar testes diretamente na nossa plataforma Swagger!](https://sandbox-api.invoisys.com.br/swagger/ui/index#/)
{% endhint %}

## Referências à API 📌

* [Passo-a-Passo da NF-e](/invoisys/getting-started/documentos-fiscais/emissao/nf-e/integracao-passo-a-passo.md#conhecendo-as-apis)
* [Fluxograma - Envio Normal](/invoisys/getting-started/documentos-fiscais/emissao/nf-e/teste-fluxos-operacionais/envio-normal-modelo-completo.md)
* [Fluxograma - Envio Contingência](/invoisys/getting-started/documentos-fiscais/emissao/nf-e/teste-fluxos-operacionais/envio-contingencia-modelo-completo.md)
* [Fluxograma - Cancelamento/Inutilização](/invoisys/getting-started/documentos-fiscais/emissao/nf-e/teste-fluxos-operacionais/cancelamento-modelo-completo.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://integracao.gitbook.io/invoisys/endpoints/emissao-notas/nf-e/api-consulta-sefaz.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
