Retrieve all refunds

Hello, how can one utilize the API Orders to retrieve all refunds within a specific date range, specifically based on the ‘refund creation date’?"

Thank you!

Hey @Haitham147 , that’s a great question.

The orders object doesn’t currently contain a specific filter for refund creation date, however you can use the updated_at date which in most cases would probably get you close to the date of the refund.

Here’s an example mutation that filters orders based on being refunded and the last updated after a specific date

query {> orders(first: 10, , query: “financial_status:refunded AND updated_at:>2023-11-01”) {> edges {> node {> id> displayFinancialStatus> processedAt> updatedAt> transactions(first:10) {> id> processedAt> kind> }> }> }> }> }

I included the transactions in this query so you can pull in the specific date the refund was processed.

This is the documentation I’ve used as the starting point for this query. https://shopify.dev/docs/api/admin-graphql/2023-10/queries/orders

Hope that helps!

  • Kyle G.