FROM CACHE - en_header

Customer Count Discrepancy with Customer Saved Search API

Solved
dinevillar
New Member
3 0 0

There is a discrepancy that we encounter with customer saved search. 

In Shopify, the saved search is only showing 437 customers included in the saved search but if we actually fetch the customer saved search via API using cursor based pagination, it is returning around 4464 records.

This bug misleads our customers on cost estimation that we run with our marketing campaigns. 

Please see attached.

Screen Shot 2021-06-15 at 11.33.23 am.pngapi.png

Accepted Solution (1)

Accepted Solutions
SBD_
Shopify Staff
Shopify Staff
1098 146 220

This is an accepted solution.

Hey @dinevillar @shopSketch 

A fix has been deployed.

Scott | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

View solution in original post

Replies 6 (6)
GrahamS
Shopify Staff
Shopify Staff
193 36 49

Hello @dinevillar 

Can you pass me an x-request-id for the call that is returning the unexpected result? The more recent the better. 

Best,

Graham

Graham S | API Support @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

dinevillar
New Member
3 0 0

Hey Graham,

Thanks for the reply, the request id is 76a47aeb-6fa0-4f0c-af52-4fbadc08360a

That's only for the first page, we're trying to get all customers within that saved search so it involves multiple request since we're using the REST API.

Thanks,

shopSketch
Tourist
7 0 2

Hi @GrahamS I have raised a support ticket on this and have managed to identify the bug. Ticket 24751337.

 

In the Shopify UI when you create a filter and include a `Location` in that filter the REST API ignores that query.

I created a Customer Filter in 2020, I selected `Location: Australia` and it generated a query `country:\"Australia\"`.

{
      "id": 1657643270305,
      "name": "From Australia",
      "created_at": "2020-08-20T03:09:51-04:00",
      "updated_at": "2020-08-20T03:09:51-04:00",
      "query": "country:\"Australia\""
}

 

Whereas if I create a filter now with that same criteria it now uses `territory_code:AU`

{
      "id": 2091613913249,
      "name": "Saved AU",
      "created_at": "2021-06-29T02:58:53-04:00",
      "updated_at": "2021-06-29T02:58:53-04:00",
      "query": "territory_code:AU"
}

 

When I request the customers on the new saved search, using `territory_code`,  it returns all my Shopify customers, as if no filter exists.

admin/api/2021-04/customer_saved_searches/2091613913249/customers.json

 

Whereas if I use the GraphQL query and use territory_code it correctly filters the data.

 

I believe the REST API on `customer_saved_searches/{customerSavedSearch}/customers.json` ignores the `territory_code` or it hasn't been implemented.

SBD_
Shopify Staff
Shopify Staff
1098 146 220

Hey @shopSketch  @dinevillar 

Thanks for reporting this. I'm able to replicate. I've raised this with the customers team. Keep you posted.

Scott | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

SBD_
Shopify Staff
Shopify Staff
1098 146 220

This is an accepted solution.

Hey @dinevillar @shopSketch 

A fix has been deployed.

Scott | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

shopSketch
Tourist
7 0 2

Awesome, thank you very much @SBD_