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
metadataobject returned by the inbound CT-e documents endpoint. The same object, compressed (Gzip+Base64), is the content of thejsonfield whenjson=true.
Endpoint: GET /api/integration/dfe/cte/inbound/documentos · OpenAPI reference: CT-e Public API.
Conventions used in this document
emissionDatePartis the document's date partition (derived fromchCte), not an instant — it is returned as an ISO string. The other business/audit dates (dhEmi,createdAt,updatedAt) are returned as epoch milliseconds UTC.dhRecbtois returned in ISO format with offset (it was not converted to epoch millis).issuerTypeis 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
| Field | Type | Description |
|---|---|---|
emissionDatePart | string (ISO datetime) | Document date partition (derived from chCte), not an instant. |
id | UUID | Internal identifier of the document record. |
customerId | UUID | Tenant that owns the record. |
companyId | UUID | Company (of the tenant) that is a party to the CT-e for this item — see "Multiplicity per company" on the listing flow page. |
externalId | string, nullable | External identifier, when provided at ingestion. |
issuerType | string | "INBOUND" (received) or "OUTBOUND" (issued by the tenant). Always "INBOUND" in this listing. |
dhEmi | long (epoch ms) | CT-e issuance date/time. |
tpCte | string | CT-e type (normal, value complement, annulment, replacement). |
tpEmis | string | Issuance mode (normal, contingency, etc.). |
chCte | string (44) | CT-e access key — correlation key with the events (see Inbound CT-e document and event reconciliation). |
nCT | int | CT-e number. |
serie | short | CT-e series. |
mod | string | Document model: "57" (CT-e), "67" (CT-e OS) or "64" (GTV-e). |
vCt | decimal | Total value of the transport service provision. |
cnpjCpfEmitDest | string | CNPJ/CPF of the issuer/recipient role. |
xNomeEmitDest | string | Name/legal name of the issuer/recipient. |
cnpjCpfRemetente | string | CNPJ/CPF of the cargo sender. |
xNomeRemetente | string | Name/legal name of the sender. |
cnpjCpfExpedidor | string | CNPJ/CPF of the shipper. |
xNomeExpedidor | string | Name/legal name of the shipper. |
cnpjCpfRecebedor | string | CNPJ/CPF of the receiver. |
xNomeRecebedor | string | Name/legal name of the receiver. |
cnpjCpfTomador | string | CNPJ/CPF of the service taker. |
xNomeTomador | string | Name/legal name of the service taker. |
status | string | Internal status code (see table in section 2). |
cStat | short, nullable | SEFAZ return status code (e.g., 100 = authorized). |
xMotivo | string, nullable | Reason/message of the SEFAZ protocol. |
nProt | long, nullable | SEFAZ authorization protocol number. |
dhRecbto | string (ISO datetime with offset), nullable | Date/time of receipt by SEFAZ. |
createdAt | long (epoch ms) | When the record was persisted in MI. |
updatedAt | long (epoch ms) | Last update of the record. |
transmitted | boolean | Derived from status — see section 2. |
inProgress | boolean | Derived from status — see section 2. |
authorized | boolean | Derived from status — see section 2. |
cancelled | boolean | Derived 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):
| Code | Meaning |
|---|---|
0 | Not processed |
1 | Imported |
2 | Processing |
3 | Awaiting receipt confirmation |
4 | Error / aborted |
5 | Authorized |
6 | Denied |
7 | Cancelled |
8 | Not used |
9 | Closed |
The item's four booleans are derived from this code:
| Boolean | Rule |
|---|---|
authorized | status == "5" |
cancelled | status == "7" |
inProgress | status in {"2", "3"} |
transmitted | status 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
}
CT-e events JSON — field reference
Endpoint: GET /api/integration/dfe/cte/inbound/eventos · OpenAPI reference: CT-e Public API.
CT-e document and event reconciliation
The documents (/inbound/documentos) and events (/inbound/eventos) endpoints operate independently. The client consumes each one in its own loop of…