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.

Customers API pagination / count issue

Customers API pagination / count issue

ac_2023
Visitor
1 0 2

Hello Shopifyer's,

 

I've a Shopify shop with a total of 11 customers, 7 of them are tagged with 'BLENDER_IMPORT' tag.

 

Trying to retrive these 7 customers through REST ADMIN API (https://myshop.myshopify.com/admin/api/2022-04/customers/search.json?limit=7&tag=BLENDER_IMPORT), I get 7 results, but I have also notice a link to the next page is returned in response headers (Link: <https://myshop.myshopify.com/admin/api/2022-04/customers/search.json?limit=7&page_info=eyJ0YWciOiJCT...>; rel="next") which shouldn't be present as there are only 7 customers with this tag.

 

If I go to the next page (https://myshop.myshopify.com/admin/api/2022-04/customers/search.json?limit=7&page_info=eyJ0YWciOiJCT...) an empty customers collection in returned (and still next and previous link in response headers).

 

The customers "Count" API (https://myshop.myshopify.com/admin/api/2022-07/customers/count.json) is giving me a total of 141901 custumers present but looking at the dashboard, I only have 11 customers.

 

Any idea of what is going on here?

 

Thanks in advance!

Replies 6 (6)

garyrgilbert
Shopify Partner
431 41 185

yes, I wrote a post (excuse the typo on the title 🙂 )a while back about this same issue. Shopify screwed up changed something in the pagination royally... I haven't received any word yet, but I suspect the bug was introduced at the end of January.. and retroactively since it affects older api versions as well.

 

Cheers,

 

Gary

- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution

ShopifyDevSup
Shopify Staff
1453 238 519

Hi ac_2023,

 

Thanks for your post. After testing in a couple test stores we haven't been able to replicate either of those unusual pagination or count behaviours, which indicates there might be something store specific going on.

 

To enable further investigation please reach out [to Partner Support using the email option] and select the 'App Development & API' topic, and include mention of a specific store that you have staff access to where it's happening.

 

Thanks and hope you have a great day.

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us 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

garyrgilbert
Shopify Partner
431 41 185

Hi there @ShopifyDevSup 

 

I posted a question recently about a similar problem with graphql it kind of coincides with the regression that was introduced at the end of January, at least thats when I noticed the strange pagination issue.

 

https://community.shopify.com/c/shopify-apis-and-sdks/graphql-query-filtering-bug/td-p/1925563

 

I also noticed a similar issue in the rest api.  Could you take a look at the above thread and see if you can replicate the issue.

 

Cheers

- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution

Arep
Shopify Partner
4 0 1

@ShopifyDevSup I am seeing the same bug, even with the latest API.

ShopifyDevSup
Shopify Staff
1453 238 519

Hey folks - thanks for your patience on this. If you're still encountering pagination issues - could you share an X-Request-ID from one responses for one of the calls where you're seeing the reported behaviour? It would be helpful if the API call was made within the last 10 days or so so we can pull from our logs. 

Hope to hear from you soon - happy to dig into this. 

Al | Shopify Developer Support 

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us 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

garyrgilbert
Shopify Partner
431 41 185

Hi there,

 

The issue that I reported back in January seems to have been fixed. The queries no longer produce the issue.

 

Cheers,

 

Gary

- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution