← HomeFleetPay / Schema

Cte

Structure preserved from the versioned API contract.

Technical descriptions are translated from the versioned contract. Original identifiers and JSON are preserved; data examples are omitted.

idstring · uuidRequired

Public UUID used in all CT-e paths.

freightobjectRequired
access_keystring | nullRequired
pattern"^\\d{44}$"
numberinteger | nullRequired
seriesstring | nullRequired
protocolstring | nullRequired
sefaz_protocolstring | nullRequired
cstatstring | nullRequired
reasonstring | nullRequired
authorized_atstring | null · date-timeRequired
service_typeintegerRequired

Document ide/tpServ: 0 normal, 1 subcontracting, 2 onward carriage, 3 intermediate onward carriage (4 only in old drafts, which cannot be issued). A counter-CT-e saved before this field existed is 1.

minimum0
maximum4
service_type_labelstringRequired

Human-readable service_type label, for example Redespacho.

nfe_countintegerOptional

Included in listings.

minimum0
has_mdfebooleanOptional

Included in listings.

payloadobjectOptional

Included in the detail response; contains the draft's validated public payload.

additionalPropertiestrue
nfearrayOptional

Included in the detail response.

eventsarrayOptional

Included in the detail response.

created_atstring | null · date-timeRequired
updated_atstring | null · date-timeRequired
financial_documentobject | nullOptional

Only for a counter-CT-e leg: the leg's financial document, which carries the driver's transfer. internal_id has the format ROUTE:<lote>:<hex> and is accepted by GET /carriers/parcelas-repasse/{documento}; access_key is the counter-CT-e access key, recorded when SEFAZ authorizes it. null for other CT-e documents.

Original JSON Definition (Portuguese Descriptions)
{
  "type": "object",
  "required": [
    "id",
    "status",
    "lifecycle_status",
    "freight",
    "route",
    "access_key",
    "number",
    "series",
    "protocol",
    "sefaz_protocol",
    "cstat",
    "reason",
    "authorized_at",
    "service_type",
    "service_type_label",
    "ciot",
    "created_at",
    "updated_at"
  ],
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "UUID público usado em todos os caminhos do CT-e."
    },
    "status": {
      "$ref": "#/components/schemas/CteSituation"
    },
    "lifecycle_status": {
      "$ref": "#/components/schemas/CteLifecycleStatus"
    },
    "freight": {
      "type": "object",
      "required": [
        "total_value",
        "cargo_value"
      ],
      "properties": {
        "total_value": {
          "type": [
            "number",
            "null"
          ],
          "format": "double"
        },
        "cargo_value": {
          "type": [
            "number",
            "null"
          ],
          "format": "double"
        }
      }
    },
    "route": {
      "$ref": "#/components/schemas/FiscalRoute"
    },
    "access_key": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^\\d{44}$"
    },
    "number": {
      "type": [
        "integer",
        "null"
      ]
    },
    "series": {
      "type": [
        "string",
        "null"
      ]
    },
    "protocol": {
      "type": [
        "string",
        "null"
      ]
    },
    "sefaz_protocol": {
      "type": [
        "string",
        "null"
      ]
    },
    "cstat": {
      "type": [
        "string",
        "null"
      ]
    },
    "reason": {
      "type": [
        "string",
        "null"
      ]
    },
    "authorized_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "service_type": {
      "type": "integer",
      "minimum": 0,
      "maximum": 4,
      "description": "`ide/tpServ` do documento: `0` normal, `1` subcontratação, `2` redespacho, `3`\nredespacho intermediário (`4` só em rascunhos antigos, que não emitem). Um contra-CT-e\ngravado antes do campo é `1`.\n"
    },
    "service_type_label": {
      "type": "string",
      "description": "Rótulo legível do `service_type` — ex.: `Redespacho`.\n"
    },
    "ciot": {
      "$ref": "#/components/schemas/CteCiotSummary"
    },
    "nfe_count": {
      "type": "integer",
      "minimum": 0,
      "description": "Presente nas listagens."
    },
    "has_mdfe": {
      "type": "boolean",
      "description": "Presente nas listagens."
    },
    "payload": {
      "type": "object",
      "additionalProperties": true,
      "description": "Presente no detalhe; contém o payload público validado do rascunho."
    },
    "nfe": {
      "type": "array",
      "description": "Presente no detalhe.",
      "items": {
        "$ref": "#/components/schemas/Nfe"
      }
    },
    "events": {
      "type": "array",
      "description": "Presente no detalhe.",
      "items": {
        "$ref": "#/components/schemas/CteEvent"
      }
    },
    "created_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "updated_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "financial_document": {
      "type": [
        "object",
        "null"
      ],
      "description": "Só para **perna de contra-CT-e**: o documento financeiro da perna (o que carrega o\nrepasse ao motorista). `internal_id` tem a forma `ROUTE:<lote>:<hex>` e é aceito em\n`GET /carriers/parcelas-repasse/{documento}`; `access_key` é a chave do contra-CT-e,\ncarimbada quando a SEFAZ autoriza. `null` nos demais CT-e.\n",
      "properties": {
        "id": {
          "type": "integer"
        },
        "internal_id": {
          "type": "string"
        },
        "access_key": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    }
  }
}