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

Download

The CT-e download method is responsible for returning the XML and the DACTE (Electronic Auxiliary Document of Transport Knowledge) from providing the access key of an authorized CT-e.

URL

3.00 version

Production: POST https://cte.ns.eti.br/cte/get/300

Input data
FieldOccurrenceDescription
X-AUTH-TOKEN1-1User access token
chCTe1-1CT-e access key
tpAmb1-1CT-e authorization environment type: 1 - Production, 2 - Homologation
CNPJ1-1Issuer CNPJ
tpDown1-1Download type:
"X" - XML,
"J" - JSON,
"P" - PDF,
"XP" - XML and PDF,
"JP" - JSON and PDF
Request example

CT-e download request

curl -X POST 
    \-H "Content-Type: application/json"
    \-d '{
      "X-AUTHTOKEN":"...",
      "chCTe":"44444444444444444444444444444444444444444444", 
      "CNPJ": "11111111111111",
      "tpAmb": "2", 
      "tpDown":"XP"
     }' \
    https://cte.ns.eti.br/cte/get/300
Returned data
FieldDescriptionNotes
statusProcessing status code
motivoProcessing status literal description
chCTeCT-e access key
xmlDistribution XML of the authorized CT-eOnly when tpDown = "X" (or "XP") and with status = 200
cteProcJSON object containing the distribution data of the authorized CT-eOnly when tpDown = "J" (or "JP") and with status = 200
pdfDACTEDACTE PDF in Base64. Only when tpDown = "P" (or "XP" or "JP") and with status = 200
erroObject containing error information when downloading the CT-eOnly when status = -6
cStatError status code
xMotivoError literal description
Return example

Successful return

{
    "status": 200,
    "motivo": "Consulta realizada com sucesso",
    "chCTe": "44444444444444444444444444444444444444444444",
    "xml": "<cteProc>...</cteProc>",
    "pdf: "JVBERi0xLjQKJeLjz..."
}
Return codes
CodeDescription
200Download carried out successfully
-2Mandatory fields in the request not informed
-3Invalid download type. Obs.: When the is different from "X", "P", "XP", "J" or "JP"
-4Invalid access key
-5CT-e with informed key not found
-6Error loading the CT-e
-400Mandatory fields in the request not informed

Como podemos ajudar?