Getting error in returnCreate graphQl mutation

Topic summary

Developers are encountering an “invalid id” error when attempting to use the returnCreate GraphQL mutation in Shopify’s API.

Root Cause:
The error stems from using the wrong ID type for the fulfillmentLineItemId field. Users are mistakenly providing:

  • Order LineItem IDs, or
  • FulfillmentOrderLineItem IDs

Instead of the required FulfillmentLineItem ID.

Key Distinctions:

  • FulfillmentOrder: Automatically created container for inventory items associated with a specific fulfillment location/service
  • Fulfillment: Represents what the fulfillment service/location actually controls and ships
  • The mutation requires the FulfillmentLineItem object, not the FulfillmentOrderLineItem

Recommended Actions:

  • Verify you’re referencing the correct line item type (FulfillmentLineItem)
  • Confirm the ID number corresponds to the correct item
  • Contact Shopify Partner Support for merchant-specific investigation if issues persist

Status:
One user worked around the issue by using refundCreate mutation instead, though this processes returns differently from a business perspective. The discussion remains open with no confirmed resolution for the original mutation.

Summarized with AI on November 16. AI used: claude-sonnet-4-5-20250929.

using below query and variables to create a return, but getting error
query :

mutation returnCreate($returnInput: ReturnInput!) {
returnCreate(returnInput: $returnInput) {
return {
status
}
userErrors {
field
message
}
}
}

variables :

{
“returnInput”: {
“notifyCustomer”: true,
“orderId”: “gid://shopify/Order/4962979217576”,
“requestedAt”: “2019-09-07T15:50:00Z”,
“returnLineItems”: [
{
“fulfillmentLineItemId”: “gid://shopify/LineItem/12053660893352”,
“quantity”: 1,
“returnReason”: “WRONG_ITEM”,
“returnReasonNote”: “”
}
]
}
}

response :

{
“data”: {
“returnCreate”: null
},
“errors”: [
{
“message”: “invalid id”,
“locations”: [
{
“line”: 2,
“column”: 3
}
],
“path”: [
“returnCreate”
]
}
],
“extensions”: {
“cost”: {
“requestedQueryCost”: 10,
“actualQueryCost”: 1,
“throttleStatus”: {
“maximumAvailable”: 1000.0,
“currentlyAvailable”: 999,
“restoreRate”: 50.0
}
}
}
}

Hi @omuni !

Your return input seems to include an Order LineItem, but the “fulfillmentLineItemId” field requires a FulfillmentLineItem. This is specified in the docs:

The ID of the fulfillment line item to be returned. Specifically, this field expects a FulfillmentLineItem.id.

I’m experiencing the same issue.

{
“returnInput”: {
“orderId”: “gid://shopify/Order/5258878976282”,
“requestedAt”: “2023-03-29T17:05:55Z”,
“returnLineItems”: [
{
“fulfillmentLineItemId”: “gid://shopify/FulfillmentOrderLineItem/13857495875866”,
“quantity”: 1,
“returnReason”: “UNKNOWN”,
“returnReasonNote”: “”
}
]
}
}

response:

{
“data”: {
“returnCreate”: null
},
“errors”: [
{
“message”: “invalid id”,
“locations”: [
{
“line”: 3,
“column”: 3
}
],
“path”: [
“returnCreate”
]
}
],
“extensions”: {
“cost”: {
“requestedQueryCost”: 10,
“actualQueryCost”: 1,
“throttleStatus”: {
“maximumAvailable”: 1000.0,
“currentlyAvailable”: 999,
“restoreRate”: 50.0
}
}
}
}

Hey all - thanks for getting in touch - and for waiting on this response. I can’t say for sure why your calls aren’t working on my end without approval from the merchant to investigate further (or if you were to get in touch with us through our Partner Support team we can authenticate that way), but broadly speaking, you’ll want to make sure you’re using the fulfillment line item object here and not the fulfillment order line item object.

To clarify, a fulfillment order is created automatically for inventory items that are associated with a particular fulfillment location/fulfillment service, and a fulfillment is what the location/service has control over - which is why you’d want to use the fulfillment line item object in this case.

I’d just make sure to confirm that you’re referencing the right type of line item as well as confirm if the ID number for the item is correct. This should resolve the issue, but let me know if you encounter any further errors - happy to keep digging into this.

Hope this helps!

Al | Shopify Developer Support

Hello, I have also encountered the same problem. Have you resolved it now?

I couldn’t get past the error so I went with refundCreate did things a little different to keep the business process the same.