Unable to get the SKU for a Return Line Item

Topic summary

A developer encountered an issue retrieving SKUs for return line items when using Shopify’s GraphQL API (version 2025-01). The ReturnLineItem type lacks a direct SKU field or LineItem connection, unlike RefundLineItem which has this capability.

Problem Details:

  • The available ID field returns values like gid://shopify/ReturnLineItem/0123456789
  • This ID cannot be directly linked back to the original LineItem to retrieve the SKU
  • Standard ReturnLineItemTypeConnection fields don’t expose SKU data

Solution Found:
The developer resolved this by using the GraphQL on operator to access the fulfillmentLineItem field, which provides a connection to the underlying lineItem object. From there, both the SKU and ID can be retrieved.

A working GraphQL query example was shared showing how to traverse: returnLineItems → fulfillmentLineItem → lineItem → sku

The issue is now resolved with a documented workaround for future developers facing the same limitation.

Summarized with AI on October 31. AI used: claude-sonnet-4-5-20250929.

Hey there,

I am working on an integration to pull returns out of Shopify’s GraphQL API and I am wanting to pull the SKU of a Return Line Item from the ReturnLineItemTypeConnection.

There is currently not a SKU field or a Line Item connection that I can then gather the SKU for the ReturnLineItem through that way. RefundLineItem do have the LineItem connection but it seems to ReturnLineItem is missing that connection and there is seemingly not a way to gather it.

https://shopify.dev/docs/api/admin-graphql/latest/queries/orders If you look at Returns > returnLineItems you wil l see the available fields:

There is an ID field available however, that returns a value such as gid://shopify/ReturnLineItem/0123456789 which has no way to link back to the LineItem to get the SKU.

Any help would be appreciated to help me get the ReturnLineItem SKU and I am also using API version: 2025-01.

Many thanks,

1 Like

If anyone is interested this is how I solved this:

query { orders(first: 25, query: "return_status:IN_PROGRESS") { pageInfo { startCursor hasPreviousPage hasNextPage endCursor } nodes { id displayFinancialStatus displayFulfillmentStatus createdAt updatedAt email name returns(first: 20) { nodes { id status name returnLineItems(first: 20) { edges { node { ... on ReturnLineItem { fulfillmentLineItem { lineItem { id sku } } } quantity returnReason returnReasonNote } } } } } } } }

I used the ‘on’ operator to link it to the fulfilmentLineItem which then you can use to get the related sku & id from the line item. Hope that helps people in the future. Many thanks