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

NFe Event Download

Through the Event Download service, it’s possible to obtain the data of an Cancellation or Correction Letter event linked to an NF-e. The event data can be received in XML or JSON. In addition, it’s also possible to receive a graphical representation of the event in PDF format.

URL

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

Input data
FieldDescriptionNotes
X-AUTH-TOKENUser access token
chNFeNF-e access key
tpAmbNF-e authorization environment type:
1 - Production
tpDownDownload type:
X - XML
J - JSON
P - PDF
XP - XML and PDF
JP - JSON and PDF
tpEventoEvent type:
CCE
CANC
CCE: Correction Letter
CANC: Cancellation
nSeqEventoEvent sequential numberOnly when downloading a CC-e. For CANC it will be always 1.
Request example

Download event request

curl -X POST \
    -H "Content-Type: application/json" \
    -d '{
         "X-AUTH-TOKEN": "YOUR_TOKEN", 
         "chNFe": "43161107364617000135550000000099341000094932", 
         "tpDown": "xp", 
         "tpEvento": "cce", 
         "nSeqEvento": 1, 
         "tpAmb": 1
         }'\
    https://nfe.ns.eti.br/nfe/get/event
Returned data
FieldDescriptionNotes
statusProcessing status code
motivoProcessing status literal description
retEventoNF-e receipt protocolOnly when status = 200
retEvento.cStatEvent processing situation code at Sefaz
retEvento.xMotivoEvent situation literal description at Sefaz
retEvento.chNFeNF-e access key
retEvento.dhRegEventoDate and time of registration of the event at SefazSefaz Standard: YYYY-MM-DDTHH:MM:SS+UTC. E.g.: 2016-06-13T15:04:10-02:00
retEvento.nProtSefaz authorization protocol number for the event
xmlEvent XMLOnly when tpDown = X or XP. Only when status = 200
jsonEvent XML JSONOnlye when tpDown = J or JP. Only when status = 200
pdfEvent graphical representation in PDFBase64 PDF. Only when tpDown = P, JP, or XP. Only when status = 200
erroObject contaning error information in case the download could not be carried out successfullyOnly when status is different from 200
erro.cStatError status code
erro.xMotivoError literal description
Return example
{
  "status": 200,
  "motivo": "Consulta realizada com sucesso",
  "retEvento": {
    "cStat": "135",
    "xMotivo": "Evento registrado e vinculado a NF-e",
    "chNFe": "43161107364617000135550000000099341000094832",
    "dhRegEvento": "2016-11-29T19:15:42-02:00",
    "nProt": "143160001512983"
  },
  "xml": "<?xml version=\"1.0\" encoding=\"utf-8\"?><procEventoNFe versao=\"1.00\" xmlns=\"http://www.portalfiscal.inf.br/nfe\">...</procEventoNFe>",
  "pdf": "JVBERi0xLjQKJe..."
}
Return codes
CodeDescription
200NF-e downloaded successfully
-2Invalid access key
-3Invalid event type
-4Invalid download type
-5Not possible to load the event. Check the "erro" object for more information

Como podemos ajudar?