What's your biggest current challenge? Have your say in Community Polls along the right column.
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Missing metafields from metafield.json request

Solved

Missing metafields from metafield.json request

JimBooth
Shopify Partner
2 0 0

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

Accepted Solution (1)

SBD_
Shopify Staff
1831 273 421

This is an accepted solution.

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-i... (screenshot).

Scott | Developer Advocate @ Shopify 

View solution in original post

Replies 2 (2)

SBD_
Shopify Staff
1831 273 421

This is an accepted solution.

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-i... (screenshot).

Scott | Developer Advocate @ Shopify 

JimBooth
Shopify Partner
2 0 0

Thanks very much.