Skip to main content
Lists order groups with their child orders, computing each order’s payment_status and fulfillment_status from payment collections and fulfillments. When sellerId is set, each group’s orders array is filtered to that seller’s orders — useful for vendor-scoped views. Payment collections and fulfillments are stripped unless the requested fields include them. Triggered by GET /admin/order-groups.

Usage

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

const { result } = await getOrderGroupsListWorkflow(container).run({
  input: {
    fields: ["display_id", "total"],
    variables: { skip: 0, take: 20, order: { created_at: "DESC" } },
  },
})

Input

fields
string[]
required
Fields to retrieve; merged with the defaults needed for status aggregation.
variables
object
Query filters plus pagination.
sellerId
string | string[]
Restrict each group’s orders to the given seller(s).

Result

result.rows
object[]
The order groups; each child order carries computed payment_status and fulfillment_status.
result.metadata
object
Pagination metadata (count, skip, take).