Hi,
I’m using the Shopify REST API to generate reports that integrate with other sales channels. Specifically, I’m using the /admin/api/2024-10/orders.json
endpoint to fetch orders filtered by date in order to calculate daily sales totals. Most of the time, this works fine.
However, there are specific cases causing issues. For example, on July 20, the API returns an order with the status refunded
, and it includes its respective refunds. The problem is that the refund dates are July 23, so the discounts shouldn’t be applied until that date (as reflected in the “Sales over time” report).
When I change the filter to July 23 and perform the respective calculations, the total sales amount for that day ends up being higher than what the Shopify report shows. This happens because there’s nothing in the API response to reflect the refund of the order created on July 20.
This issue is recurring. One of the key purposes of using the REST API is to allow businesses to access their data and generate specific reports, in my case, to declare the company’s net income by date. For example, if Shopify processes a payout on July 24, how can I explain that the sales report for July 23 shows more money than Shopify actually disbursed?
I’ve seen similar cases discussed before, but I haven’t found a solution or clarification from Shopify. It’s frustrating that Shopify seems to require querying orders from the beginning of time to reconcile each payout manually and then apply refunds where necessary. This is incredibly inefficient.
It would be much simpler if, in addition to the endpoint for filtering orders by date range, Shopify provided an endpoint to retrieve a list of refunds along with their associated orders, also filterable by date range. This would optimize requests on both our side and Shopify’s.
I apologize if a solution already exists and I simply haven’t found it. I’ve opened two support chats, but no one has been able to clarify whether this issue has been resolved. If anyone has already found a solution, I’d greatly appreciate it if you could share it.
Here’s the reference number for the ticket I opened (52523693), in case a Shopify developer wants to review my specific case.
Thank you in advance!