ctesarrayRequiredEach item is the key (string) or an object with chave and the optional fields.
minItems1Technical descriptions are translated from the versioned contract. Original identifiers and JSON are preserved; data examples are omitted.
ctesarrayRequiredEach item is the key (string) or an object with chave and the optional fields.
minItems1motoristaobjectRequiredplacastringRequiredpattern"^[A-Za-z]{3}[0-9][A-Za-z0-9][0-9]{2}$"valoresobjectOptionalorigemobjectOptionaldestinoobjectOptionaltipo_servicointeger | nullOptionalide/tpServ for the batch's counter-CT-e documents: 1 subcontracting (default), 2 onward carriage, 3 intermediate onward carriage. Can be overridden per key (ctes[].tipo_servico) and per leg (pernas[].tipo_servico). For 2/3, the route segment (origem and destino) is required.
1 · 2 · 3 · nullrepasseobjectOptionalOptional. Without this block, the batch is tax documents only: it issues counter-CT-e documents without creating a transfer group, installment or leg ROUTE, or neutralizing the source document's transfer — issued rows return financeiro: "nenhum". With the block, the source CT-e — in the contracting company's account — joins its transfer group with these installments and the batch's driver: the contracting company pays the driver, and the subcontracted carrier never receives a financial document. The payments service sends funds to the individual driver's account or to their carrier's Operational Account for a legal entity. Requires the contracting company's opt-in; without it, the row returns financeiro: "nenhum" with motivo: contratante_sem_opt_in.
referencia_externastring | nullOptionalYour identifier, returned in external_reference.
maxLength64subcontratadaobjectOptionalOn behalf of the subcontracted carrier. The CONTRACTING COMPANY makes the request using its own API key, and the batch is created in the subcontracted carrier's account for this CNPJ — using that carrier's certificate, numbering, tax inbox, driver and vehicle. Requires authorization granted by the subcontracted carrier through POST /fiscal/cte-subcontratacao/autorizacoes; without it, returns 403 emissao_nao_autorizada; a CNPJ that is not a customer returns 404 subcontratada_nao_encontrada. The company's own CNPJ is accepted and changes nothing. With repasse, the contracting company's opt-in is implicit: it requested issuance itself.
{
"type": "object",
"required": [
"ctes",
"motorista",
"placa"
],
"properties": {
"ctes": {
"type": "array",
"minItems": 1,
"description": "Cada item é a chave (string) ou um objeto com `chave` e os campos opcionais.",
"items": {
"oneOf": [
{
"type": "string",
"minLength": 44,
"maxLength": 44
},
{
"$ref": "#/components/schemas/ContraCteLoteItem"
}
]
}
},
"motorista": {
"type": "object",
"required": [
"cpf"
],
"properties": {
"cpf": {
"type": "string",
"description": "CPF do motorista (com ou sem pontuação). No lote de pernas é o padrão das pernas sem motorista próprio."
}
}
},
"placa": {
"type": "string",
"pattern": "^[A-Za-z]{3}[0-9][A-Za-z0-9][0-9]{2}$"
},
"valores": {
"type": "object",
"properties": {
"frete_bruto": {
"type": "number",
"minimum": 0.01,
"description": "Rateia `total ÷ N` entre as chaves/pernas (resíduo de centavos nas últimas). Exclusivo com `valor` por chave/perna."
}
}
},
"origem": {
"$ref": "#/components/schemas/ContraCteLoteRota"
},
"destino": {
"$ref": "#/components/schemas/ContraCteLoteRota"
},
"tipo_servico": {
"type": [
"integer",
"null"
],
"enum": [
1,
2,
3,
null
],
"description": "`ide/tpServ` dos contra-CT-e do lote: `1` subcontratação (padrão), `2` redespacho,\n`3` redespacho intermediário. Sobrescrevível por chave (`ctes[].tipo_servico`) e por\nperna (`pernas[].tipo_servico`). Em `2`/`3` o trecho (`origem` e `destino`) é obrigatório.\n"
},
"repasse": {
"type": "object",
"required": [
"parcelas"
],
"description": "**Opcional.** Sem este bloco o lote é **só fiscal**: emite os contra-CT-e e não cria grupo de\nrepasse, parcela, ROUTE de perna nem neutraliza o repasse da origem — as linhas emitidas voltam\ncom `financeiro: \"nenhum\"`. Com o bloco, o CT-e de origem — na conta da **contratante** — entra\nnum grupo de repasse dela com estas parcelas e o motorista do lote: quem paga o motorista é a\ncontratante, e a subcontratada nunca ganha documento financeiro. O payments manda o dinheiro\npara a conta de motorista (PF) ou para a Conta Operação da transportadora dele (PJ). Exige o\nopt-in da contratante; sem ele a linha volta `financeiro: \"nenhum\"` com\n`motivo: contratante_sem_opt_in`.\n",
"properties": {
"parcelas": {
"type": "array",
"minItems": 1,
"maxItems": 3,
"description": "Posições contíguas a partir de 1; percentuais somam 100.",
"items": {
"$ref": "#/components/schemas/ContraCteLoteParcela"
}
}
}
},
"referencia_externa": {
"type": [
"string",
"null"
],
"maxLength": 64,
"description": "Identificador seu, devolvido em `external_reference`."
},
"subcontratada": {
"type": "object",
"required": [
"cnpj"
],
"description": "**Em nome da subcontratada.** A chamada é da CONTRATANTE (chave de API dela) e o lote nasce\nna conta da subcontratada deste CNPJ — certificado, numeração, caixa fiscal, motorista e\nveículo dela. Exige a autorização concedida pela subcontratada em\n`POST /fiscal/cte-subcontratacao/autorizacoes`; sem ela, `403 emissao_nao_autorizada`;\nCNPJ que não é cliente, `404 subcontratada_nao_encontrada`. O próprio CNPJ é aceito e não\nmuda nada. Com `repasse`, o opt-in da contratante é implícito: ela mesma pediu a emissão.\n",
"properties": {
"cnpj": {
"type": "string",
"description": "CNPJ da subcontratada (com ou sem pontuação)."
}
}
}
}
}