← HomeFleetPay / API

Simulate freight rate table calculation and audit breakdown

Parameters, data structure and responses from the versioned contract.

POST/embarcador/auditoria-frete/simular
simularAuditoriaFreteEmbarcadorSandbox Base: https://api.fleetpay.site/v1

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

Calculates expected freight from a rate table (freight_rate_table_id), weight, distance and provided components, indicating estimated divergence without recording a final case. Requires consultas scope.

Authentication

Required Scope
consultas — Queries
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

Freight parameters and rate table ID.

application/json

freight_rate_table_idintegerRequired
charged_amountnumberRequired
weight_kgnumber | nullOptional
distance_kmnumber | nullOptional
origin_ufstring | nullOptional
destination_ufstring | nullOptional

Responses

200 HTTP Response

Operation processed successfully.

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.

422 HTTP Response

Invalid simulation parameters.

Complete Operation Definition
{
  "tags": [
    "Auditoria de Frete"
  ],
  "operationId": "simularAuditoriaFreteEmbarcador",
  "summary": "Simular memória de cálculo e auditoria de tabela de frete",
  "description": "Calcula o frete esperado a partir de uma tabela (`freight_rate_table_id`), peso, distância e componentes informados, indicando divergência estimada sem gravar caso definitivo. Exige escopo `consultas`.",
  "requestBody": {
    "required": true,
    "description": "Parâmetros do frete e ID da tabela de frete.",
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "required": [
            "freight_rate_table_id",
            "charged_amount"
          ],
          "properties": {
            "freight_rate_table_id": {
              "type": "integer"
            },
            "charged_amount": {
              "type": "number"
            },
            "weight_kg": {
              "type": [
                "number",
                "null"
              ]
            },
            "distance_km": {
              "type": [
                "number",
                "null"
              ]
            },
            "origin_uf": {
              "type": [
                "string",
                "null"
              ]
            },
            "destination_uf": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "Operação processada com sucesso.",
      "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."
    },
    "422": {
      "description": "Parâmetros de simulação inválidos."
    }
  },
  "x-fleetpay-scope": "consultas",
  "x-fleetpay-module": "faturas-auditoria",
  "x-fleetpay-profiles": [
    "embarcador",
    "gestor"
  ],
  "method": "POST",
  "path": "/embarcador/auditoria-frete/simular",
  "parameters": []
}