Variants come from attributes
A variant is one purchasable configuration of a master product: Medusa’sProductVariant model (id prefix variant). Each variant binds to one value of every product option, such as Size M.
When you create a product through Mercur’s createProductsWorkflow, you don’t pass native options. You pass Mercur attributes, and every multi_select attribute marked is_variant_axis becomes a native ProductOption. Each variant then names its option values by title:
__default__ option and removes it once a variant-axis attribute attaches a real one. Products without an axis keep it.
Price and stock live on offers
A variant holds catalog data such astitle, sku, ean, and dimensions. It doesn’t hold a store’s price or stock. Mercur’s create workflow sets manage_inventory to false on new variants unless you pass it, because each store’s stock lives on its offer.
- Price: an offer-scoped price on the variant’s price set, matched by an
offer_idrule - Stock: inventory items linked to the offer, not the variant
- SKU: the store’s own SKU on the offer, unique per store
Grouping models
Products are organized with Medusa’s native grouping models:
Categories and collections link to Mercur’s media module through
media_images for gallery and icon images. A category also links to stores through category_seller and to product attributes through product_category_attribute. See the links reference.
One category per product
Medusa lets a product belong to several categories. Mercur’sassignProductsToCategoryWorkflow keeps one category per product: adding a product to a category replaces the categories it had.
pcat_01JD8Q1234567. Passing a product id in remove clears all its categories, not only this one.
Related
- Attributes for attribute types and variant axes
- Data models for every field on these models
- Offers for price and stock per store