CT-e

Machine translation, not yet reviewed.

CT-e JSON — field reference

Endpoint: GET /api/integration/dfe/cte/inbound/documentos · OpenAPI reference: CT-e Public API.

Reference document — Field-by-field dictionary of the metadata object returned by the inbound CT-e documents endpoint. The same object, compressed (Gzip+Base64), is the content of the json field when json=true.

Endpoint: GET /api/integration/dfe/cte/inbound/documentos · OpenAPI reference: CT-e Public API.

Conventions used in this document

  • emissionDatePart is the document's date partition (derived from chCte), not an instant — it is returned as an ISO string. The other business/audit dates (dhEmi, createdAt, updatedAt) are returned as epoch milliseconds UTC. dhRecbto is returned in ISO format with offset (it was not converted to epoch millis).
  • issuerType is returned as the enum name ("INBOUND"/"OUTBOUND"), not the internal numeric code.
  • The 5 CT-e roles (issuer/recipient, sender, shipper, receiver, service taker) always appear together in the metadata, regardless of which of them is the tenant's company for this item (see companyId).

1. Fields

FieldTypeDescription
emissionDatePartstring (ISO datetime)Document date partition (derived from chCte), not an instant.
idUUIDInternal identifier of the document record.
customerIdUUIDTenant that owns the record.
companyIdUUIDCompany (of the tenant) that is a party to the CT-e for this item — see "Multiplicity per company" on the listing flow page.
externalIdstring, nullableExternal identifier, when provided at ingestion.
issuerTypestring"INBOUND" (received) or "OUTBOUND" (issued by the tenant). Always "INBOUND" in this listing.
dhEmilong (epoch ms)CT-e issuance date/time.
tpCtestringCT-e type (normal, value complement, annulment, replacement).
tpEmisstringIssuance mode (normal, contingency, etc.).
chCtestring (44)CT-e access key — correlation key with the events (see Inbound CT-e document and event reconciliation).
nCTintCT-e number.
serieshortCT-e series.
modstringDocument model: "57" (CT-e), "67" (CT-e OS) or "64" (GTV-e).
vCtdecimalTotal value of the transport service provision.
cnpjCpfEmitDeststringCNPJ/CPF of the issuer/recipient role.
xNomeEmitDeststringName/legal name of the issuer/recipient.
cnpjCpfRemetentestringCNPJ/CPF of the cargo sender.
xNomeRemetentestringName/legal name of the sender.
cnpjCpfExpedidorstringCNPJ/CPF of the shipper.
xNomeExpedidorstringName/legal name of the shipper.
cnpjCpfRecebedorstringCNPJ/CPF of the receiver.
xNomeRecebedorstringName/legal name of the receiver.
cnpjCpfTomadorstringCNPJ/CPF of the service taker.
xNomeTomadorstringName/legal name of the service taker.
statusstringInternal status code (see table in section 2).
cStatshort, nullableSEFAZ return status code (e.g., 100 = authorized).
xMotivostring, nullableReason/message of the SEFAZ protocol.
nProtlong, nullableSEFAZ authorization protocol number.
dhRecbtostring (ISO datetime with offset), nullableDate/time of receipt by SEFAZ.
createdAtlong (epoch ms)When the record was persisted in MI.
updatedAtlong (epoch ms)Last update of the record.
transmittedbooleanDerived from status — see section 2.
inProgressbooleanDerived from status — see section 2.
authorizedbooleanDerived from status — see section 2.
cancelledbooleanDerived from status — see section 2.

2. status codes and the derived booleans

status is the internal lifecycle code of the document in MI (not to be confused with cStat, which is the SEFAZ return code):

CodeMeaning
0Not processed
1Imported
2Processing
3Awaiting receipt confirmation
4Error / aborted
5Authorized
6Denied
7Cancelled
8Not used
9Closed

The item's four booleans are derived from this code:

BooleanRule
authorizedstatus == "5"
cancelledstatus == "7"
inProgressstatus in {"2", "3"}
transmittedstatus in {"5", "6", "7", "8"} — any final result returned by SEFAZ (authorized, denied, cancelled or not used), as opposed to pending/error.

3. Example

{
  "emissionDatePart": "2026-01-01T00:00:00",
  "id": "0198c0de-0000-7000-8000-000000000003",
  "customerId": "0198c0de-0000-7000-8000-000000000001",
  "companyId": "0198c0de-0000-7000-8000-000000000002",
  "issuerType": "INBOUND",
  "dhEmi": 1768469400000,
  "tpCte": "0",
  "tpEmis": "1",
  "chCte": "35260111111111111111570010000000011000000015",
  "nCT": 1,
  "serie": 1,
  "mod": "57",
  "vCt": 1500.00,
  "cnpjCpfEmitDest": "11111111111111",
  "xNomeEmitDest": "Destinatario Ltda",
  "cnpjCpfRemetente": "22222222222222",
  "xNomeRemetente": "Remetente Ltda",
  "cnpjCpfExpedidor": "33333333333333",
  "xNomeExpedidor": "Expedidor Ltda",
  "cnpjCpfRecebedor": "44444444444444",
  "xNomeRecebedor": "Recebedor Ltda",
  "cnpjCpfTomador": "55555555555555",
  "xNomeTomador": "Tomador Ltda",
  "status": "5",
  "cStat": 100,
  "xMotivo": "Autorizado o uso do CT-e",
  "nProt": 135260000000001,
  "dhRecbto": "2026-01-15T09:35:00-03:00",
  "createdAt": 1768478400000,
  "updatedAt": 1768478700000,
  "transmitted": true,
  "inProgress": false,
  "authorized": true,
  "cancelled": false
}

On this page