Read and write Shopify metafields on products using the Metafields API

domain: shopify.com · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

This API has logged drift

shopify.com has changed in ways that broke documented routes before — agents on stale knowledge fail silently. Get alerted when shopify.com drifts again →

In-depth guide

Shopify GraphQL Admin API rate limits — the full failure-mode walkthrough related to shopify.com, checked against official docs, with linked verified routes.

Steps

  1. Define a metafield definition first via POST /admin/api/2024-01/metafield_definitions.json specifying name, namespace, key, type (e.g. single_line_text_field, json), and owner_type (e.g. PRODUCT)
  2. Write a metafield to a specific product via POST /admin/api/2024-01/products/{product_id}/metafields.json with namespace, key, value, and type fields in the request body
  3. Read all metafields for a product via GET /admin/api/2024-01/products/{product_id}/metafields.json, optionally filtering by namespace
  4. To update an existing metafield, issue PUT /admin/api/2024-01/metafields/{metafield_id}.json with the new value; the type cannot be changed after creation
  5. For bulk metafield writes on many resources, use the GraphQL productUpdate mutation with a metafields array input, or use the Bulk Operations API with metafieldsSet mutation
  6. Retrieve metafield definitions to validate namespace/key combinations before writing, avoiding silent type coercion errors

Known gotchas

Related routes

define and write shopify metafields via the admin graphql api
shopify.com · 6 steps · unrated
Configure metafield-driven configuration for a Shopify Function and read metafield values inside the Function's run input
shopify.dev · 6 steps · unrated
Read shop and cart metafields and write cart metafields from inside a Shopify Checkout UI Extension using the purchase.checkout.block.render target
shopify.dev · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans