Skip to main content
Mercur modules never reference each other directly, so an order group reaches carts and orders through module links. Two links start at the group. Two more, on the child orders, connect each order to its seller and each order line item to its offer. All four are defined in packages/core/src/links/, and checkout creates their rows when it splits a cart.

Order group to order

Connects a group to its child orders, one per seller.
To go from an order to its group, query the link entity directly:

Order group to cart

Exposes the completed cart a group was created from. The link is read-only: it reads the group’s cart_id column and has no table of its own.
You can’t create or dismiss this link with link.create or link.dismiss. It changes only if cart_id changes, and Mercur never updates it.

Order to seller

Connects each child order to the seller who fulfills it.
getOrderGroupsListWorkflow reads orders.seller.id to trim each group to one seller when you pass sellerId.

Order line item to offer

Records which offer each order line item was bought from. Checkout copies it from the matching cart line item’s offer link.
The line item side is a list, so one offer can back line items in any number of orders and groups. Besides the links above, completeCartWithSplitOrdersWorkflow creates these rows for every child order:
  • Order to cart: Medusa’s own link from each child order to the completed cart
  • Order to promotion: for each promotion owned by the order’s seller
  • Seller to customer: when the customer hasn’t bought from that seller before