← HomeFleetPay / API

Release installment N for all CT-e in an MDF-e

Parameters, data structure and responses from the versioned contract.

POST/carriers/parcelas-repasse/liberar-por-mdfe
liberarParcelasPorMdfeSandbox 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 release by manifest: provide the MDF-e (UUID, access key, or number) and the installment position, and FleetPay applies liberar to each CT-e linked to the trip — including counter-CT-e documents from a subcontracting batch — returning one result per CT-e. A rejection in one row does not prevent the others from being processed.

Three rules to know before making the request:

  • Only existing installments. An installment is created when the document is scanned; the MDF-e is not treated as a pickup event. A manifest CT-e without an installment at the specified position returns recusada / parcela_inexistente in its row.
  • Only the MDF-e's driver. An installment for another driver returns ignorado / motorista_divergente.
  • The same rules as individual release (evento_fora_de_ordem, parcela_cancelada...), with the same idempotency: an already released installment returns ja_liberada, not an error.

The MDF-e may be a draft — it only selects the CT-e documents. A manifest that belongs to another carrier or does not exist returns 404; a manifest without CT-e documents returns 422.

Authentication

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

Parameters

No parameters declared for this operation.

Request Body

Required

application/json

mdfestringRequired

MDF-e UUID, access key (44) or number.

maxLength64
posicaointegerRequired
minimum1
maximum3
ocorrido_emstring · dateRequired

Event date; today or in the past.

Responses

200 HTTP Response

MDF-e processed; read resumo and documentos[].resultado.

application/json

401 HTTP Response

Unauthenticated (autenticacao): missing, invalid or expired credentials, including an API key used in the wrong environment. A sandbox key is not valid in production, nor a production key in the sandbox; the error message indicates the expected environment.

application/json

errorobjectOptional
403 HTTP Response

Credential does not have the operacao scope enabled.

application/json

errorobjectOptional
404 HTTP Response

MDF-e not found or belongs to another carrier (mdfe_nao_encontrado).

application/json

errorobjectOptional
422 HTTP Response

MDF-e has no linked CT-e (mdfe_sem_documentos), or the payload is invalid.

application/json

errorobjectOptional
Complete Operation Definition
{
  "tags": [
    "Parcelas"
  ],
  "summary": "Liberar a parcela N de todos os CT-e de um MDF-e",
  "operationId": "liberarParcelasPorMdfe",
  "description": "A liberação em **lote pelo manifesto**: informe o MDF-e (uuid, chave de acesso ou número)\ne a posição, e a FleetPay aplica `liberar` a cada CT-e vinculado à viagem — inclusive os\ncontra-CT-e de um lote de subcontratação — devolvendo **um resultado por CT-e**. Uma recusa\nnuma linha não impede as outras.\n\nTrês regras que valem a pena saber antes de chamar:\n\n- **Só parcelas que já existem.** A parcela nasce na bipagem; o MDF-e não é tratado como\n  evento de coleta. CT-e do manifesto ainda sem parcela na posição responde\n  `recusada / parcela_inexistente` na linha dele.\n- **Só o condutor do MDF-e.** Parcela de outro motorista é `ignorado / motorista_divergente`.\n- **Mesmas regras da liberação unitária** (`evento_fora_de_ordem`, `parcela_cancelada`...),\n  e a mesma idempotência: parcela já liberada é `ja_liberada`, não erro.\n\nO MDF-e pode estar em rascunho — ele é só o seletor dos CT-e. Manifesto de outra\ntransportadora ou inexistente responde `404`; manifesto sem CT-e, `422`.\n",
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/LiberarParcelasPorMdfe"
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "O MDF-e foi processado; leia `resumo` e `documentos[].resultado`.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/RespostaParcelasPorMdfe"
          }
        }
      }
    },
    "401": {
      "$ref": "#/components/responses/Erro401"
    },
    "403": {
      "description": "Credencial sem o escopo `operacao` habilitado.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Erro"
          }
        }
      }
    },
    "404": {
      "description": "MDF-e não encontrado, ou de outra transportadora (`mdfe_nao_encontrado`).",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Erro"
          }
        }
      }
    },
    "422": {
      "description": "MDF-e sem CT-e vinculado (`mdfe_sem_documentos`), ou payload inválido.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Erro"
          }
        }
      }
    }
  },
  "method": "POST",
  "path": "/carriers/parcelas-repasse/liberar-por-mdfe",
  "parameters": []
}