Refund API

New Member
3 0 0

Hi,

We need an API that gives all the Refund information. I have read the Refund document (i.e https://shopify.dev/docs/admin-api/rest/reference/orders/refund).
For us, it is not feasible to make a refund request for every single order. So, is there any API that gives all the Refund information?

 

Thanks!

0 Likes
Highlighted
Shopify Staff
Shopify Staff
426 57 65

Hi @khanshahbaz ,

 

In Shopify, Refunds are just properties/data that exist within an Order. So in order to get information about Refunds, you need to always go through its parent Order first.

 

One way you can achieve what you are looking for is to make a query using the Admin API for all Orders in a store, but filter specifically for orders which have financial status of `refunded` or `partially_refunded`. This will return every order in that store that has ever been refunded, and you can then iterate through each of those returned orders to get the refund information from each of them

 

In REST, this request would look like this: GET to 

{store-name}.myshopify.com/admin/api/2020-01/orders.json?financial_status=refunded

In GraphQL, this request would look like:

query {
  orders(first: 100, query:"financial_status:refunded") {
    edges {
      node {
        id 
      }
    }
  }
}

 

Hassain | Developer Support Specialist @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

0 Likes