REST api discrepancy on count vs returned orders

REST api discrepancy on count vs returned orders

Adlogics
Shopify Partner
4 0 0

I am seeing a discrepancy between these two endpoints - Anyone encountered this before?

 

 

order_url = f"https://{shop_name}.myshopify.com/admin/api/2024-07/orders.json"
order_response = requests.get(order_url + "?status=any&financial_status=refunded", headers=headers)
# returns 1 order

count_url = f"https://{shop_name}.myshopify.com/admin/api/2024-07/orders/count.json"
count_response = requests.get(count_url + "?status=any&financial_status=refunded", headers=headers)
# returns 96 count

 

 

I would expect them to match exactly?

 

Reply 1 (1)

Harris3
Tourist
10 1 0

Hi @Adlogics,

 

The order endpoint might return a limited number of results per page. That's why make sure you're handling pagination correctly and retrieving all pages of results. Then check if the query parameters you use in both the orders and count endpoints are identical and correctly formatted. Make sure you’re not hitting Shopify API limits, as it can affect the data you receive.

 

But the easiest way is to contact Shopify support, as I did.

Gail Harris