Skip to main content
Mercur’s offer-aware replacement for Medusa’s confirm-return-receive flow. Applies the pending receive actions of the return’s order change, updates return items’ received/damaged quantities, marks the return received (or partially_received), restocks inventory — expanding offer bundle links by required_quantity — and refreshes the order payment collection. Throws when a bundle offer has no stock level at the return’s location. Triggered by POST /admin/returns/:id/receive/confirm and POST /vendor/returns/:id/receive/confirm. Emits order.return_received.

Usage

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

const { result } = await confirmReturnReceiveWorkflow(container).run({
  input: { return_id: "return_123", confirmed_by: "user_123" },
})

Input

return_id
string
required
The return whose pending receival is confirmed.
confirmed_by
string
Id of the user confirming the receival.

Result

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