Refunding using the GraphQL API - Querying the existing shipping refunds

Solved
Elrendio
Tourist
9 0 2

From what I read here, the refunds have linked order_adjustments that contain, among other things, the shipping refund amounts.

However, I can't find their corresponding equivalent on the GraphQL API Refund object.

How can I find how much the shipping refund accounts for in an existing refund using the GraphQL API ?

Accepted Solution (1)

Accepted Solutions
SBD_
Shopify Staff
Shopify Staff
1098 146 219

This is an accepted solution.

Hey @Elrendio 

Seems like it's in the works. I was able to access using the unstable version of the API via refunds.orderAdjustments:

POST /admin/api/unstable/graphql.json

{
  order(id: "gid://shopify/Order/...") {
    refunds {
      orderAdjustments(first:10) {
        edges {
          node {
            id
          }
        }
      }
    }
  }
}

 

Scott | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

View solution in original post

Replies 4 (4)
SBD_
Shopify Staff
Shopify Staff
1098 146 219

This is an accepted solution.

Hey @Elrendio 

Seems like it's in the works. I was able to access using the unstable version of the API via refunds.orderAdjustments:

POST /admin/api/unstable/graphql.json

{
  order(id: "gid://shopify/Order/...") {
    refunds {
      orderAdjustments(first:10) {
        edges {
          node {
            id
          }
        }
      }
    }
  }
}

 

Scott | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

Elrendio
Tourist
9 0 2

Thank you !

I'm going to wait until it's on a stable version to start using it though, I wouldn't want everything to suddenly break 🙂

Yuxin_x
Shopify Partner
7 0 0

Hi @SBD_ !

 

This query is not working anymore, I receive this error:

"Field 'orderAdjustments' doesn't exist on type 'Refund'"

 

Do you know what's the best way to query 'orderAdjustments'?

I tried putting it into Order but it's not working yet 😛

SBD_
Shopify Staff
Shopify Staff
1098 146 219

Hey @Yuxin_x 

This field is still only available on the `unstable` version of the API.

/admin/api/unstable/graphql.json

Scott | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog