Skip to main content

Expose Metafields to the Storefront API

Make your metafields accessible via the Shopify Storefront API for use in headless commerce, custom storefronts, or third-party integrations.

Steps

1. Create a Metafield Definition

Establish a matching definition for your metafield. Definitions tell Shopify what type of data the metafield holds and which resources it applies to.

You can create definitions through:

  • Shopify admin → SettingsCustom data
  • Or directly within Metafield Studio

📖 Shopify docs: Create metafield definitions

2. Activate Storefront API Access

Once the definition exists, enable the option to expose the metafield to the Storefront API. This makes the metafield queryable via GraphQL.

📖 Shopify docs: Expose metafields in the Storefront API

Using the Exposed Metafields

After configuration, you can retrieve metafields through the Shopify Storefront API using GraphQL queries. This enables use cases like:

  • Custom storefronts (Hydrogen, Next.js, etc.)
  • Mobile applications
  • Third-party integrations
  • Headless commerce setups

Official Shopify Documentation