Skip to main content
In this guide, you’ll learn how to load a single order group together with its child orders from your own server code. Mercur exposes a getOrderGroupDetailWorkflow that fetches the group, expands its child orders, and derives each order’s payment and fulfillment status. Run it from any place that has access to the Medusa container.

Run the workflow

src/api/custom/order-group/[id]/route.ts
The workflow always expands the group’s child orders regardless of the fields you pass, so order_group.orders is populated with each seller’s slice.
The workflow only fetches heavy relations when you ask for them: include a payment_collections field to get per-order payment_status, and a fulfillments field to get fulfillment_status. Otherwise those collections are stripped from the response to keep it lean.
The group’s read-only cart_id points back to the immutable cart it came from. Expand it through the module link when you need the original basket:
Prefer the workflow over reading the record directly. It does the child-order status aggregation for you. The raw service method returns only the group row and its computed totals.