Clarification on Retrieving fulfillmentLineItemId for returnCreate Mutation

Hi there,

I’m trying to create a return via the API (returnCreate mutation), but I keep getting this error:

Fulfillment Line Item was not found.


Here’s the response:

[returnCreate] => Array
(
  [userErrors] => Array
    (
      [0] => Array
        (
          [field] => [returnInput, returnLineItems, 0, fulfillmentLineItemId]
          [message] => Fulfillment Line Item was not found.
        )
    )
)


I’m unable to determine the correct fulfillmentLineItemId. I’ve tried retrieving IDs through various queries (fulfillment, orderLineItems, fulfillments, etc.), but none of them seem to match what the return mutation expects.

Could you please clarify how to correctly obtain the fulfillmentLineItemId for a specific fulfilled order or item?
Any reference query example would be appreciated.

Thank you,
Paul

1 Like

Hey @Paul_Wolf, you can query returnableFulfillments to get the fulfillmentLineItemId:

query {
  returnableFulfillments(orderId: "gid://shopify/Order/YOUR_ORDER_ID", first: 10) {
    returnableFulfillmentLineItems(first: 50) {
      edges {
        node {
          fulfillmentLineItem {
            id  # This is the fulfillmentLineItemId for returnCreate
          }
          quantity
        }
      }
    }
  }
}

The fulfillmentLineItem IDs from order.fulfillments won’t work with the return mutation. You need to use returnableFulfillments to get the correct ID type.

The return management guide shows the complete workflow.