Refunding using the GraphQL API - Querying the existing shipping refunds

Solved
Elrendio
Shopify Partner
12 0 5

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)
SBD_
Shopify Staff
Shopify Staff
1098 146 229

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 6 (6)
SBD_
Shopify Staff
Shopify Staff
1098 146 229

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
Shopify Partner
12 0 5

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 229

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

michaelholland
New Member
4 0 0

Is it still the case that there is no GraphQL option to GET the Shipping Fee amounts (or other Adjustments) Refunded on an Order?

michaelholland
New Member
4 0 0

@SBD_  - Can you tell me if there's any news on this?  I still don't see the Order Adjustments in the 2023.1 Release Candidate version of the API.  Is there a target release to have these included?  Thanks