cte_uuidpath · stringRequiredPublic CT-e UUID.
Constraints
{
"type": "string",
"format": "uuid"
}Parameters, data structure and responses from the versioned contract.
/fiscal/cte/{cte_uuid}/subcontratacaoTechnical descriptions are translated from the versioned contract. Original identifiers and JSON are preserved; data examples are omitted.
The contracting company declares which carrier it subcontracted for a CT-e it issued through FleetPay — and its authorized XML is delivered to the subcontracted carrier's tax inbox, exactly as if that carrier had submitted it through POST /fiscal/cte-subcontratacao.
Without this, even with both companies on FleetPay, the subcontracted carrier's ERP had to resend a document the platform already held; skipping that step caused the counter-CT-e batch to report "CT-e original não recebido" (original CT-e not received).
cte_nao_autorizado otherwise); the forwarded XML is the exact byte-for-byte copy archived upon authorization.subcontratada_nao_encontrada, subcontratada_nao_transportadora) and cannot be the same company (subcontratada_igual_contratante).201 on first delivery, 200 on subsequent deliveries.POST /fiscal/cte/contra or POST /fiscal/cte-subcontratacao/lote).Depends on the release containing PR core#1459.
[
{
"oauth2": []
},
{
"chaveApi": []
}
]cte_uuidpath · stringRequiredPublic CT-e UUID.
{
"type": "string",
"format": "uuid"
}Required
application/jsonsubcontratadaobjectRequiredobservacaostring | nullOptionalmaxLength255200 HTTP ResponseResubmission — the subcontractor's inbox already contained the document (received_count incremented).
201 HTTP ResponseFirst delivery — the CT-e entered the subcontractor's inbox.
application/jsondataobjectOptionalenvironmentobjectOptionalX-Request-IdCall correlation identifier.
401 HTTP ResponseFleetPay API key missing or invalid.
X-Request-IdCall correlation identifier.
403 HTTP ResponseFiscal scope disabled for the key, or no active carrier associated with the key.
X-Request-IdCall correlation identifier.
404 HTTP ResponseResource not found in the authenticated tenant.
X-Request-IdCall correlation identifier.
422 HTTP ResponseInvalid payload, outstanding requirement or business rule.
X-Request-IdCall correlation identifier.
429 HTTP ResponsePer-carrier limit exceeded.
X-Request-IdCall correlation identifier.
Retry-AfterSeconds until another attempt.
503 HTTP ResponseArchived XML currently unavailable (xml_indisponivel) — try again.
{
"tags": [
"CT-e de subcontratação"
],
"summary": "Repassar o CT-e à subcontratada (ponte da subcontratação)",
"operationId": "declareCteSubcontracting",
"description": "A **contratante** declara a quem subcontratou um CT-e que ela emitiu pela FleetPay — e o\nXML autorizado dele cai na caixa fiscal da **subcontratada**, exatamente como se ela o\ntivesse entregue em `POST /fiscal/cte-subcontratacao`.\n\nSem isto, com as duas empresas na FleetPay, o ERP da subcontratada precisava reenviar um\ndocumento que a plataforma já tinha; esquecer esse passo fazia o lote de contra-CT-e\nresponder \"CT-e original não recebido\".\n\n- Só CT-e **autorizado** (`cte_nao_autorizado` caso contrário); o XML repassado é o\n arquivado na autorização, byte a byte.\n- A subcontratada precisa ser uma transportadora cliente FleetPay\n (`subcontratada_nao_encontrada`, `subcontratada_nao_transportadora`) e não pode ser a\n própria empresa (`subcontratada_igual_contratante`).\n- A caixa de destino é a do **ambiente do CT-e**; a recepção é idempotente pela chave:\n `201` na primeira entrega, `200` nas seguintes.\n- Nada financeiro acontece aqui; a partir daí a subcontratada segue o fluxo normal\n (`POST /fiscal/cte/contra` ou `POST /fiscal/cte-subcontratacao/lote`).\n\nDepende do release que leva o PR core#1459.\n",
"parameters": [
{
"$ref": "#/components/parameters/CteUuid"
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"subcontratada"
],
"properties": {
"subcontratada": {
"type": "object",
"required": [
"cnpj"
],
"properties": {
"cnpj": {
"type": "string",
"description": "CNPJ da transportadora subcontratada (com ou sem máscara; aceita CNPJ alfanumérico)."
}
}
},
"observacao": {
"type": [
"string",
"null"
],
"maxLength": 255
}
}
}
}
}
},
"responses": {
"200": {
"description": "Reenvio — a caixa da subcontratada já tinha o documento (`received_count` somado)."
},
"201": {
"description": "Primeira entrega — o CT-e entrou na caixa da subcontratada.",
"headers": {
"X-Request-Id": {
"$ref": "#/components/headers/RequestId"
}
},
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "object",
"properties": {
"cte": {
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid"
},
"access_key": {
"type": "string"
}
}
},
"subcontratada": {
"type": "object",
"properties": {
"cnpj": {
"type": "string"
},
"nome": {
"type": [
"string",
"null"
]
}
}
},
"recebimento": {
"$ref": "#/components/schemas/InboundCteReceipt"
}
}
},
"environment": {
"$ref": "#/components/schemas/Environment"
}
}
}
}
}
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"422": {
"$ref": "#/components/responses/ValidationOrBusinessRuleFailed"
},
"429": {
"$ref": "#/components/responses/RateLimited"
},
"503": {
"description": "XML arquivado indisponível agora (`xml_indisponivel`) — tente novamente.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorEnvelope"
}
}
}
}
},
"method": "POST",
"path": "/fiscal/cte/{cte_uuid}/subcontratacao"
}