1. Inicio
  2. Documentos
  3. NS NFe (English)
  4. NFe Issue
  5. Download

Download

The NF-e download method is responsible for return the JSON, XML or the DANFE (Auxiliary Document of Electronic Invoice) from provinding the access key of an authorized NF-e.

URL

Production: POST https://nfe.ns.eti.br/nfe/get

Input data
FieldOccurrenceData TypeDescription
X-AUTH-TOKEN1-1StringUser access token
chNFe1-1IntNF-e access key
printCEAN0-1BooleanPrint EAN code
Standard value: false
tpAmb0-1IntNF-e authorization environment type:
1 - Production
2 - Homologation
Standard value: 2
tpDown1-1StringDownload type:
X - XML
J - JSON
P - PDF
XP - XML and PDF
JP - JSON and PDF
obsCanhoto0-1BolleantPrints infCpl field contents in the stub, instead of "Recebemos de ...."
Request example
NF-e download request
curl -X POST \
    -H "Content-Type: application/json" \
    -d '{"X-AUTH-TOKEN":"YOUR_TOKEN","chNFe":"44444444444444444444444444444444444444444444", "tpDown":"XP"}' \
    https://nfe.ns.eti.br/nfe/get
Returned data
FieldDescriptionNotes
statusProcessing status code
motivoProcessing status literal description
chNFeNF-e access key
xmlAuthorized NF-e distribution XMLOnly when tpDown = X or XP. Only when status = 200
nfeProcJSON object with the authorized NF-e distribution dataOnly when tpDown = J or JP. Only when status = 200
pdfDANFE PDFDANFE PDF Base64. Only when tpDown = `, JP or XP. Only when status = 200
erroObject containing error information when loading an NF-eOnly whe status is different from 200
erro.cStatError status code
erro.xMotivoError literal description
Return examples

Successful return

{
  "status": 200,
  "motivo": "Consulta realizada com sucesso",
  "chNFe": "44444444444444444444444444444444444444444444",
  "xml": "<?xml version=\"1.0\" encoding=\"utf-8\"?><nfeProc versao=\"3.10\" xmlns=\"http://www.portalfiscal.inf.br/nfe\"><NFe>...</NFe><protNFe versao=\"3.10\">...</protNFe></nfeProc>",
  "pdf": "JVBERi0xLjQKJeLjz..."
}
Return codes
CodeDescription
200Download successfully done
-2Invalid download type
Obs.: When the type is different than X, P, J, XP ou JP (case-insensitive)
-3Invalid access key
-4NF-e not found with the informed access key

The NF-e stub can contain the message “Recebemos de …” or the infCpl when requested in the download method.

In addition to these contents, it’s possible to also print the issuer’s desired information on the stub.

For this, it’s necessary to inform, during the issuance, the group “obsCont(Z04)” containing an “xCampo” with value “xObsCanhoto”, then the content of the respective “xTexto” will be printed on the stub.

Como podemos ajudar?