| name | shopify-metafields-metaobjects |
| description | Model custom data with Shopify metafields and metaobjects via the GraphQL Admin API.
Use when adding custom fields to products/orders, creating custom content types,
or building structured data models beyond Shopify's default schema.
Trigger with phrases like "shopify metafields", "shopify metaobjects",
"custom data shopify", "shopify custom fields", "metafield definition".
|
| allowed-tools | Read, Write, Edit, Bash(npm:*), Grep |
| version | 2.7.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","ecommerce","shopify"] |
| compatibility | Designed for Claude Code |
Shopify Metafields & Metaobjects
Overview
Metafields attach key-value custom data to existing resources (products, variants, orders, customers). Metaobjects define entirely new content types with custom schemas. Together they replace the need for external databases for most custom data needs.
Prerequisites
- Completed
shopify-install-auth setup
- Access scopes:
read_metaobjects, write_metaobjects, read_metaobject_definitions, write_metaobject_definitions
- Metafield scopes per resource:
read_products/write_products for product metafields, etc.
Instructions
Step 1: Define a Metafield on Products
Use metafieldDefinitionCreate with namespace, key, type, and ownerType:
await client.request(METAFIELD_DEFINITION_CREATE, {
variables: {
definition: {
namespace: "custom",
key: "care_instructions",
name: "Care Instructions",
type: "multi_line_text_field",
ownerType: "PRODUCT",
pin: true,
},
},
});
Step 2: Set Values in Batch with metafieldsSet
await client.request(METAFIELDS_SET, {
variables: {
metafields: [
{
ownerId: ,
: ,
: ,
: ,
: ,
},
],
},
});