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
| Field | Description | Notes |
|---|---|---|
| status | Processing status code | |
| motivo | Processing status literal description | |
| NF-e PDF in Base64 | Only 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
| Code | Description |
|---|---|
| 200 | NF-e receive and DANFE preview generated successfully |
| -2 | Information 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 |
| -3 | Non-existent validation schema for informed NF-e version in NFe/infNFe/versao |
| -4 | Data sent out of expected pattern. Check the "motivo" field for more information |