← HomeFleetPay / API

Authorize a contractor to issue on your behalf

Parameters, data structure and responses from the versioned contract.

POST/fiscal/cte-subcontratacao/autorizacoes
grantEmissionSandbox Base: https://api.fleetpay.site/v1

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

The caller is the subcontractor, which owns the certificate. It authorizes the contracting carrier specified in the body to call POST /fiscal/cte-subcontratacao/lote with subcontratada.cnpj set to its CNPJ. The batch is created in the subcontractor's account, using its certificate, numbering, fiscal inbox, driver and vehicle; the contracting carrier is recorded as the requester. The contracting carrier must be a FleetPay carrier customer. Idempotent: already active → 200.

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

contratanteobjectRequired

Responses

200 HTTP Response

Already authorized (same body as 201).

201 HTTP Response

Authorization granted.

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

contratante_nao_encontrada — the CNPJ does not belong to a carrier customer.

422 HTTP Response

contratante_invalida — the company's own CNPJ, or a body validation error.

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": "Autorizar uma contratante a emitir contra-CT-e em seu nome",
  "operationId": "grantEmission",
  "description": "Quem chama é a **subcontratada** (a dona do certificado): ela autoriza a contratante do corpo\na disparar `POST /fiscal/cte-subcontratacao/lote` com `subcontratada.cnpj` = o CNPJ dela. O\nlote nasce na conta da subcontratada — certificado, numeração, caixa fiscal, motorista e\nveículo dela — e a contratante fica registrada como quem pediu. A contratante precisa ser\ntransportadora cliente da FleetPay. Idempotente: já ativa → `200`.\n",
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "required": [
            "contratante"
          ],
          "properties": {
            "contratante": {
              "type": "object",
              "required": [
                "cnpj"
              ],
              "properties": {
                "cnpj": {
                  "type": "string",
                  "description": "CNPJ da contratante (com ou sem pontuação)."
                }
              }
            }
          }
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "Já estava autorizada (mesmo corpo do `201`)."
    },
    "201": {
      "description": "Autorização concedida.",
      "headers": {
        "X-Request-Id": {
          "$ref": "#/components/headers/RequestId"
        }
      },
      "content": {
        "application/json": {}
      }
    },
    "403": {
      "$ref": "#/components/responses/Forbidden"
    },
    "404": {
      "description": "`contratante_nao_encontrada` — o CNPJ não é de uma transportadora cliente."
    },
    "422": {
      "description": "`contratante_invalida` — o próprio CNPJ; ou erro de validação do corpo."
    },
    "429": {
      "$ref": "#/components/responses/RateLimited"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    }
  },
  "method": "POST",
  "path": "/fiscal/cte-subcontratacao/autorizacoes",
  "parameters": []
}