The OrderGroup record
The group is theOrderGroup data model in the Seller module, stored in the order_group table with the id prefix og. It holds four stored fields and two computed ones:
packages/core/src/modules/seller/models/order-group.ts
display_id: an auto-incrementing integer, so people can quote a purchase without the internal idcustomer_id: the customer who completed the cart, ornullwhen the cart has no customercart_id: the cart the group was created fromseller_countandtotal: summed from the child orders when you read the group, covered in Computed totals
Checkout creates a group for every completed cart, even when the cart has items from one seller. Every marketplace order therefore has exactly one parent group.
The cart link
Thecart_id field backs a read-only link to Medusa’s Cart module, so you can expand cart.* from a group. Checkout sets completed_at on the cart in the same run that creates the group, and the cart doesn’t change after that. Treat cart_id as a stable pointer to the basket the shopper paid for.
link.create: it always follows the cart_id column.
Child orders
A group holds no line items. The items live on the childOrder records, one per seller, connected through the order_group_order link table. Each child order is a regular Medusa order with its own items, shipping methods, fulfillments, returns, and refunds:
- Seller: each child order links to the seller who fulfills it
- Line items: each order line item links to the offer it was bought from
- Cart: each child order also links back to the completed cart
order_group_order link entity by order_id.