1. Inicio
  2. Documentos
  3. NS BPe (English)
  4. BPe Issue Process Conting...
  5. Issue Offline Contingency ( Step 1/1 )

Issue Offline Contingency ( Step 1/1 )


Issuance of BP-e in Contingency

The BP-e contingency issuance service is responsible for validating the BP-e data sent according to the data types defined by Sefaz’s XML schemas and generating the contingency DABPE, together with the XML that must be sent later for authorization at the Treasury Department.


The return of this service contains the pdf for viewing the note in contingency and the complete xml for later issuance in the NS BP-e API.

URL

Production: POST https://bpe.ns.eti.br/v1/bpe/cont/issue


Input data

The BP-e data for the emission method can be sent in JSON or XML.


Sending data in JSON format

To send data in JSON, the Content-Type of the request must be defined as application/json.

FieldOccurrenceTypeDadDescription
X-AUTH-TOKEN1-1AUser access token. It can also be sent via Header or QueryString in the URL.
BPe1-1O
BP-e data (according to Sefaz Taxpayer Guidelines Manual)

Requisition example

BP-e issuance request in JSON

curl -X POST \
-H "Content-Type: application/json" \
-d '{
     "X-AUTH-TOKEN":"...",
     "BPe":{...}
     }' \
https://bpe.ns.eti.br/v1/bpe/cont/issue

BP-e issuance request in XML

curl -X POST \
-H "X-AUTH-TOKEN: SEU_TOKEN" \
-H "Content-Type: application/xml" \-d '<?xml version="1.0" encoding="utf-8"?><bpeProc versao="1.00" xmlns="http://www.portalfiscal.inf.br/bpe"><BPe><infBPe versao="1.00" Id="BPe43211207364617000135630060000027241744225835"><ide><cUF>43</cUF><tpAmb>2</tpAmb><mod>63</mod>\
https://bpe.ns.eti.br/v1/bpe/cont/issue

Data returned
FieldDescription
Observation
statusProcessing status code
motivoiteral description of processing status
chBPeKey of the Note issued in Offline ContingencyOnly in status = 200
pdfDABPE with contingency layout in Base64Only in status = 200
xmlXML with tweaks for later issuance attempt

Return successfully
{
    "status": 200,
    "motivo": "BP-e enviado para Sefaz",
    "chBPe": "1234",
    "xml": "<?xml version=\"1.0\" encoding=\"utf-8\"?><BPe>...</BPe>",
    "pdf: "JVBERi0xLjQKJeLjz..."}


BPe Authorization Issued in Offline Contingency

You must issue your document issued in contingency within a period of 168 hours (One week) for the BP-e to be authorized at Sefaz, using the XML returned from the API in this endpoint.To authorize the Bpe check the method BPe Issue Process.

Como podemos ajudar?