← HomeFleetPay / API

Track a contra-CT-e batch

Parameters, data structure and responses from the versioned contract.

GET/fiscal/cte-subcontratacao/lote/{batch_id}
getContraCteBatchSandbox Base: https://api.fleetpay.site/v1

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

Batch status and one row per access key (or leg). The report is saved after each processed key, so you can see issued documents while the batch is still running. Batch status is processing, done or failed; each row's status is pending, emitted, duplicated or failed.

Each emitted row includes counter_cte_id, the counter-CT-e UUID for GET /fiscal/cte/{cte_uuid}, polling and DACTE, and, for legs, documento_financeiro (the leg document accepted by GET /carriers/parcelas-repasse/{documento}). A failure after the provider accepts the document is returned as emitted with financeiro: failed, never as failed without counter_cte_id.

Authentication

[
  {
    "oauth2": []
  },
  {
    "chaveApi": []
  }
]
Availability depends on the environment, enabled scopes and provider. This reference does not execute requests or collect credentials.

Parameters

batch_idpath · stringRequired

Batch UUID returned by POST /fiscal/cte-subcontratacao/lote.

Constraints
{
  "type": "string",
  "format": "uuid"
}

Responses

200 HTTP Response

The batch and the result for each access key.

application/json

Headers

X-Request-Id

Call correlation identifier.

401 HTTP Response

FleetPay API key missing or invalid.

application/json

Headers

X-Request-Id

Call correlation identifier.

403 HTTP Response

Fiscal scope disabled for the key, or no active carrier associated with the key.

application/json

Headers

X-Request-Id

Call correlation identifier.

404 HTTP Response

Batch does not exist or belongs to another carrier (lote_nao_encontrado).

application/json

429 HTTP Response

Per-carrier limit exceeded.

application/json

Headers

X-Request-Id

Call correlation identifier.

Retry-After

Seconds until another attempt.

500 HTTP Response

Internal failure without operational integration details.

application/json

Headers

X-Request-Id

Call correlation identifier.

Complete Operation Definition
{
  "tags": [
    "CT-e de subcontratação"
  ],
  "summary": "Acompanhar um lote de contra-CT-e",
  "operationId": "getContraCteBatch",
  "description": "O estado do lote e **uma linha por chave** (ou por perna). O relatório é gravado a cada\nchave processada: no meio do lote você já vê o que foi emitido. `status` do lote é\n`processing`, `done` ou `failed`; o de cada linha é `pending`, `emitted`, `duplicated` ou\n`failed`.\n\nCada linha `emitted` traz o `counter_cte_id` — o UUID do contra-CT-e para\n`GET /fiscal/cte/{cte_uuid}`, polling e DACTE — e, nas pernas, o `documento_financeiro`\n(o documento da perna, aceito em `GET /carriers/parcelas-repasse/{documento}`). Uma falha\n**depois** de o provedor aceitar o documento vem como `emitted` com `financeiro: failed`,\nnunca como `failed` sem `counter_cte_id`.\n",
  "parameters": [
    {
      "$ref": "#/components/parameters/ContraCteBatchId"
    }
  ],
  "responses": {
    "200": {
      "description": "O lote e o resultado por chave.",
      "headers": {
        "X-Request-Id": {
          "$ref": "#/components/headers/RequestId"
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ContraCteLoteEnvelope"
          }
        }
      }
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "403": {
      "$ref": "#/components/responses/Forbidden"
    },
    "404": {
      "description": "Lote inexistente ou de outra transportadora (`lote_nao_encontrado`).",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ErrorEnvelope"
          }
        }
      }
    },
    "429": {
      "$ref": "#/components/responses/RateLimited"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    }
  },
  "method": "GET",
  "path": "/fiscal/cte-subcontratacao/lote/{batch_id}"
}