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
1829 270 412

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
1829 270 412

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.