- Metaobjects and reference metafields - metaobject resolution, nested references, and normalized reference shapes.
- Automatic sequences from metafields - turn
list.product_referencemetafields into product sequences. - Available attributes for API requests - the full list of attributes you can request from the Search, Browse, and Blocks APIs.
Supported metafield types
The product schema supports various Shopify metafield data types, ensuring that your product data is handled correctly for display and filtering purposes. The following metafield types are currently supported:
These metafield types allow for greater flexibility and precision when configuring and displaying product data within your search and browse engine.
For a complete list of supported metafield types and their properties, refer to the official Shopify Metafield Data Types documentation.
Metafield structure and examples
Metafields are organized by namespace and key in a nested object structure. The namespace groups related metafields together, and each key within a namespace contains the metafield value.Metafield structure
Example: custom product metafields
Accessing metafields in attributes
To create a catalog attribute from a metafield, use dot notation with the full path:Accessing nested metafield object keys
When a metafield value is a JSON object, you can create attributes that access nested object keys using dot notation. The namespace and key portions must follow standard naming conventions (alphanumeric and underscores), but object keys can contain spaces and special characters. Format:metafields.{namespace}.{key}.{object_key}
Example metafield value:
Use cases:
- Filtering: Create filterable attributes for nested metafield values to enable faceted navigation (e.g., filter by color family values)
- Faceting: Display facet counts for nested object values in browse and search results
- Sorting: Sort products by nested metafield object values
- Merchandising: Use nested metafield values in collection rules and merchandising logic
This feature supports both
metafields and variant_metafields with the same syntax. Variant metafield example: variant_metafields.custom.size_details.extra largeStructured metafield subfield leaves
Shopify’s structured metafield types (money, weight, volume, dimension, and rating, plus their list.* variants) decode into JSON objects, not scalars. The parent attribute code is not directly filterable or sortable. You address the scalar leaves inside the object instead. Layers indexes numeric leaves with numeric semantics, so filters and sort orders compare 19.90 < 100.00 correctly. Without this, string ordering would put "100.00" before "19.90".
The available leaves per type:
Example: a
custom.price money metafield exposes these attribute codes:
metafields.custom.price.amount: numeric. Use for range filters and sort orders.metafields.custom.price.currency_code: string. Use as a facet.
Attribute paths for reference metafields
When a metafield is a reference type (such asmetaobject_reference, file_reference, or taxonomy), Layers discovers curated nested attribute paths instead of the base metafield code. This gives you access to the specific values within the normalized reference structure that are useful for filtering, sorting, and display. See Metaobjects and reference metafields for the full normalized shapes and every supported attribute path.
Metaobject reference attributes:
For metaobject references, the available attribute paths target the base reference (the metaobject handle), the display name, and individual fields:
Example: If you have a
custom.specification metaobject reference with fields material and finish, Layers discovers these attribute codes:
metafields.custom.specification(the handle of the referenced specification metaobject)metafields.custom.specification.display_namemetafields.custom.specification.fields.materialmetafields.custom.specification.fields.finish
Taxonomy reference attributes:
For taxonomy value references, the available path is:
For
file_reference and taxonomy metafields, the base metafield code (for example, metafields.custom.hero_image) is not available as an attribute. Use one of the nested paths listed above instead. For metaobject references, the base code is available as a single-value handle attribute only when every reference targets one metaobject definition type. mixed_reference remains unavailable. Transport-only paths such as __typename, .type, and .handle on nested references are always excluded from attribute creation.Example: list-type metafields
List metafields (e.g.,list.single_line_text_field, list.product_reference) are stored as arrays: