Refunding using the GraphQL API - Querying the existing shipping refunds

Solved
Elrendio
Tourist
9 0 1

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 ?

0 Likes
SBD_
Shopify Staff
Shopify Staff
1096 147 205

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
          }
        }
      }
    }
  }
}

 

0 Likes
Elrendio
Tourist
9 0 1

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

0 Likes
Yuxin_x
Tourist
4 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

0 Likes
SBD_
Shopify Staff
Shopify Staff
1096 147 205

Hey @Yuxin_x 

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

/admin/api/unstable/graphql.json