Skip to main content
Use Mercur to define a typed vocabulary for your products, such as colors, materials, sizes, capacities, or warranty toggles, and reuse it across the whole marketplace. The Attribute domain is an operator-managed catalog of typed fields that attach to products in the shared master catalog. Attributes describe products consistently and drive storefront filters. For variant axes, they generate the product variants shoppers pick between. Every attribute is one of five types. Each one is either a global catalog entry reused everywhere or an inline field scoped to a single product.
Attribute = the ProductAttribute entity. The catalog is owned by the Product Attribute module (MercurModules.PRODUCT_ATTRIBUTE, id prefix pattr). Products are the shared master catalog. Attributes never belong to a store. Sellers list against master products through offers.

Key features

  • Five typed forms: single_select, multi_select, text, unit, and toggle, each with its own validation and UI shape.
  • Variant axes: a multi_select attribute marked is_variant_axis mirrors a native Medusa ProductOption and generates product variants.
  • Global or inline: reuse a global catalog attribute across products, or attach a one-off attribute scoped to a single product.
  • Storefront filtering: an is_filterable flag exposes an attribute as a shopper-facing facet.
  • Batch attach: attach, detach, and update all of a product’s attributes through a single engine workflow.
  • Ordered and governed: rank, is_active, and is_required control ordering, availability, and required-field enforcement.

Get started

Learn how the domain fits together.

Attribute types

The five attribute types and the values they hold.

Variant axes

How is_variant_axis mirrors a ProductOption and generates variants.

Global vs inline

Catalog-wide attributes, product-scoped attributes, and filtering.

Examples

Build against the Attribute domain in your own code.

Create an attribute

Run createProductAttributesWorkflow from a route or seed script.

Attach to a product

Attach, detach, and update attributes in one batch call.

Create a variant axis

Generate variants from a multi_select axis attribute.

Resources

Data models, links, workflows, service methods, and events for the Attribute domain.

Data models

The ProductAttribute and ProductAttributeValue entities.

Links

How the Attribute domain links to products, categories, and options.

Workflows

Catalog and product-attachment workflows.

Service

Module service methods for working with records directly.

Events

Events emitted as attributes and values change.