xmlstringRequiredCT-e XML, raw or base64-encoded. Accepts cteProc (with protocol) or CTe.
maxLength2097152Parameters, data structure and responses from the versioned contract.
/fiscal/cte-subcontratacaoTechnical descriptions are translated from the versioned contract. Original identifiers and JSON are preserved; data examples are omitted.
Submits to FleetPay the XML of a CT-e issued by another company, typically the contracting carrier, which is the source for your subcontracting counter-CT-e.
Other reception methods depend on a third party between you and the platform. Here, your system submits the document directly, making it available in FleetPay even without a contracted automatic reception service.
This also enables POST /fiscal/cte/contra: that endpoint needs the original CT-e XML to prepare the counter-CT-e and can find it here.
Choose one of two forms:
application/json with the xml field: raw XML or base64. Encoding is detected from the content; no flag is required.multipart/form-data with the arquivo field.Accepts cteProc (with protocol) or raw CTe. Limit: 2 MB.
The operation is idempotent by access key. The first submission returns 201; subsequent submissions return 200 with the same resource and an incremented received_count. Network retries, nightly reprocessing and double clicks do not create duplicate records or errors.
If a resubmission contains XML different from the archived version, commonly when sending CTe followed by cteProc with the protocol, the content is replaced by the latest version and content_updated is true.
Recording receipt does not generate any fiscal document. The counter-CT-e is still created through POST /fiscal/cte/contra, with the driver, vehicle and price for your leg; none of these three is in the contracting carrier's XML.
A CT-e that does not allow a counter-CT-e, such as one issued by your own company, is still received: carrier_role identifies your role and allows_counter_cte indicates eligibility, so you do not need to reimplement the rule.
[
{
"oauth2": []
},
{
"chaveApi": []
}
]No parameters declared for this operation.
Required
application/jsonxmlstringRequiredCT-e XML, raw or base64-encoded. Accepts cteProc (with protocol) or CTe.
maxLength2097152multipart/form-dataarquivostring · binaryRequiredCT-e XML, up to 2 MB.
200 HTTP ResponsePreviously known document. Delivery is idempotent: the same resource is returned, with received_count incremented.
application/jsondataobjectRequiredenvironmentobjectRequiredX-Request-IdCall correlation identifier.
201 HTTP ResponseFirst receipt of this document; the resource was created.
application/jsondataobjectRequiredenvironmentobjectRequiredX-Request-IdCall correlation identifier.
400 HTTP ResponseInvalid payload.
X-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.
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.
500 HTTP ResponseInternal failure without operational integration details.
X-Request-IdCall correlation identifier.
{
"tags": [
"CT-e de subcontratação"
],
"summary": "Receber um CT-e de terceiro",
"description": "Entrega à FleetPay o XML de um CT-e emitido por outra empresa — tipicamente o da\ntransportadora **contratante**, que dá origem ao seu contra-CT-e de subcontratação.\n\n## Por que existe\n\nAs demais formas de recepção dependem de um terceiro entre você e a plataforma. Aqui é o\nseu sistema que entrega o documento, e ele passa a existir na FleetPay sem intermediário\n— inclusive quando nenhuma recepção automática está contratada.\n\nÉ também o que destrava `POST /fiscal/cte/contra`: aquele endpoint precisa do XML do CT-e\noriginal para montar o contra-CT-e, e passa a encontrá-lo aqui.\n\n## Como enviar\n\nDuas formas, escolha uma:\n\n- `application/json` com o campo `xml` — o XML cru ou em **base64**. A codificação é\n detectada pelo conteúdo; não há flag a acertar.\n- `multipart/form-data` com o campo `arquivo`.\n\nO documento pode ser o `cteProc` (com protocolo) ou o `CTe` cru. Limite de 2 MB.\n\n## Reenviar é seguro\n\nA operação é **idempotente pela chave de acesso**. O primeiro envio responde `201`; os\nseguintes respondem `200` com o mesmo recurso e `received_count` somado. Retry de rede,\nreprocessamento noturno e clique duplo não criam registro duplicado nem erro.\n\nSe o reenvio trouxer um XML diferente do arquivado — o caso comum é mandar o `CTe` e\ndepois o `cteProc` com o protocolo —, o conteúdo é substituído pelo mais recente e\n`content_updated` vem `true`.\n\n## Receber não é emitir\n\nRegistrar a chegada não gera documento fiscal nenhum. O contra-CT-e continua nascendo em\n`POST /fiscal/cte/contra`, com motorista, veículo e o preço do **seu** trecho — nenhum dos\ntrês está no XML da contratante.\n\nUm CT-e que não admite contra-CT-e (por exemplo, um que a sua própria empresa emitiu) é\nrecebido do mesmo jeito: o campo `carrier_role` nomeia o seu papel e `allows_counter_cte`\nresponde a pergunta prática, sem que você precise reimplementar a regra.\n",
"operationId": "receiveInboundCte",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InboundCteInput"
}
},
"multipart/form-data": {
"schema": {
"type": "object",
"required": [
"arquivo"
],
"properties": {
"arquivo": {
"type": "string",
"format": "binary",
"description": "XML do CT-e, até 2 MB."
}
}
}
}
}
},
"responses": {
"200": {
"$ref": "#/components/responses/InboundCteReceivedAgain"
},
"201": {
"$ref": "#/components/responses/InboundCteReceived"
},
"400": {
"$ref": "#/components/responses/ValidationFailed"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"422": {
"$ref": "#/components/responses/ValidationOrBusinessRuleFailed"
},
"429": {
"$ref": "#/components/responses/RateLimited"
},
"500": {
"$ref": "#/components/responses/InternalError"
}
},
"method": "POST",
"path": "/fiscal/cte-subcontratacao",
"parameters": []
}