Have your say in Community Polls: What was/is your greatest motivation to start your own business?
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.

Re: Inconsistent results with checkouts API

Inconsistent results with checkouts API

inked
Visitor
2 0 0

Hi,

 

I'm having an issue with the checkouts API returning inconsistent results.

 

For example, when I fetch the count of checkouts with created_at_min = 2019-09-03, at the time of writing this, the result is 1,100. The checkouts API with a limit of 50 per page should have 22 page of results, this is not the case.

 

If I execute a request to the checkout API to retrieve the results using the same params (created_at_min = 2019-09-03), there's actually 25 pages of results!

 

This is an issue for our implementation because we are looping through each page, based on the result of the count.

 

Is anyone able to shed some light on why the count and checkouts API's are not consistent and how we can fetch the counts accurately to loop through the correct number of pages?

 

For reference, the count API I'm using is:
/admin/checkouts/count.json?created_at_min=2019-09-03

The checkout API I'm using is:
/admin/checkouts.json?created_at_min=2019-09-03&limit=50&page=25

 

Thanks!

Replies 3 (3)

Josh
Shopify Staff
1134 84 235

Hey @inked , 

 

It's tough to say off the top of my head, but I could definitely take a closer look for you if I could see the shop that this was occurring on. 

 

Would you mind sharing the .myshopify.com URL of the shop you're looking at? 

Josh | 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 the Shopify Help Center or the Shopify Blog

inked
Visitor
2 0 0

Hello,

 

I've sent you a private message with our store URL. 

 

Thanks.

Josh
Shopify Staff
1134 84 235

Hey @inked , 

 

Thanks for that - I saw that and took a look. After speaking with our checkout team, they realized that the count endpoint isn't aware of timezones which is where the discrepancy is coming from. I've filed a bug report with them so that we can get this taken care of. In the meantime you may notice that the numbers are a little bit off, but this shouldn't be something permanent. 

Josh | 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 the Shopify Help Center or the Shopify Blog