Data model
seller_count and total are computed fields — they are calculated from linked orders at query time, not stored as columns. seller_count is the count of distinct sellers across all orders in the group, and total is the sum of each order’s current_order_total from the order summary.Relationships
Order groups connect to other entities through two links:Cart (read-only)
Links the order group back to its originating cart via thecart_id field. This is a read-only link — carts are immutable after checkout.
Orders (one-to-many)
Links the order group to multiple orders through a join tableorder_group_order. Each order in the group belongs to a different seller.
How order groups are created
Order groups are created automatically during checkout by thecompleteCartWithSplitOrdersWorkflow. This is what happens when a customer completes a cart containing products from multiple sellers:
- Lock — The workflow acquires a lock on the cart to prevent double-processing
- Group by seller — Cart items are grouped by seller (via the product-seller link)
- Create orders — A separate Medusa order is created for each seller, containing only that seller’s items and shipping
- Create order group — An order group is created with the customer and cart references
- Link everything — The workflow creates links between:
- Each order and the order group
- Each order and its seller
- Each seller and the customer (if new relationship)
- Finalize — Inventory is reserved, payment is authorized, and the
order_group.createdevent is emitted
Payments
The customer pays for the cart once: one payment collection on the cart, one payment at the payment provider. Medusa links a payment collection to a single order, so the orders of a cart share that payment through the cart until it is captured:
Order reads expose whichever applies under
payment_collections: the cart’s collection before the capture, the order’s own afterwards.
The split, and voiding the authorization after the last cancel, run in subscribers to
payment.captured and order.canceled, shortly after the request returns. A provider that captures on authorization is split during checkout.Orders whose payment was captured before this model was introduced are not split retroactively and keep the cart’s shared collection.
Events
API endpoints
List order groups (Admin)
customer_id, seller_id, status, sales_channel_id, and created_at. Paginated with offset and limit (default 50).
Get order group detail (Admin)
List order groups (Store)
Get order group detail (Store)
404 if the order group doesn’t belong to the authenticated customer.
Workflows
The list and detail workflows automatically inject order-related fields (items, payment collections, fulfillments) and compute an overall
payment_status and fulfillment_status for each order group by aggregating across all linked orders.