Missing metafields from metafield.json request

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).

Thanks very much.