Bug with results from customer_saved_searches/:id/customers.json compared to admin UI

Shopify Partner
20 0 6



I believe we've encountered a bug and I'm not sure if it's related to the recent changes in correlation with "accepts marketing" changes that happened a week or so ago. Basically, we've found that if a customer saved search in the Shopify admin includes the filter for "accepts marketing" regardless of whether it's set to true or false AND it has at least one additional filter, the saved search returns no customers via the API at customer_saved_searches/:id/customers.json. However, in the Shopify admin, there are results.


Reproduction example:

1. Make sure at least one customer "accepts marketing" and has zero orders.

2. Create a customer saved search in the Shopify admin with two filters: Accepts marketing = yes and Number of orders = 0.

3. You should see that customer in the resource list in the Shopify admin.

4. Using the REST API, go to /admin/customer_saved_searches/:searchId/customers.json.

5. You'll get an empty array for the customers property.


This only seems to be happening for the accepts marketing filter when combined with another filter. I'm not sure if this is a new limitation, or if this is just a bug and perhaps related to the recent changes around the accepts marketing area that went on.


For Shopify employees, I'm happy to provide a shop that can exemplify this, but we've also seen our customer shops experiencing this too, so it's not isolated to one of our shops. Feel free to send me a direct message or find me on the Shopify Partner Slack channel. I do have an example request ID which should show this: 652b551a-e9d5-4dc9-9bff-ce516aeb5790




Shopify Staff
Shopify Staff
297 32 66

Hey Marc,


Thanks for bringing this to our attention. 


If customers meet the criteria of your saved search, and appears in the results set of that search in the admin, then they should also be returned as part of the associated API call to the Customers endpoint.


I'm going to pass this along to our development team so they're aware of the issue, and will update you when a fix has been implemented.