When using the return query in Shopify, I can retrieve the return tracking number and shipping carrier information from the reverseFulfillmentOrders > reverseDeliveries > deliverable > tracking field.
However, I’m unable to determine which specific lineItem the return is associated with. It seems that using the ReverseFulfillmentOrder ID only provides the associated ReverseFulfillmentOrderLineItem ID.
Is there a way to determine which lineItem the return tracking information is associated with?
To determine which specific lineItem a return tracking information is associated with, you can use the return query to retrieve the returnLineItems associated with a return. Each returnLineItem can be linked to a fulfillmentLineItem , which in turn is associated with a lineItem . Here’s an example of how you can structure your query:
In this query, replace $returnId with the ID of the return you are interested in. This will give you the lineItem details associated with each returnLineItem.
Additionally, you can use the reverseFulfillmentOrder query to get details about reverseFulfillmentOrderLineItems, which are linked to fulfillmentLineItems and thus to lineItems. Here’s an example: