← HomeFleetPay / API

Record explicit transport offer acceptance by the authorized driver

Parameters, data structure and responses from the versioned contract.

POST/embarcador/solicitacoes-transporte/{id}/aceitar-oferta-motorista
aceitarOfertaMotoristaSolicitacaoTransporteSandbox Base: https://api.fleetpay.site/v1

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

Records explicit acceptance of a real offer (ShipperDriverOffer dispatched and pending in the active round) by the authorized target driver (driver_user_id), delegating to central authority DriverOfferRoundDistributionService::acceptOfferByDriver.

  • Requires mandatory offer_id (OFFER_ID_REQUIRED) referencing an existing real offer (OFFER_NOT_FOUND), already dispatched (OFFER_NOT_DISPATCHED), not withdrawn (OFFER_WITHDRAWN), within deadline (OFFER_EXPIRED) and addressed to the authenticated driver (OFFER_RECIPIENT_MISMATCH).
  • Requires explicit conditions_version (OFFER_CONDITIONS_VERSION_REQUIRED) matching the offer's presented terms and current demand terms (OFFER_CONDITIONS_VERSION_MISMATCH).
  • Validates active formal representation (DriverProviderRepresentation / DriverRepresentationService), authorized vehicle (DriverVehicleAuthorization), daily check-in on the service date (DriverAvailability) and open slot availability (VACANCY_ALREADY_FILLED).

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

idpath · stringRequired
Constraints
{
  "type": "string"
}

Request Body

Required

application/json

offer_idintegerRequired

Mandatory ID of the real offer (shipper_driver_offers.id) issued and pending for the authenticated driver.

conditions_versionintegerRequired

Mandatory version of the terms presented in the offer and active in the demand (OFFER_CONDITIONS_VERSION_REQUIRED).

driver_user_idinteger | nullOptional

Authenticated driver ID (users.id). Must match the authenticated user and offer recipient (OFFER_RECIPIENT_MISMATCH).

aggregated_carrier_company_idintegerRequired

ID of the provider company (companies.id / CNPJ) formally represented by the driver in driver_provider_representations.

driver_representation_idinteger | nullOptional

ID of the active formal representation (driver_provider_representations.id).

vehicle_idinteger | nullOptional

ID of the authorized vehicle for the driver in driver_vehicle_authorizations.

vacancy_slot_numberinteger | nullOptional

Operational vacancy number (shipper_operational_vacancies.slot_number).

work_unit_keystring | nullOptional

Operational day-rate/shift key.

Responses

200 HTTP Response

Driver explicit acceptance recorded in shipper_driver_offers and shipper_operational_vacancies

application/json

successbooleanOptional
commercial_resolutionobject | nullOptional
403 HTTP Response

Authenticated actor does not match the recipient driver (OFFER_RECIPIENT_MISMATCH) or lacks active formal representation (DRIVER_REPRESENTATION_REQUIRED)

application/json

errorobjectOptional
404 HTTP Response

Request not found

application/json

errorobjectOptional
422 HTTP Response

Missing offer (OFFER_ID_REQUIRED), nonexistent (OFFER_NOT_FOUND), not dispatched (OFFER_NOT_DISPATCHED), withdrawn (OFFER_WITHDRAWN), expired (OFFER_EXPIRED), missing conditions version (OFFER_CONDITIONS_VERSION_REQUIRED) or mismatch (OFFER_CONDITIONS_VERSION_MISMATCH), slot already filled (VACANCY_ALREADY_FILLED) or missing/mismatched daily check-in (DAILY_CHECKIN_DATE_MISMATCH)

application/json

errorobjectOptional
Complete Operation Definition
{
  "tags": [
    "Solicitações e Contratação de Transporte (Embarcador)"
  ],
  "summary": "Registrar aceite explícito da oferta de transporte pelo motorista autorizado",
  "description": "Registra o aceite explícito da oferta real (`ShipperDriverOffer` emitida e pendente na rodada ativa) pelo motorista destinatário autorizado (`driver_user_id`), delegando à autoridade central `DriverOfferRoundDistributionService::acceptOfferByDriver`.\n- Exige `offer_id` obrigatório (`OFFER_ID_REQUIRED`) referenciando uma oferta real existente (`OFFER_NOT_FOUND`), já enviada (`OFFER_NOT_DISPATCHED`), não retirada (`OFFER_WITHDRAWN`), dentro do prazo (`OFFER_EXPIRED`) e destinada ao motorista autenticado (`OFFER_RECIPIENT_MISMATCH`).\n- Exige `conditions_version` explícita (`OFFER_CONDITIONS_VERSION_REQUIRED`) idêntica aos termos apresentados na oferta e vigentes na demanda (`OFFER_CONDITIONS_VERSION_MISMATCH`).\n- Valida representação formal ativa (`DriverProviderRepresentation` / `DriverRepresentationService`), veículo autorizado (`DriverVehicleAuthorization`), check-in diário na data do serviço (`DriverAvailability`) e disponibilidade da vaga (`VACANCY_ALREADY_FILLED`).\n",
  "operationId": "aceitarOfertaMotoristaSolicitacaoTransporte",
  "parameters": [
    {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/AceitarOfertaMotoristaRequest"
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "Aceite explícito do motorista registrado em `shipper_driver_offers` e `shipper_operational_vacancies`",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/SolicitacaoTransporteResponse"
          }
        }
      }
    },
    "403": {
      "description": "Ator autenticado não corresponde ao motorista destinatário (`OFFER_RECIPIENT_MISMATCH`) ou não possui representação formal ativa (`DRIVER_REPRESENTATION_REQUIRED`)",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Erro"
          }
        }
      }
    },
    "404": {
      "description": "Solicitação não encontrada",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Erro"
          }
        }
      }
    },
    "422": {
      "description": "Oferta ausente (`OFFER_ID_REQUIRED`), inexistente (`OFFER_NOT_FOUND`), não enviada (`OFFER_NOT_DISPATCHED`), retirada (`OFFER_WITHDRAWN`), expirada (`OFFER_EXPIRED`), versão de condições omitida (`OFFER_CONDITIONS_VERSION_REQUIRED`) ou divergente (`OFFER_CONDITIONS_VERSION_MISMATCH`), vaga já preenchida (`VACANCY_ALREADY_FILLED`) ou check-in diário ausente/de outra data (`DAILY_CHECKIN_DATE_MISMATCH`)",
      "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/{id}/aceitar-oferta-motorista"
}