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

Issue ( Step 1/3 )

The BP-e issuing service is responsible for carrying out the validation of the BP-e data sent according to the types of data defined by Sefaz XML schemas and sending the document for processing on the WebService of the Portal da Secretaria da Fazenda.

The response of this service contains the receipt status of the BP-e by the API and the code nsNRec for checking on the processing status.

URL

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

Input data

The data for the issuing method can be sent in JSON or XML.

Sending data in JSON format

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

CodeDescription
-400Mandatory fields not filled
-500 or -999Internal API Error
200Success
-401User without permissions to manage taxpayer documents

By clicking on the file below it is possible to download a complete example of NF-e in a JSON format:

Sending data in XML format

To send data in XML, the request’s Content-Type must be defined as application/xml and the X-AUTH-TOKEN must be sent in the HTTP header.

When sending in XML format, the request body must contain the XML content with the BP-e information. This content must be generated from the layout of the Sefaz Contributors’ Guidance Manual.

Clicking on the file below it is possible to download a complete example of BP-e in XML format:

Request example
BP-e issue request in JSON
curl -X POST \
-H "Content-Type: application/json" \
-d '{"
     X-AUTH-TOKEN":"...",
     "BPe":{...}
     }'
https://bpe.ns.eti.br/v1/bpe/issue
BP-e issue request in XML
curl -X POST \
-H "X-AUTH-TOKEN: SEU_TOKEN" \
-H "Content-Type: application/xml" \
-d '<BPe xmlns="http://www.portalfiscal.inf.br/bpe"><infBPe versao="1.00"><ide><cUF>43</cUF>....</BPe>'
https://bpe.ns.eti.br/v1/bpe/issue
Data returned
FieldDescriptionData TypeOccurrenceNotes
StatusProcessing status codeString1-1
MotivoLiteral description of processing statusString1-1
nsNRecBP-e internal API process codeInt0-1Only when status = 200
Return examples

Successful response

{
    "status": 200,
    "motivo": "BP-e enviado para Sefaz",
    "nsNRec": "1234"
}

Response with an error

{
    "status": -2,
    "motivo": "BPe invalido de acordo com a validacao contra schema",
    "erros": [
        "O campo 'CEP' foi preenchido incorretamente com o valor '9003000'. Este campo deve ser preenchido com numeros e conter exatamente 8 caracteres. (cvc-pattern-valid: Value '9003000' is not facet-valid with respect to pattern '[0-9]{8}' for type '#AnonType_CEPTEndeEmi'.)"
    ]
}
Return Codes
CodeDescription
200BPe successfully received and sent to Sefaz
-2Information error according to data type. Check the reason field to identify the incorrect fields
-3No validation scheme for the BP-e version reported in BPe / infBPe / version
-4Data sent outside the expected standard. Check the "motivo" field for more information
-5Error sending BP-e to Sefaz.
Check the error object for more information
-6BP-e previously authorized. Check the processing status of the returned nsNRec.
-7Invalid Content-Type. The content-types accepted by this method are application / json or application / xml.

Como podemos ajudar?