Skip to main content
Loads an order group with its child orders and computes each order’s payment_status and fulfillment_status from its payment collections and fulfillments. Payment collections and fulfillments are stripped from the response unless the requested fields include them. Triggered by GET /admin/order-groups/:id and GET /admin/orders/:id/order-group.

Usage

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

const { result } = await getOrderGroupDetailWorkflow(container).run({
  input: {
    order_group_id: "ordgrp_123",
    fields: ["display_id", "total", "orders.display_id"],
  },
})

Input

order_group_id
string
required
The order group to retrieve; fails if not found.
fields
string[]
required
Fields to retrieve; merged with the defaults needed for status aggregation (orders.items.*, payment collection and fulfillment timestamps).

Result

result
object
The order group with its child orders.
result.orders
OrderDetailDTO[]
Child orders, each with computed payment_status and fulfillment_status.