Through the BP-e Status Consultation service, it is possible to obtain information about the current status of BP-e in the Sefaz database.
This functionality is widely used in cases where it is necessary to check the existence and validity of a BP-e, as well as to obtain information about the events that occurred with it (eg, not boarding due to Non-Boarding Events).
URL
Production: POST https://bpe.ns.eti.br/v1/bpe/status
Input Data
Field | Description | Data Type | Ocorruncce | Notes |
---|---|---|---|---|
X-AUTH-TOKEN | software house access token | String | 0-1 | |
licencaCnpj | CNPJ of the license interested in consulting the situation of the BP-e | Int | 0-1 | Used to identify the digital certificate that should be usedIf it is not sent, the CNPJ will be extracted from the key sent in the chBPe field |
chBPe | BP-e access key | Int | 1-1 | |
tpAmb | Type of BP-e authorization environment 1 - Production, 2 - Homologation ( Test Environment ) | Int | 1-1 |
Request Example
Chech BPe Situation Request Example
curl -X POST \
-H "Content-Type: application/json" \
-d '{
"X-AUTH-TOKEN": "SEU_TOKEN",
"licencaCnpj": "07364617000135",
"chBPe": "43161107364617000135550000000099461000094833",
"tpAmb": "2"
}'
http://nfehml.ns.eti.br/nfe/stat
Data Returned
Field | Description | Notes |
---|---|---|
status | Processing status code | |
motivo | Literal description of processing status | |
retConsSitBPe | Object containing the BP-e authorization protocol data and all linked events. | Only in status = 200 |
erro | Object containing the error data that occurred during processing | Only in status = -6 or -999 |
erro.cStat | Error status code | |
erro.xMotivo | Literal description of the error |
Response Example
Successful Response
{
"status": 200,
"motivo": "Consulta realizada com sucesso",
"retConsSitBPe": {
"tpAmb": "2",
"verAplic": "RS20171205154014",
"cStat": "100",
"xMotivo": "Autorizado o uso do BP-e",
"cUF": "43",
"protBPe": [
{
"infProt": {
"Id": "BPe143180000001887",
"tpAmb": "2",
"verAplic": "RS20180129113520",
"chBPe": "43180107364617000135630000000000101000000085",
"dhRecbto": "2018-01-31T16:46:20-02:00",
"nProt": "143180000001887",
"digVal": "cO+hoNR2g9RsL1dGF7RuiTf2vzU=",
"cStat": "100",
"xMotivo": "Autorizado o uso do BP-e"
},
"versao": "1.00"
}
],
"versao": "1.00"
}
}
Returned Codes
Code | Description |
---|---|
200 | Consultation successful |
-400 | BP-e Key or Environment (tpAmb) Type not present in the request sent |
-3 | Invalid access key |
-6 | Error while performing the query. Check the error object to get more information. |