CT-e
Query CT-e
Returns status, document data, XML / DACTE download links and the event list.
/openapi/v2/empresas/{empresaId}/cte/{cteId}Requires the token, timestamp and sign signature headers, see Authentication.
Queries by the id sent at issuance. Download links are 10-minute short-lived tokens, re-issued on every query. An unknown cteId returns HTTP 404 with codigo CTe0001.
Parameters
Path parameters
empresaIdstringrequiredCompany (carrier) identifier returned at registration.
Example:1934811222334455cteIdstringrequiredThe
idsent at CT-e issuance.Example:CTE-ORD-1
Responses
Document found.
idstringIntegrator document id.
statusstringDocument status; see the status table below.
Values:PendenteAutorizadaNegadaCanceladaContingenciaFalhamotivoStatusstringStatus explanation:
cStat - xMotivoforNegada, local reason forFalha;nullotherwise.numerointegerCT-e number.
serieintegerCT-e series.
chaveAcessostring44-digit access key.
numeroProtocolostringSEFAZ authorization protocol.
dataEmissaostringIssue date, ISO-8601 in UTC.
dataAutorizacaostringAuthorization date, ISO-8601 in UTC.
tipoEmissaostringEmission type; shows contingency (SVC / EPEC) when the platform switched to it.
Values:NormalEpecFsdaSvcRsSvcSpprotocoloEpecstringEPEC protocol when issued under EPEC contingency;
nullotherwise.linkXmlstringAuthorized XML (cteProc), the legal original. See File download.
linkDactestringDACTE PDF, rendered on the first download; a busy renderer returns 503, retry later.
cteobjectThe issuance request body while the task is in flight; after a terminal state (
Autorizada/Negada/Falha) the accepted parameters are cleared and this field isnull.eventosarrayEvents registered on the document (same shape as List events, without
chaveAcesso).
Errors
| Code | HTTP | |
|---|---|---|
| CTe0001 | 404 |
|
| 10003000 | 404 |
|
Status table
status | Meaning |
|---|---|
Pendente | Accepted, queued or being sent |
Autorizada | Authorized by SEFAZ (cStat 100); linkXml is the cteProc legal original, linkDacte the DACTE PDF |
Negada | Rejected by SEFAZ; motivoStatus is cStat - xMotivo |
Cancelada | Cancelled (110111) |
Contingencia | SEFAZ outage, document pending resubmission |
Falha | Terminal task failure (unparseable parameters, retry budget exhausted, ...); motivoStatus explains; the same id may be resubmitted |
