Through this method it’s possible to validate the date of the CT-e and obtain the PDF file of the DACTE if no errors are found.
The information that must be sent in this method are the same as that sent in the CT-e issuance method. Click here to verify the issuance method.
URL
CT-e 3.00 Production: POST https://cte.ns.eti.br/util/previa/cte
CT-e OS Production: POST https://cte.ns.eti.br/util/previa/cteos
Returned data
Field | Description | Notes |
---|---|---|
status | Processing status code | |
motivo | Processing status literal description | |
PDF in Base64 of the CT-e | Only when status = 200 |
Return examples
Successful return
{
"status": 200,
"motivo": "Previa gerada com sucesso",
"pdf": "JVBERi0xLjQKJeLjz..."
}
Return with error
{
"status": -2,
"motivo": "CTe invalido de acordo com a validacao contra schema",
"erros": [
"O campo 'mod' e de preenchimento obrigatorio e nao foi preenchido..."
]
}
Return codes
Code | Description |
---|---|
200 | Preview generated successfully |
-2 | CT-e not informed or empty |
-3 | infModal not informed or empty |
-4 | Error information according to the data type. Verify the "motivo" field to idenfity the incorrect fields. The errors will be found in the "erros" object, which is an array of string |
-5 | Validation schema not found. Verify the version informed in CTe/infCTe/versao |
-10 | Error getting the QRCode URL |