Missing metafields from metafield.json request

Topic summary

Issue: A customer metafield is visible via the single-metafield endpoint (/metafields/{id}.json) but does not appear in the general list (/metafields.json), which only shows two default demo metafields.

Cause: The /metafields.json endpoint, by default, returns metafields for the ‘shop’ owner resource only.

Solution: Specify the resource context when listing customer metafields by adding query parameters:

  • owner_resource=customer
  • owner_id={customer_id}
    This filters the list to the customer’s metafields. An example link and a screenshot were provided to illustrate the request format.

Outcome: The original poster acknowledged the fix and thanked the responder.

Status: Resolved; no further questions.

Notes:

  • Key terms: owner_resource (the resource type, e.g., customer), owner_id (the specific resource’s ID).
Summarized with AI on January 24. AI used: gpt-5.

Hi,

I have created a customer metafield which I can view using Postman and the /metafield/7066612072755.json endpoint however, it does not display when I list the metafields with /metafields.json - this only displays the default 2 metafields from the demo data.

What am I doing wrong?

Many thanks

Jim

Hey Jim,

By default you’ll only see metafields from the ‘shop’ owner resource. To see customer metafields. you’ll need to pass through the owner_id and owner_resource (‘customer’). Here’s an example: https://shopify.dev/docs/api/admin-rest/2023-04/resources/metafield#get-metafields?metafield[owner-id]=382285388&metafield[owner-resource]=blog-examples (screenshot).

1 Like

Thanks very much.