Cannot query order returns by name

Hi,

Use case:

  1. Return have been exported from Shopify to a WMS, including the return name as an external reference / key
  2. WMS handles the return and indicates return items have been received and/or return is ready to be processed
  3. There is no way to query an order return by return name

We could use the Shopify ID but it is rather long and poorly suited as a return reference.

Returns already have a return name - it would be great if the Order.Returns(query: ““) query could filter by return name.

1 Like

Hey @Evaldas_Raisutis,

I’ll pass on your use case as a feature request to add this field for query filters.

What I would recommend though is to use the return’s numeric ID instead of the full GID. You can extract just the numeric portion from the GID and use that as your external reference to keep it simpler if needed.

This field is also directly queryable in Order.returns as an integer and is more reliable than the name field as it’s guaranteed to be unique.

Hi Kyle, yes that’s one option. However, the order side of the coin is that when a return is created by an external system (such as WMS or return portal), then the return name cannot be set. In fact, there does not seem to be any field that can be used to store an external reference. Return name would be a great field to be able to set when creating a return through the API :slight_smile: But it would also require returns can be queried by the return name.

I can see you would need both the ability to apply the custom name and query it.

Currently, one way you could do this is with order metafields to store the name from the return created in the external system.