1. Inicio
  2. Documentos
  3. NS BPe (English)
  4. BPe Events
  5. Check BPe Situation

Check BPe Situation

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
FieldDescriptionData TypeOcorruncceNotes
X-AUTH-TOKENsoftware house access tokenString0-1
licencaCnpjCNPJ of the license interested in consulting the situation of the BP-eInt0-1Used 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
chBPeBP-e access keyInt1-1
tpAmbType 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
FieldDescriptionNotes
statusProcessing status code
motivoLiteral description of processing status
retConsSitBPe
Object containing the BP-e authorization protocol data and all linked events.
Only in status = 200
erroObject containing the error data that occurred during processingOnly in status = -6 or -999
erro.cStatError status code
erro.xMotivoLiteral 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
CodeDescription
200Consultation successful
-400BP-e Key or Environment (tpAmb) Type not present in the request sent
-3Invalid access key
-6Error while performing the query. Check the error object to get more information.

Como podemos ajudar?