Orders Count always returns 2 orders less

urnsshop_Admin
Shopify Expert
2 0 0

Hi, 

I want to get the count of orders that were created yesterday and were paid. If I go to the dashboard it returns me 50 on the first page and 8 on the second page. So that will be 58 in total. When running the request I get 56. If I remove the financial status paid in the dashboard I get 65 results, but by the api  I get 63. Any one has any issues with the count order api? 

I'm trying with this url:

$url_shopify = "https://".$API_KEY.":".$SECRET."@".$STORE_URL."/admin/api/2020-10/orders/count.json?financial_status=paid&created_at_min=".$shopify_min_order_date."&created_at_max=".$shopify_max_order_date;
 
It does run but returns 2 orders less. Any ideas
 
 

 

0 Likes
_JB
Shopify Staff
Shopify Staff
750 86 163

Hey @urnsshop_Admin,

This is usually due to improper URL encoding in the timestamps, particularly if the timestamp contains the + character. Make sure that the + is being encoded properly, otherwise it's interpreted as a space which causes the time portion to be ignored. A quick test is to replace the + with %2B in the URL before sending your call.

JB | 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

0 Likes
urnsshop_Admin
Shopify Expert
2 0 0

Hi, thanks, but its strange, I have it encoded and it doesnt even show real data if i take oct 14 and what we have received in oct15 we have more than 144 orders, but the count returns 125 its very strange  I dont know if the count is cached or not in real time but its not giving me real data.  

0 Likes