NF-e
Query NF-e
Returns status, invoice data and DANFE / XML download links.
/openapi/v2/empresas/{empresaId}/nf-e/{nfeId}token, timestamp and sign signature headers, see Authentication.nfeId is the id sent at issuance. The response echoes the issuance request in the same shape, plus the data SEFAZ returned. Authentication errors (10009xxx) are listed under Authentication.
Path parameters
empresaId* | string | Company identifier |
nfeId* | string | Invoice identifier |
* Required field
id | string | Request identifier |
tipo | string | Document type |
status | string | Invoice status |
motivoStatus | string | Denial reason |
ambienteEmissao | string | Environment |
enviadaPorEmail | bool | Sent by e-mail |
dataCriacao | string | Acceptance time |
dataUltimaAlteracao | string | Last change |
forcarEmissaoContingencia | bool | Forced contingency |
| object | Order |
| object | Buyer |
numero | string | Invoice number |
serie | string | Invoice series |
dataEmissao | string | Issue time |
chaveAcesso | string | Access key |
| object | Transport |
dataAutorizacao | string | Authorization time |
linkDanfe | string | DANFE link |
linkDownloadXml | string | Authorized XML link |
linkConsultaPorChaveAcesso | string | Public lookup |
| object | Authorization protocol |
emitidaEmContingencia | bool | Issued in contingency |
finalidade | string | Purpose |
naturezaOperacao | string | Nature of the operation |
| object | Original invoice |
| array | Items |
valorTotal | number | Invoice total |
informacoesAdicionais | string | Invoice remarks |
informacoesAdicionaisFisco | string | Remarks to the tax authority |
The invoice stays in AguardandoAutorizacao until SEFAZ replies, then ends in Autorizada, Negada or Cancelada. In final states the platform discards the request parameters: pedido, remarks, naturezaOperacao and tax parameters beyond code and rate stop coming.
AguardandoAutorizacao: processing
From acceptance until SEFAZ replies. No number, key, protocol or links; pedido, cliente and every tax parameter are echoed as sent. Query again or wait for the callback.
{"id": "NFe-000014553","status": "AguardandoAutorizacao","numero": null,"chaveAcesso": null,"dataAutorizacao": null,"linkDanfe": null,"linkDownloadXml": null,"pedido": { "presencaConsumidor": "OperacaoPelaInternet", "pagamento": { "tipo": "PagamentoAVista", "formas": [ { "tipo": "CartaoDeCredito", "valor": 28.47 } ] } },"itens": [ { "cfop": "6102", "codigo": "000068", "origem": 0, "impostos": { "icms": { "situacaoTributaria": "102" }, "pis": { "situacaoTributaria": "49", "aliquota": 0 }, "cofins": { "situacaoTributaria": "49", "aliquota": 0 } } } ]}
Autorizada: authorized by SEFAZ
Number, key, dataAutorizacao, protocolo and both links filled. Every query issues fresh links.
{"id": "NFe-000014553","status": "Autorizada","numero": "262","serie": "2","chaveAcesso": "35241104893402000113550020000002621202427463","dataAutorizacao": "2024-11-27T20:56:55Z","protocolo": { "numero": "135240009194753" },"linkDanfe": "https://api.v2.tffiscal.com/openapi/files/danfe/35241104893402000113550020000002621202427463?token=…","linkDownloadXml": "https://api.v2.tffiscal.com/openapi/files/xml/8801?token=…"}
Negada: refused by SEFAZ
motivoStatus carries the SEFAZ code and reason. No DANFE; the number, if already allocated, is reused by the next issuances, with no skipped numbers. Fix the request and issue again.
{"id": "NFe-000014553","status": "Negada","motivoStatus": "778 - Rejeicao: NCM inexistente","linkDanfe": null,"linkDownloadXml": null}
Cancelada: cancelled after authorization
After Cancel NF-e. Number, key and protocol remain; the DANFE stops coming and the XML remains available.
{"id": "NFe-000014553","status": "Cancelada","numero": "262","chaveAcesso": "35241104893402000113550020000002621202427463","protocolo": { "numero": "135240009194753" },"linkDanfe": null,"linkDownloadXml": "https://api.v2.tffiscal.com/openapi/files/xml/8801?token=…"}
linkDanfe and linkDownloadXml look like https://api.v2.tffiscal.com/openapi/files/{kind}/{ref}?token=… and need no signature headers: a plain GET that follows the 302 redirect is enough. Every query issues new links; an expired link returns 401 + 10009036. Validity and the remaining errors are described in File download.
statusInvoice status
| Values | Meaning |
|---|---|
| AguardandoAutorizacao | Accepted, waiting for the SEFAZ reply |
| Autorizada | Authorized by SEFAZ; DANFE and XML available |
| Negada | Refused by SEFAZ; reason in motivoStatus |
| Cancelada | Cancelled after authorization |
ambienteEmissaoIssue environment
| Values | Meaning |
|---|---|
| Homologacao | SEFAZ test environment; the invoice has no legal effect |
| Producao | Official environment |
finalidadeInvoice purpose
| Values | Meaning |
|---|---|
| Normal | Ordinary sale |
| Complementar | Complementary invoice to an already authorized invoice |
| Ajuste | Adjustment invoice to an already authorized invoice |
| Devolucao | Return of an already authorized invoice; carries notaReferenciada |
pedido.presencaConsumidorBuyer presence
| Values | Meaning |
|---|---|
| NaoSeAplica | Not applicable; returns |
| OperacaoPresencial | In-person sale at the shop |
| OperacaoPelaInternet | Online sale |
| OperacaoPorTelefone | Telesale |
| EntregaEmDomicilio | Sale closed at home delivery |
| OperacaoPresencialForaDoEstabelecimento | In-person sale outside the shop |
| Outros | Other |
pedido.pagamento.tipoPayment timing
| Values | Meaning |
|---|---|
| PagamentoAVista | Cash on the spot |
| PagamentoAPrazo | On credit |
pedido.pagamento.formas[].tipoPayment method
| Values | Meaning |
|---|---|
| Dinheiro | Cash |
| Cheque | Cheque |
| CartaoDeCredito | Credit card |
| CartaoDeDebito | Debit card |
| CreditoLoja | Store credit |
| ValeAlimentacao | Food voucher |
| ValeRefeicao | Meal voucher |
| ValePresente | Gift voucher |
| ValeCombustivel | Fuel voucher |
| BoletoBancario | Bank slip |
| DepositoBancario | Bank deposit |
| PagamentoInstantaneoPix | Pix instant payment |
| TransferenciaBancaria | Bank transfer |
| ProgramaDeFidelidade | Loyalty programme or cashback |
| PagamentoInstantaneoPixEstatico | Static Pix |
| CreditoEmLoja | In-store balance |
| PagamentoEletronicoNaoInformado | Electronic payment not reported |
| PagamentoInstantaneoPixAutomatico | Automatic Pix |
| TransferenciaTefBookTransfer | Same-bank TEF transfer |
| SemPagamento | No payment; returns |
| PagamentoPosterior | Deferred payment |
| Outros | Other |
cliente.indicadorContribuinteICMSBuyer ICMS status
After the final state only ContribuinteICMS (CNPJ with state registration) or NaoContribuinte.
| Values | Meaning |
|---|---|
| ContribuinteICMS | Taxpayer with state registration |
| ContribuinteIsento | Exempt from state registration |
| NaoContribuinte | Non-taxpayer |
cliente.tipoPessoaBuyer type
| Values | Meaning |
|---|---|
| F | Individual; 11-digit CPF |
| J | Company; 14-digit CNPJ |
cliente.endereco.ufBuyer state
EX only on export invoices.
| Values | Meaning |
|---|---|
| AC | Acre |
| AL | Alagoas |
| AP | Amapá |
| AM | Amazonas |
| BA | Bahia |
| CE | Ceará |
| DF | Distrito Federal |
| ES | Espírito Santo |
| GO | Goiás |
| MA | Maranhão |
| MT | Mato Grosso |
| MS | Mato Grosso do Sul |
| MG | Minas Gerais |
| PA | Pará |
| PB | Paraíba |
| PR | Paraná |
| PE | Pernambuco |
| PI | Piauí |
| RJ | Rio de Janeiro |
| RN | Rio Grande do Norte |
| RS | Rio Grande do Sul |
| RO | Rondônia |
| RR | Roraima |
| SC | Santa Catarina |
| SP | São Paulo |
| SE | Sergipe |
| TO | Tocantins |
| EX | Abroad (export invoice) |
transporte.frete.modalidadeFreight modality
| Values | Meaning |
|---|---|
| SemFrete | No freight |
| PorContaDoEmitente | Freight paid by the seller |
| PorContaDoDestinatario | Freight paid by the buyer |
| PorContaDeTerceiros | Freight paid by a third party |
| TransporteProprioPorContaDoRemetente | Seller own transport |
| TransporteProprioPorContaDoDestinatario | Buyer own transport |
itens[].origemProduct origin
| Values | Meaning |
|---|---|
| 0 | Domestic |
| 1 | Directly imported |
| 2 | Imported, bought domestically |
| 3 | Domestic with over 40 % imported content |
| 4 | Domestic by basic production process |
| 5 | Domestic with up to 40 % imported content |
| 6 | Directly imported, no domestic equivalent |
| 7 | Imported from the domestic market, no domestic equivalent |
| 8 | Domestic with over 70 % imported content |
itens[].impostos.icms.situacaoTributariaICMS CST (regular regime, CRT 2 / 3)
| Values | Meaning |
|---|---|
| 00 | Fully taxed |
| 02 | Own single-phase (fuels) |
| 10 | Taxed with ST withholding |
| 15 | Own single-phase with withholding (fuels) |
| 20 | With base reduction |
| 30 | Exempt or not taxed, with ST withholding |
| 40 | Exempt |
| 41 | Not taxed |
| 50 | Suspended |
| 51 | Deferral |
| 53 | Single-phase with deferral (fuels) |
| 60 | ICMS already withheld upstream by ST |
| 61 | Single-phase already charged upstream (fuels) |
| 70 | With base reduction and ST withholding |
| 90 | Other |
itens[].impostos.icms.situacaoTributariaICMS CSOSN (Simples Nacional, CRT 1 / 4)
| Values | Meaning |
|---|---|
| 101 | Taxed, buyer may take credit |
| 102 | Taxed, no credit |
| 103 | Exempt by gross-revenue band |
| 201 | Taxed with credit and ST withholding |
| 202 | Taxed without credit, with ST withholding |
| 203 | Exempt by revenue band, with ST withholding |
| 300 | Constitutionally immune |
| 400 | Not taxed |
| 500 | ICMS already withheld upstream by ST |
| 900 | Other |
itens[].impostos.pis.situacaoTributariaPIS CST
| Values | Meaning |
|---|---|
| 01 | Taxable at the basic rate |
| 02 | Taxable at a differentiated rate |
| 03 | Taxable by quantity |
| 04 | Single-phase, resale at zero rate |
| 05 | Tax substitution |
| 06 | Zero rate |
| 07 | Exempt |
| 08 | Not levied (export) |
| 09 | Suspended |
| 49 | Other outbound operations |
| 50–56 | Inbound with credit right, by revenue type (returns only) |
| 60–66 | Inbound with presumed credit, by revenue type (returns only) |
| 67 | Presumed credit, other operations (returns only) |
| 70 | Inbound without credit right |
| 71 | Inbound exempt |
| 72 | Inbound suspended |
| 73 | Inbound at zero rate |
| 74 | Inbound not levied |
| 75 | Inbound under tax substitution |
| 98 | Other inbound operations |
| 99 | Other operations |
itens[].impostos.cofins.situacaoTributariaCOFINS CST
Same table as PIS.
| Values | Meaning |
|---|---|
| 01 | Taxable at the basic rate |
| 02 | Taxable at a differentiated rate |
| 03 | Taxable by quantity |
| 04 | Single-phase, resale at zero rate |
| 05 | Tax substitution |
| 06 | Zero rate |
| 07 | Exempt |
| 08 | Not levied (export) |
| 09 | Suspended |
| 49 | Other outbound operations |
| 50–56 | Inbound with credit right, by revenue type (returns only) |
| 60–66 | Inbound with presumed credit, by revenue type (returns only) |
| 67 | Presumed credit, other operations (returns only) |
| 70 | Inbound without credit right |
| 71 | Inbound exempt |
| 72 | Inbound suspended |
| 73 | Inbound at zero rate |
| 74 | Inbound not levied |
| 75 | Inbound under tax substitution |
| 98 | Other inbound operations |
| 99 | Other operations |
itens[].impostos.ipi.situacaoTributariaIPI CST
| Values | Meaning |
|---|---|
| 00 | Inbound with credit recovery |
| 01 | Inbound at zero rate |
| 02 | Inbound exempt |
| 03 | Inbound not taxed |
| 04 | Inbound immune |
| 05 | Inbound suspended |
| 49 | Other inbound |
| 50 | Outbound taxed |
| 51 | Outbound at zero rate |
| 52 | Outbound exempt |
| 53 | Outbound not taxed |
| 54 | Outbound immune |
| 55 | Outbound suspended |
| 99 | Other outbound |
| Code | HTTP | |
|---|---|---|
| 10004000 | 404 | The nfeId does not exist. Check the id sent at issuance and the empresaId. |
| 10004001 | 404 | The nfeId does not exist. Check the id sent at issuance and the empresaId. |
| 10003000 | 404 | empresaId does not exist or does not belong to this application. |
