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.
| Field | Occurrence | Type | Dad | Description |
|---|---|---|---|---|
| X-AUTH-TOKEN | 1-1 | A | User access token. It can also be sent via Header or QueryString in the URL. | |
| BPe | 1-1 | O | 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
| Field | Description | Observation |
|---|---|---|
| status | Processing status code | |
| motivo | iteral description of processing status | |
| chBPe | Key of the Note issued in Offline Contingency | Only in status = 200 |
| DABPE with contingency layout in Base64 | Only in status = 200 | |
| xml | XML 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.