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.

We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

Orders/count: financial_status and fulfillment_status parameters do not work with multiple statuses

Orders/count: financial_status and fulfillment_status parameters do not work with multiple statuses

andrewbraun
Shopify Partner
6 0 1

When I call the REST API's orders/count endpoint, I can't filter by more than one financial_status. For example:

 

 

 

https://{store_name}.myshopify.com/admin/api/2024-01/orders/count.json?financial_status=refunded,partially_refunded

 

 

 

This query should return a count of orders that have either the refunded or partially refunded financial_status. Instead, however, I get a count of all open orders.

 

However, if I call it with just one order status, it works correctly:

 

 

https://{store_name}.myshopify.com/admin/api/2024-01/orders/count.json?financial_status=refunded

 

 

This returns the correct number of open orders with the refunded status.

 

I initially tried this with the shopify-api Node REST client in my app, using the rest.Order.count function, and that's where I noticed this behavior. I then tried directly in an API client and got the same results.

 

fulfillment_status has the same issue.

 

Interestingly, if I remove the /count and simply try to filter orders by financial_status, it works. I get only orders that meet one of the specified financial statuses.

 

This seems like a bug--if we can retrieve orders with multiple financial_status filters, why can't we retrieve a count?

 

I can get around this by calling the orders endpoint with a pagination loop until I get every past order id for different statuses, then combine the counts, but that is obviously way less efficient. And it gets even more inefficient when combined with fulfillment_status.

 

Anyone know what's up with the orders/count endpoint?

Replies 0 (0)