TF Fiscal
Documentation

CT-e

Query CT-e

Returns status, document data, XML / DACTE download links and the event list.

GET/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

  • empresaIdstringrequired

    Company (carrier) identifier returned at registration.

    Example: 1934811222334455
  • cteIdstringrequired

    The id sent at CT-e issuance.

    Example: CTE-ORD-1

Responses

200

Document found.

  • idstring

    Integrator document id.

  • statusstring

    Document status; see the status table below.

    Values:PendenteAutorizadaNegadaCanceladaContingenciaFalha
  • motivoStatusstring

    Status explanation: cStat - xMotivo for Negada, local reason for Falha; null otherwise.

  • numerointeger

    CT-e number.

  • serieinteger

    CT-e series.

  • chaveAcessostring

    44-digit access key.

  • numeroProtocolostring

    SEFAZ authorization protocol.

  • dataEmissaostring

    Issue date, ISO-8601 in UTC.

  • dataAutorizacaostring

    Authorization date, ISO-8601 in UTC.

  • tipoEmissaostring

    Emission type; shows contingency (SVC / EPEC) when the platform switched to it.

    Values:NormalEpecFsdaSvcRsSvcSp
  • protocoloEpecstring

    EPEC protocol when issued under EPEC contingency; null otherwise.

  • linkXmlstring

    Authorized XML (cteProc), the legal original. See File download.

  • linkDactestring

    DACTE PDF, rendered on the first download; a busy renderer returns 503, retry later.

  • cteobject

    The issuance request body while the task is in flight; after a terminal state (Autorizada / Negada / Falha) the accepted parameters are cleared and this field is null.

  • eventosarray

    Events registered on the document (same shape as List events, without chaveAcesso).

Errors

CodeHTTP
CTe0001404

cteId not found or not owned by the company. Check the id and the empresaId.

10003000404

empresaId not found.

Status table

statusMeaning
PendenteAccepted, queued or being sent
AutorizadaAuthorized by SEFAZ (cStat 100); linkXml is the cteProc legal original, linkDacte the DACTE PDF
NegadaRejected by SEFAZ; motivoStatus is cStat - xMotivo
CanceladaCancelled (110111)
ContingenciaSEFAZ outage, document pending resubmission
FalhaTerminal task failure (unparseable parameters, retry budget exhausted, ...); motivoStatus explains; the same id may be resubmitted