Skip to main content
Wraps Medusa’s confirmExchangeRequestWorkflow and then rewrites the reservations created for the exchange’s additional items when those items come from offers: single-link offers get their reservation quantity scaled by required_quantity, multi-link (bundle) offers have the default reservation replaced with one reservation per linked inventory item. Triggered by POST /admin/exchanges/:id/request and POST /vendor/exchanges/:id/request. Events are emitted by the wrapped Medusa workflow.

Usage

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

const { result } = await confirmExchangeRequestWorkflow(container).run({
  input: { exchange_id: "exchange_123", confirmed_by: "user_123" },
})

Input

exchange_id
string
required
The exchange whose pending request is confirmed.
confirmed_by
string
Id of the user confirming the exchange.

Result

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