An order group is the
OrderGroup data model (id prefix og). It belongs to the Seller module, not a module of its own, so there is no ORDER_GROUP key. Resolve its service with MercurModules.SELLER.Key features
Order groups cover a multi-seller purchase from checkout to the order history:- Split checkout:
completeCartWithSplitOrdersWorkflowturns one cart into one order per seller under a single group - One group per cart: completing the same cart twice returns the existing group instead of splitting again
- Readable reference: an auto-incrementing
display_idthat shoppers and operators can quote - Frozen cart link: a read-only
cart_idthat points at the completed cart - Live totals:
seller_countandtotalare computed from the child orders at query time, never stored - Derived child statuses: the read workflows add
payment_statusandfulfillment_statusto every child order - Seller scoping: the list workflow can trim each group down to one seller’s orders
How it works
A group comes to life when a cart completes:- The shopper completes a cart that holds offers from ACME and GLOBEX.
completeCartWithSplitOrdersWorkflowgroups the line items byitem.offer.seller_id.- It creates one
OrderGroupand one childOrderper seller, then links them. - It authorizes the cart’s payment and refreshes commission lines for each order.
- It emits
order.placedfor each child order andorder_group.createdfor the group. - When you read the group, the Seller module sums its child orders into
seller_countandtotal.
Get started
Learn how the group, the split, and the computed totals fit together.The order group
The record over a multi-seller purchase, its
display_id, and the cart link.Order splitting
How checkout turns one cart into one order per seller.
Computed totals
Where
seller_count, total, and child order statuses come from.Examples
Build against order groups in your own server code.Retrieve an order group
Load one group with its child orders and their statuses.
List order groups
Filter, page, and scope groups to a seller.
Split a cart
Complete a cart into a group and hook into the split.
Resources
The data model, links, workflows, service methods, and events behind order groups.Data models
The
OrderGroup model, its fields, and indexes.Links
How a group connects to its cart, orders, sellers, and offers.
Workflows
The checkout split, the read workflows, and their hooks.
Service
Seller module methods for order group records.
Events
The events emitted when a cart splits into a group.