1. Inicio
  2. Documentos
  3. NS NFe (English)
  4. NFe Issue
  5. Issue

Issue

The NF-e issuance service is responsible for validating the NF-e data sent according to the data types defined by Sefaz’s XML schemas and carrying out the document for processing in the WebService of the Portal da Secretaria da Fazenda.

The return of this service contains the NF-e receipt status by the API and the nsNRec code for consulting the processing status.

Fields auto-filled by the API

The list below shows the fields and attributes of the emission layout that will be automatically filled by the API if they are not sent:

  • Id (infNFe tag attribute)
  • cNF
  • cDV
  • dhCont
  • xJust
URL

Production: POST https://nfe.ns.eti.br/nfe/issue

Input Data

The NF-e data for the issuance method can be sent in JSON, XML or TXT.

Sending data in JSON format

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

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

Sending data in XML format

To send data in XML, the Content-Type of the request 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 contains the XML content with the NF-e information. This content must be generated from the layout of the Sefaz Contributors’ Guidance Manual.

By clicling the file below it’s possible to download a complete example of NF-e in XML format.

Sending data in TXT format

To send in TXT, the Content-Type of the request must be defined as text/plain;charset=utf-8 and the X-AUTH-TOKEN must be sent in the HTTP header.

When sending in TXT format, the request body must contains the TXT content with the NF-e information. This content must be generated from the TXT issuance layout by the the local integrator of NS Tecnologia.

It’s also possible to issue using the layout of the public issuer. For that, just sent the TXT content in this layout and inform the header layout with the public value in the request headers.

By clicking the file below it’s possible to download a complete example of NF-e in TXT format.

Request example
NF-e issuance request in JSON
curl -X POST \
    -H "Content-Type: application/json" \
    -d '{"X-AUTH-TOKEN":"...","NFe":{...}}' \
    https://nfe.ns.eti.br/nfe/issue
NF-e issuance request in TXT
curl -X POST \
    -H "X-AUTH-TOKEN: YOUR_TOKEN" \
    -H "Content-Type: text/plain" \
    -d 'NOTA FISCAL|1| \
        A|3.10||' \
    https://nfe.ns.eti.br/nfe/issue
NF-e issuance request in XML
curl -X POST \
    -H "X-AUTH-TOKEN: YOUR_TOKEN" \
    -H "Content-Type: application/xml" \
    -d '<NFe xmlns="http://www.portalfiscal.inf.br/nfe"><infNFe versao="3.10" ><ide><cUF>43</cUF><cNF>00009483</cNF><natOp>VENDA DE MERCADORIA</natOp>...</NFe>' \
    https://nfe.ns.eti.br/nfe/issue
Returned data
FieldDescriptionNotes
statusProcessing status code
motivoProcessing status literal description
nsNRecNF-e receipt protocolOnly when status = 200
Return examples

Successful return

{
  "status": 200,
  "motivo": "NF-e enviada para Sefaz",
  "nsNRec": "1438"
}

Return with data error

{
  "status": -2,
  "motivo": "NFe invalido de acordo com a validacao contra schema",
  "erros": [
    "cvc-pattern-valid: Value '9618000' is not facet-valid with respect to pattern '[0-9]{8}' for type '#AnonType_CEPTEndereco'.",
    "O campo 'CEP' foi preenchido incorretamente com o valor '9618000'. Este campo deve ser preenchido com numeros e conter exatamente 8 caracteres."
  ]
}
Return codes
CodeDescription
200NF-e successfully received and sent to Sefaz
-2Information error according to data type. Check the "motivo" reason to identify the incorrect fields
-3Non-existent validation scheme for the NF-e version informed in NFe/infNFe/versao
-4Data sent out of the expected pattern. Check the "motivo" field for more information
-5Error sending NF-e to Sefaz. Check the "erro" object for more information
-6NF-e already sent and with status not consulted
-7NF-e already sent and authorized

Como podemos ajudar?