1. Inicio
  2. Documentos
  3. NS NFe (English)
  4. Utility Functions
  5. NF-e Preview

NF-e Preview

Through this method, it’s possible to validate the NF-e data and obtain the DANFE PDF fiile no errors are found.

The information that must be sent in this method are the same as that sent the NF-e issuance method. Click here to verify the issuance method.

URL

Production: POST https://nfe.ns.eti.br/util/preview/nfe

Returned data
FieldDescriptionNotes
statusProcessing status code
motivoProcessing status literal description
pdfNF-e PDF in Base64Only when status = 200
Return examples

Successful return

{
   "status": 200,
   "motivo": "Pre-visualizacao gerada com sucesso",
   "pdf": "JVBERi0xLjQKJeLjz..."
}

Return with error

{
   "status": -2,
   "motivo": "NFe invalido de acordo com a validacao contra schema",
   "erros": [
   "O campo 'vPIS' e de preenchimento obrigatorio e nao foi preenchido. Este campo deve ser informado antes do campo 'qBCProd' com numeros contendo no maximo 15 casas inteiras e 2 decimais. (cvc-complex-type.2.4.a: Invalid content was found starting with element 'qBCProd'. One of '{\"http://www.portalfiscal.inf.br/nfe\":vPIS}' is expected.)",
   "O campo 'vCOFINS' e de preenchimento obrigatorio e nao foi preenchido. Este campo deve ser informado antes do campo 'qBCProd' com numeros contendo no maximo 15 casas inteiras e 2 decimais. (cvc-complex-type.2.4.a: Invalid content was found starting with element 'qBCProd'. One of '{\"http://www.portalfiscal.inf.br/nfe\":vCOFINS}' is expected.)"
   ]
}
Return codes
CodeDescription
200NF-e receive and DANFE preview generated successfully
-2Information error according to data type. Check the "motivo" field to identify the incorrect fields. The errors will be found in the "erro" object, which is an array of strings
-3Non-existent validation schema for informed NF-e version in NFe/infNFe/versao
-4Data sent out of expected pattern. Check the "motivo" field for more information

Como podemos ajudar?