TF Fiscal
Documentation

NF-e

Query NF-e

Returns status, invoice data and DANFE / XML download links.

GET/openapi/v2/empresas/{empresaId}/nf-e/{nfeId}
Requires the 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*
stringCompany identifier
nfeId*
stringInvoice identifier

* Required field

200
Invoice found.
id
stringRequest identifier
tipo
stringDocument type
status
stringInvoice status
motivoStatus
stringDenial reason
ambienteEmissao
stringEnvironment
enviadaPorEmail
boolSent by e-mail
dataCriacao
stringAcceptance time
dataUltimaAlteracao
stringLast change
forcarEmissaoContingencia
boolForced contingency
objectOrder
objectBuyer
numero
stringInvoice number
serie
stringInvoice series
dataEmissao
stringIssue time
chaveAcesso
stringAccess key
objectTransport
dataAutorizacao
stringAuthorization time
linkDanfe
stringDANFE link
linkDownloadXml
stringAuthorized XML link
linkConsultaPorChaveAcesso
stringPublic lookup
objectAuthorization protocol
emitidaEmContingencia
boolIssued in contingency
finalidade
stringPurpose
naturezaOperacao
stringNature of the operation
objectOriginal invoice
arrayItems
valorTotal
numberInvoice total
informacoesAdicionais
stringInvoice remarks
informacoesAdicionaisFisco
stringRemarks 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.

json
{
"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.

json
{
"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.

json
{
"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.

json
{
"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=…"
}