← HomeFleetPay / API

Import order batch (CSV/XLSX) or invoices (XML/PDF/ZIP)

Parameters, data structure and responses from the versioned contract.

POST/embarcador/solicitacoes-transporte/lotes
importarLoteSolicitacoesTransporteEmbarcadorSandbox Base: https://api.fleetpay.site/v1

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

Processes in batch an order spreadsheet (batch_type: order_spreadsheet, CSV or XLSX) or invoice files (batch_type: fiscal_documents, XML, PDF or ZIP), validating row by row / file by file. Valid items generate traceable requests (in pre-contracting stage, never silently contracted); invalid items record structured per-row/column diagnostics for correction and reprocessing without duplicating created items.

Authentication

Required Scope
operacao — Operations
Module
Direct Contracting (Shipper)
Target Profiles
Shipper · Transport Manager · Dedicated Fleet Contractor
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

Idempotency-Keyheader · stringOptional
Constraints
{
  "type": "string"
}

Request Body

Required

multipart/form-data

batch_typestringOptional
"order_spreadsheet" · "fiscal_documents"
carrier_shipper_idinteger | nullOptional
shipper_negotiation_idinteger | nullOptional
contract_modestring | nullOptional
"period_contract" · "spot" · null
operation_typestring | nullOptional
"urban_delivery" · "closed_load" · "full_load" · null
arquivostring · binaryOptional
arquivosarrayOptional

Responses

201 HTTP Response

Batch processed with summary of valid and invalid rows

application/json

successbooleanOptional
dataobjectOptional
422 HTTP Response

Missing or invalid file

application/json

errorobjectOptional
Complete Operation Definition
{
  "tags": [
    "Solicitações e Contratação de Transporte (Embarcador)"
  ],
  "summary": "Importar lote de pedidos (CSV/XLSX) ou notas fiscais (XML/PDF/ZIP)",
  "description": "Processa em lote uma planilha de pedidos (`batch_type: order_spreadsheet`, CSV ou XLSX) ou arquivos de notas fiscais (`batch_type: fiscal_documents`, XML, PDF ou ZIP), validando linha a linha / arquivo a arquivo.\nLinhas válidas geram solicitações rastreáveis (em etapa de pré-contratação, sem contratação silenciosa); linhas inválidas registram diagnóstico estruturado por linha/coluna para correção e reprocessamento sem duplicar itens já criados.\n",
  "operationId": "importarLoteSolicitacoesTransporteEmbarcador",
  "parameters": [
    {
      "name": "Idempotency-Key",
      "in": "header",
      "required": false,
      "schema": {
        "type": "string"
      }
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "multipart/form-data": {
        "schema": {
          "type": "object",
          "properties": {
            "batch_type": {
              "type": "string",
              "enum": [
                "order_spreadsheet",
                "fiscal_documents"
              ]
            },
            "carrier_shipper_id": {
              "type": [
                "integer",
                "null"
              ]
            },
            "shipper_negotiation_id": {
              "type": [
                "integer",
                "null"
              ]
            },
            "contract_mode": {
              "type": [
                "string",
                "null"
              ],
              "enum": [
                "period_contract",
                "spot",
                null
              ]
            },
            "operation_type": {
              "type": [
                "string",
                "null"
              ],
              "enum": [
                "urban_delivery",
                "closed_load",
                "full_load",
                null
              ]
            },
            "arquivo": {
              "type": "string",
              "format": "binary"
            },
            "arquivos": {
              "type": "array",
              "items": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        }
      }
    }
  },
  "responses": {
    "201": {
      "description": "Lote processado com resumo de linhas válidas e inválidas",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/LoteSolicitacoesTransporteResponse"
          }
        }
      }
    },
    "422": {
      "description": "Arquivo ausente ou inválido",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Erro"
          }
        }
      }
    }
  },
  "x-fleetpay-scope": "operacao",
  "x-fleetpay-module": "contratacao-direta",
  "x-fleetpay-profiles": [
    "embarcador",
    "gestor",
    "agregado_empresarial"
  ],
  "method": "POST",
  "path": "/embarcador/solicitacoes-transporte/lotes"
}