Skip to main content
Layers creates three types of metaobjects in your Shopify store to represent key configuration entities. These metaobjects allow Shopify to reference Layers configurations natively, enabling features like assigning sort orders to collections directly from the Shopify admin.

Sort order metaobject

The Sort Order metaobject represents sort orders configured in Layers. Each sort order you create in the Layers dashboard is automatically synced to Shopify as a metaobject. Type: $app:sort_order Definition Name: Layers Sort Order Description: Sort orders managed by Layers for product sorting

Field definitions

FieldTypeRequiredDescription
namesingle_line_text_fieldYesThe display name of the sort order
codesingle_line_text_fieldYesThe unique code identifier for the sort order
scopelist.single_line_text_fieldNoThe contexts where this sort order is available (search, collection)
ordernumber_integerNoThe display order of the sort order

Example metaobject

{
  "type": "$app:sort_order",
  "handle": "layers-sort-order-abc123",
  "fields": {
    "name": "Best Selling",
    "code": "best_selling",
    "scope": ["collection", "search"],
    "order": 1
  }
}

Common sort order examples

NameCodeDescription
Best Sellingbest_sellingProducts ranked by sales volume
NewestnewestProducts sorted by creation date, newest first
Price: Low to Highprice_ascProducts sorted by price ascending
Price: High to Lowprice_descProducts sorted by price descending
RelevancerelevanceProducts ranked by search relevance score
TrendingtrendingProducts ranked by recent popularity metrics

Lifecycle

Sort order metaobjects are only synced to Shopify when the Enable as Storefront Sort option is enabled for the sort order. This option is enabled by default. When you create a new sort order with Enable as Storefront Sort enabled, a metaobject is created in Shopify. When you update the sort order’s name or code, the metaobject is updated. When you disable Enable as Storefront Sort or delete the sort order, the metaobject is removed from Shopify.

Facet metaobject

The Facet metaobject represents filterable attributes (facets) configured in Layers. When you mark an attribute as filterable and enable the Enable as Storefront Facet option in the Layers dashboard, it is synced to Shopify as a facet metaobject. Type: $app:facet Definition Name: Layers Facet Description: Facets (filterable attributes) managed by Layers

Field definitions

FieldTypeRequiredDescription
namesingle_line_text_fieldYesThe display name of the facet
codesingle_line_text_fieldYesThe unique code identifier for the facet

Example metaobject

{
  "type": "$app:facet",
  "handle": "layers-facet-def456",
  "fields": {
    "name": "Color",
    "code": "options.color"
  }
}

Common facet examples

NameCodeDescription
Coloroptions.colorFilter by product color option
Sizeoptions.sizeFilter by product size option
BrandvendorFilter by product vendor
Product Typeproduct_typeFilter by Shopify product type
TagstagsFilter by product tags
Pricevariants.priceFilter by product price
AvailabilityavailableFilter by in-stock status

Lifecycle

Facet metaobjects are created when you mark an attribute as filterable and enable the Enable as Storefront Facet toggle in Layers. They are updated when you rename the attribute or change its display name, and deleted when you disable the Enable as Storefront Facet toggle or remove the attribute from your configuration.
Simply marking an attribute as filterable is not sufficient to create a facet metaobject. You must also enable the Enable as Storefront Facet option in the attribute’s Display settings. This allows you to have filterable attributes that are only used through the Layers API without syncing them to Shopify. Learn more in Attributes.

Block metaobject

The Block metaobject represents recommendation blocks configured in Layers. When you create a block on a managed installation, it is automatically synced to Shopify as a metaobject with publishable status capability. Type: $app:block Definition Name: Layers Recommendation Block Description: Recommendation blocks managed by Layers

Field definitions

FieldTypeRequiredDescription
labelsingle_line_text_fieldYesThe display label of the block (formatted as “Title - AnchorType” or just the anchor type if no title)
titlesingle_line_text_fieldNoThe title of the block
anchor_typesingle_line_text_fieldYesThe anchor type of the block (product, collection, cart, none)

Example metaobject

{
  "type": "$app:block",
  "handle": "layers-block-xyz789",
  "fields": {
    "label": "Featured Products - Collection",
    "title": "Featured Products",
    "anchor_type": "collection"
  },
  "status": "ACTIVE"
}

Common block examples

LabelTitleAnchor TypeDescription
Featured Products - CollectionFeatured ProductscollectionRecommendations shown on collection pages
You May Also Like - ProductYou May Also LikeproductRecommendations shown on product pages
Complete Your Order - CartComplete Your OrdercartRecommendations shown in the cart
Trending Now - NoneTrending NownoneRecommendations shown globally

Lifecycle

Block metaobjects are only synced for managed installations. When you create a block on a managed store, the corresponding metaobject is created in Shopify. When you update the block’s title, anchor type, or status, the metaobject is updated. When you delete the block, the metaobject is removed from Shopify. The block’s status (active or draft) is mapped to Shopify’s publishable status capability:
  • Active blocksACTIVE status in Shopify
  • Draft blocksDRAFT status in Shopify