idpath · stringRequiredConstraints
{
"type": "string"
}Parameters, data structure and responses from the versioned contract.
/embarcador/solicitacoes-transporte/{id}/revisar-demandaTechnical descriptions are translated from the versioned contract. Original identifiers and JSON are preserved; data examples are omitted.
Integrates demand revisions received via API, file or UI with the central offer dispatch schedule in Offers & Negotiations Management, distinguishing:
demand_revision_mode: complement): adds extra deliveries and/or slots to the active schedule and increments demand_version.demand_revision_mode: total_revision): replaces planned window/shift totals. If reduced below the number of executors with active acceptance/allocation, it never silently cancels accepted work: it preserves active allocations and flags reduction_after_acceptance = true and cancellation_requested_after_acceptance = true for explicit handling.demand_revision_mode: incorporate_into_work_unit): appends deliveries to an already-accepted day-rate/shift (work_unit_key) without opening new slots and without creating a duplicate day-rate (ShipperManagedOperation) for the same driver/shift.200 with data.demand_offer_integration.idempotent_replay = true without incrementing demand_version.expected_demand_version differs from the schedule's current version, returns 409 DEMAND_VERSION_CONFLICT.deliveries_count is supplied without required_vacancies_count, requires a positive deliveries_per_driver_rule (422 DELIVERIES_TO_DRIVERS_RULE_REQUIRED).operacao — Operations[
{
"oauth2": []
},
{
"chaveApi": []
}
]idpath · stringRequired{
"type": "string"
}Required
application/jsondemand_revision_modestringOptionalcomplement adds deliveries/vacancies; total_revision replaces the window's planned total without silently cancelling active acceptances; incorporate_into_work_unit incorporates deliveries into the same day-rate/shift without generating duplicate day-rate.
"complement" · "total_revision" · "incorporate_into_work_unit"expected_demand_versioninteger | nullOptionalExpected current version of the demand schedule for concurrency control (409 DEMAND_VERSION_CONFLICT if mismatched).
demand_schedule_typestring | nullOptional"variable" · "fixed_scheduled" · "mixed" · nulloperational_base_codestring | nullOptionalwindow_shift_codestring | nullOptionaldeliveries_countinteger | nullOptionalminimum0required_vacancies_countinteger | nullOptionalminimum0deliveries_per_driver_ruleinteger | nullOptionalExplicit conversion rule from delivery count to vacancies/drivers when required_vacancies_count is not provided directly.
minimum1work_unit_keystring | nullOptional200 HTTP ResponseDemand schedule synchronized (or idempotent replay recognized)
application/jsonsuccessbooleanOptionaldataobjectOptionalcommercial_resolutionobject | nullOptional409 HTTP ResponseConcurrent demand schedule version conflict (DEMAND_VERSION_CONFLICT)
422 HTTP ResponseMissing explicit deliveries-to-drivers conversion rule (DELIVERIES_TO_DRIVERS_RULE_REQUIRED) or invalid parameters
{
"tags": [
"Solicitações e Contratação de Transporte (Embarcador)"
],
"summary": "Revisar programação de demanda e sincronizar com o serviço central de ofertas",
"description": "Integra alterações de demanda recebidas por API, arquivo ou interface com a programação central de envio de ofertas da sessão **Gestão de Ofertas e Negociações**, diferenciando:\n- **Acréscimo de demanda (`demand_revision_mode: complement`)**: soma entregas e/ou vagas adicionais à programação vigente e incrementa `demand_version`.\n- **Substituição do total (`demand_revision_mode: total_revision`)**: substitui os totais planejados da janela/turno. Se houver redução abaixo do número de executores já com aceite/alocação ativa, **não cancela silenciosamente** o trabalho já aceito: preserva as alocações ativas e sinaliza `reduction_after_acceptance = true` e `cancellation_requested_after_acceptance = true` para tratativa explícita.\n- **Incorporação à mesma unidade de trabalho (`demand_revision_mode: incorporate_into_work_unit`)**: adiciona entregas à diária/turno já aceito (`work_unit_key`) sem abrir novas vagas e **sem gerar diária duplicada** (`ShipperManagedOperation`) para o mesmo motorista/turno.\n- **Idempotência de reenvio**: reenviar o mesmo payload de revisão para o mesmo estado retorna `200` com `data.demand_offer_integration.idempotent_replay = true` sem incrementar `demand_version`.\n- **Controle de revisão concorrente**: se `expected_demand_version` divergir da versão atual da programação, responde `409 DEMAND_VERSION_CONFLICT`.\n- **Regra explícita entregas -> vagas**: quando `deliveries_count` é informado sem `required_vacancies_count`, exige `deliveries_per_driver_rule` positivo (`422 DELIVERIES_TO_DRIVERS_RULE_REQUIRED`).\n",
"operationId": "revisarDemandaSolicitacaoTransporteEmbarcador",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RevisarDemandaSolicitacaoTransporteRequest"
}
}
}
},
"responses": {
"200": {
"description": "Programação de demanda sincronizada (ou replay idempotente reconhecido)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SolicitacaoTransporteResponse"
}
}
}
},
"404": {
"description": "Solicitação não encontrada",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Erro"
}
}
}
},
"409": {
"description": "Conflito de versão concorrente da programação de demanda (`DEMAND_VERSION_CONFLICT`)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Erro"
}
}
}
},
"422": {
"description": "Ausência de regra explícita de conversão entregas -> motoristas (`DELIVERIES_TO_DRIVERS_RULE_REQUIRED`) ou parâmetros inválidos",
"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}/revisar-demanda"
}