Through the event download service, it’s possible to obtain data from an event linked to an NF3-e. The event data can be received in XML or JSON.
URL
Production: POST https://nf3e.ns.eti.br/v1/nf3e/get/event
Input Data
Field | Description | Data Type | Occurrence | |
---|---|---|---|---|
X-AUTH-TOKEN | User access token | String | 1-1 | |
chNF3e | NF3-e access key | Int | 1-1 | |
tpDown | Download file type: X - XML, J - JSON | String | 1-1 | |
tpAmb | NF3-e authorization environment type: 1 - Production, 2 - Homologation | Int | 1-1 | 1 - Production, 2- Homologation |
tpEvento | Event type | String | 1-1 | CANC: Cancellation |
Request Example
Download event request
curl -X POST \
-H "Content-Type: application/json" \
-d '{"X-AUTH-TOKEN": "YOUR_TOKEN", "chNF3e": "43170507364617000135580000000003481000033457","tpAmb":"2", "tpDown": "x", "tpEvento": "canc"}'\
https://nf3e.ns.eti.br/v1/nf3e/get/event
Returned Data
Field | Description | Occurrence | Data Type | Parent | Notes |
---|---|---|---|---|---|
status | Processing status code | 1-1 | Int | ||
motivo | Literal description of the processing status | 1-1 | String | ||
retEvento | Object containing the cancellation processing data at Sefaz | 0-1 | Object | Only when status = 200 | |
cStat | Event status code at Sefaz | 1-1 | Int | retEvento | |
xMotivo | Literal description of the event status at Sefaz | 1-1 | String | retEvento | |
chNF3e | NF3-e access key | 1-1 | Int | retEvento | |
dhRegEvento | Date and time of the event registration at Sefaz | 1-1 | Date | retEvento | Sefaz Standard: YYYY-MM-DDTHH:MM:SS+UTC. E.g.: 2016-06-13T15:04:10-03:00. Only when cStat = 135 |
nProt | Event authorization protocol number by Sefaz | 1-1 | Int | retEvento | |
xml | Event XML | 0-1 | String | Only when tpDown = X. Only when status = 200 | |
json | Event XML JSON | 0-1 | Object | Only when tpDown = J. Only when status = 200 | |
erro | Object containing error information in case the download event cannot be carried out successfully | 0-1 | Object | Only when status is different from 200 | |
cStat | Error status code | 1-1 | Int | erro | |
xMotivo | Literal description of the error | 1-1 | String | erro |
Response Examples
Successful response
{
"status": 200,
"motivo": "Evento localizado com sucesso",
"retEvento": {
"cStat": "135",
"xMotivo": "Evento registrado e vinculado a NF3-e",
"chNF3e": "11111111111111111111111111111111111111111111",
"dhRegEvento": "2021-02-22T10:26:48-03:00",
"nProt": "111111111111111"
},
"xml": "<?xml version=\"1.0\"?><procEventoNF3e versao=\"3.00\" xmlns=\"http://www.portalfiscal.inf.br/mdfe\">...</procEventoNF3e>"
}
Return Codes
Code | Description |
---|---|
200 | Download event done successfully |
-2 | Invalid access key |
-3 | Invalid event type |
-4 | Invalid download type |
-5 | The event could not be loaded. Verify the "erro" object for more information |