Skip to main content
Wraps Medusa’s confirmOrderEditRequestWorkflow and then reconciles reservations for every unfulfilled order item that comes from an offer with inventory links: desired quantities are computed as (ordered - fulfilled) × required_quantity per linked inventory item, and mismatching reservations are replaced with a correct set (one per linked item, bundle offers included). Triggered by POST /admin/order-edits/:id/confirm and POST /vendor/order-edits/:id/confirm. Events are emitted by the wrapped Medusa workflow.

Usage

import { confirmOrderEditRequestWorkflow } from "@mercurjs/core/workflows"

const { result } = await confirmOrderEditRequestWorkflow(container).run({
  input: { order_id: "order_123", confirmed_by: "user_123" },
})

Input

order_id
string
required
The order whose pending edit is confirmed.
confirmed_by
string
Id of the user confirming the edit.

Result

result
OrderPreviewDTO
Preview of the order with the confirmed edit applied.