Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
We recently encountered difficulty using Shopify API to find a customer by email. We found a solution in this Shopify forum post:
This solution seems to rely on a strange undocumented Shopify API feature. Could we get some clarity on this? Is this really a feature of Shopify API? Is it a bug? Should it be documented?
The customer in question: gid://shopify/Customer/5421928382632
This query WORKS:
{ customers(first:1, query:"email:'REDACTED") { edges { node { id email } } } }
This query DOES NOT WORK:
{ customers(first:1, query:"email:REDACTED") { edges { node { id email } } } }
This query DOES NOT WORK:
{ customers(first:1, query:"email:'REDACTED'") { edges { node { id email } } } }
So according to our tests, the only version that works is a query that has a single quote following the colon.
Note that the email in question has non-Latin characters but we are not sure if this is important.
Solved! Go to the solution
This is an accepted solution.
We did more tests, seems that there is no special :' comparator in the Shopify API, what happened is that Shopify treated email:'a@b.com the same as a@b.com (ignoring the malformed "email:" prefix).
For anyone that is struggling with searching for non-Latin emails (e.g. á@b.com) in Shopify, here are our test results:
a@b.com -- returns too many results
"a@b.com" -- returns the correct result
email:a@b.com -- returns 0 results
email:'a@b.com -- returns too many results
email:'a@b.com' -- returns 0 results
email:"a@b.com" -- returns 0 results
This is an accepted solution.
We did more tests, seems that there is no special :' comparator in the Shopify API, what happened is that Shopify treated email:'a@b.com the same as a@b.com (ignoring the malformed "email:" prefix).
For anyone that is struggling with searching for non-Latin emails (e.g. á@b.com) in Shopify, here are our test results:
a@b.com -- returns too many results
"a@b.com" -- returns the correct result
email:a@b.com -- returns 0 results
email:'a@b.com -- returns too many results
email:'a@b.com' -- returns 0 results
email:"a@b.com" -- returns 0 results
June brought summer energy to our community. Members jumped in with solutions, clicked ...
By JasonH Jun 5, 2025Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025