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

Event Download

Through the event download service it is possible to obtain the data of an event linked to a BP-e through the NS BP-e API. The event data can be received in XML or JSON.

URL

Production: POST https://bpe.ns.eti.br/v1/bpe/get/event

Input Data
FieldDescriptionOccurrenceData Type
X-AUTH-TOKENsoftware house access token0-1StringCan also be sent in the request header
chBPeBP-e access key1-1Int
tpDownDownload file type:
X - XML, J - JSON
1-1String
tpEventoEvent type:
"NAOEMB";
"CANC";
"ALTPOL";
1-1String"NAOEMB" - Non-Boarding;
"CANC" - Cancellation
"ALTPOL" = Seat Change
nSeqEventoSequential event number0-1IntDefault value: 1
Request Example

Download Event Request

curl -X POST \
-H "Content-Type: application/json" \
-d '{
     "X-AUTH-TOKEN": "SEU_TOKEN", 
     "chBPe": "43170507364617000135580000000003481000033457", 
     "tpDown": "x", 
     "tpEvento": "enc"
     }'
https://bpe.ns.eti.br/v1/bpe/get/event
Returned Data
FieldDescriptionOccurrenceDataTypeParentNotes
statusProcessing status code1-1Int
motivoLiteral description of processing status1-1String
retEventoObject containing the cancellation processing data at Sefaz0-1ObjectOnly with status = 200
cStatEvent status code at Sefaz1-1Int
xMotivoLiteral description of the situation of the event at Sefaz1-1String
chBPeBP-e access key1-1Int
dhRegEventoDate and time of the event registration at Sefaz1-1String ( date and time format )Sefaz Standard: YYYY-MM-DDTHH: MM:SS+UTC.
Ex : 2016-06-13T15: 04: 10-03:00
nProtNumber of the protocol for authorization of the event by Sefaz1-1Int
xmlEvent XML0-1StringOnly when tpDown = X, and in status = 200
jsonEvent JSON0-1ObjectOnly when tpDown = J, and in status = 200
erro
Object containing error information if the event cannot be downloaded successfully
0-1ObjectOnly in status different than 200
erro.cStatError status code1-1Int
erro.xMotivoLiteral description of the error1-1String
Response examples

Successful response

{
    "status": 200,
    "motivo": "Evento localizado com sucesso",
    "retEvento": {
        "cStat": "135",
        "xMotivo": "Evento registrado e vinculado a BP-e",
        "chBPe": "43180207364617000135630000000000311000000089",
        "dhRegEvento": "2018-02-21T16:15:16-03:00",
        "nProt": "143180000002639"
    },
    "xml": "<?xml version=\"1.0\" encoding=\"utf-8\"?><procEventoBPe versao=\"1.00\" xmlns=\"http://www.portalfiscal.inf.br/bpe\">...</procEventoBPe>"
}
Returned Codes
CodeDescription
200Event Download done successfully
-2Invalid access key
-3Invalid event type
-4Invalid download type
-5The event could not be loaded. Check the error object for more information

Como podemos ajudar?