shopify-metafields

Store typed custom data on Shopify resources using metafield and metaobject definitions.

14|3|Updated Mar 22, 2026
One-click install
npx skills add https://github.com/tomtoto757/ecomm-ai-skills-hub --skill shopify-metafields-tomtoto757
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: shopify-metafields
Source: https://github.com/tomtoto757/ecomm-ai-skills-hub/tree/main/skills/platform-integrations-infrastructure/finsilabs/platform-shopify/shopify-metafields
Command: npx skills add https://github.com/tomtoto757/ecomm-ai-skills-hub --skill shopify-metafields-tomtoto757

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Many Shopify stores need structured, queryable custom data (product specs, order notes, customer flags, reusable content) but rely on unstructured descriptions or app-specific hacks that are hard to surface in themes or APIs. Metafield definitions and Metaobjects provide a first-class, typed way to store, validate, and expose custom fields to Liquid and the Storefront API without a separate database.

Core Features & Use Cases

  • Typed metafield definitions: Create metafieldDefinitionCreate entries that enforce types (text, number, date, references, files, json, lists) and control storefront visibility.
  • Programmatic reads & writes: Write values with metafieldsSet (batch up to 25 per call) and read them in Liquid (product.metafields.namespace.key) or the Storefront API by explicitly requesting namespace+key.
  • Metaobjects for structured content: Define metaobject types and create entries for FAQs, testimonials, and other multi-field content editable in the Shopify Admin UI.
  • Use case: Bulk-import product weights and dimensions for 30 products, validate types, mark definitions visibleToStorefrontApi, and render specs in both a headless storefront and legacy Liquid theme.

Quick Start

Create typed metafield definitions for product weight and dimensions, then batch-write values with metafieldsSet in 25-item batches while marking definitions visibleToStorefrontApi.

Frequently Asked Questions about shopify-metafields

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add custom fields to Shopify products and expose them to the Storefront API?

To add custom fields to Shopify products and expose them, create typed metafield definitions using metafieldDefinitionCreate and mark them visibleToStorefrontApi. This enforces data types and allows Liquid themes and headless storefront queries to access the values.

What is the maximum batch size for writing Shopify metafields with metafieldsSet?

The maximum batch size for writing Shopify metafields with metafieldsSet is 25 items per call. You must serialize numeric values as strings within these batches to ensure typed definitions validate and store the custom data correctly.

When should I use Shopify metaobjects instead of standard metafield definitions?

Use Shopify metaobjects instead of standard metafield definitions when you need multi-field structured content like FAQs or testimonials. You create metaobjectDefinitionCreate entries to manage these structured records, which can then be edited directly within the Shopify Admin UI.

Can I attach typed custom data to Shopify orders and customers?

Yes, you can attach typed custom data to Shopify orders and customers. This Skill supports applying typed metafield definitions across products, variants, orders, customers, collections, and pages for admin-managed content workflows.

Why are my numeric metafield values failing validation during bulk writes?

Numeric metafield values fail validation during bulk writes if they are not serialized as strings. The metafieldsSet mutation requires numeric values to be passed as strings to successfully write data to the typed metafield definitions in batches of 25.

How do I render Shopify metafields in a headless storefront?

To render Shopify metafields in a headless storefront, explicitly request the namespace and key in your Storefront API query. You must first ensure the metafield definitions are created with visibleToStorefrontApi enabled for external access.