← HomeFleetPay / API

Run automated audit and open case on received CT-e

Parameters, data structure and responses from the versioned contract.

POST/embarcador/auditoria-frete/auditar
auditarCteEmbarcadorSandbox Base: https://api.fleetpay.site/v1

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

Runs automated checks (rate table, blocking, duplicate, execution, tax, compliance and confirmation) on a shipper-received CT-e and records the AuditCase. Requires operacao scope.

Authentication

Required Scope
operacao — Operations
Module
Invoices & Freight Audit
Target Profiles
Shipper · Transport Manager
Schemes
OAuth2 client_credentials (POST /oauth/token) or API Key via Authorization: Bearer / X-Api-Key
[
  {
    "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

Received CT-e identifier and optional reference table.

application/json

inbound_cte_idinteger | nullOptional
access_keystring | nullOptional

44-digit CT-e access key.

freight_rate_table_idinteger | nullOptional

Responses

201 HTTP Response

Audit case created with check results.

application/json

data—Optional
metaobject | nullOptional
additionalPropertiestrue
ambientestringOptional
"homologacao" · "producao"
401 HTTP Response

Missing, invalid or cross-environment credential.

403 HTTP Response

Dashboard scope not enabled or resource outside company scope.

404 HTTP Response

CT-e not found.

422 HTTP Response

Validation failed.

Complete Operation Definition
{
  "tags": [
    "Auditoria de Frete"
  ],
  "operationId": "auditarCteEmbarcador",
  "summary": "Executar auditoria automática e abrir caso em CT-e recebido",
  "description": "Executa os checks automáticos (tabela, bloqueio, duplicidade, execução, tributário, conformidade e confirmação) sobre um CT-e recebido do embarcador e registra o `AuditCase`. Exige escopo `operacao`.",
  "requestBody": {
    "required": true,
    "description": "Identificação do CT-e recebido e tabela de referência opcional.",
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "inbound_cte_id": {
              "type": [
                "integer",
                "null"
              ]
            },
            "access_key": {
              "type": [
                "string",
                "null"
              ],
              "description": "Chave de acesso de 44 dígitos do CT-e."
            },
            "freight_rate_table_id": {
              "type": [
                "integer",
                "null"
              ]
            }
          }
        }
      }
    }
  },
  "responses": {
    "201": {
      "description": "Caso de auditoria criado com resultados dos checks.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "data": {
                "anyOf": [
                  {
                    "type": "object",
                    "additionalProperties": true
                  },
                  {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                ]
              },
              "meta": {
                "type": [
                  "object",
                  "null"
                ],
                "additionalProperties": true
              },
              "ambiente": {
                "type": "string",
                "enum": [
                  "homologacao",
                  "producao"
                ]
              }
            }
          }
        }
      }
    },
    "401": {
      "description": "Credencial ausente, inválida ou de outro ambiente."
    },
    "403": {
      "description": "Escopo do painel não habilitado ou recurso fora do escopo da company."
    },
    "404": {
      "description": "CT-e não encontrado."
    },
    "422": {
      "description": "Falha de validação."
    }
  },
  "x-fleetpay-scope": "operacao",
  "x-fleetpay-module": "faturas-auditoria",
  "x-fleetpay-profiles": [
    "embarcador",
    "gestor"
  ],
  "method": "POST",
  "path": "/embarcador/auditoria-frete/auditar",
  "parameters": []
}