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.

Can you search for customer using metafields?

Can you search for customer using metafields?

turqay16
Shopify Partner
1 0 0

I have distributors and customers and they are linked used metafields, basically a customer has a metafield of distributorId, and I used to it to create a 1 to many relation, but how can i look it up?

Replies 2 (2)

richard-penner
Shopify Staff
19 2 6

Hi @turqay16 –

Metafields are meant to store additional information about Shopify resources, so you can easily fetch metafield values in your case when fetching the Customers via API. But there is currently no way to do a "lookup by value", e.g. fetch all Customers where DistributorId = 123. You may need to use your own application logic / database for this reverse lookup.

To learn more visit the Shopify Help Center or the Community Blog.

David_Song
Shopify Partner
3 0 0

Now it is July 25, 2024, can you still not query the corresponding customer through metaField using shopify API?
Looking forward to your reply.