I have a CSV list of order numbers (from another system) which I have tagged into the Shopify orders. Is there a way to read all the Shopify orders by the tag?
Alternatively, the order number (from the other system) is also in the Notes section of the Shopify Order but includes some other text around it. Not sure if there’s a way to do a “contains” search or regex matching?
Tags are commonly used for filtering and searching, yes, but not necessarily via the API. For example, the order endpoint doesn’t have the ability to filter orders by tag via a GET request. However, you can filter orders in the admin by tag.
This is doable using the GraphQL API. Although I believe the search is fuzzy based on recent posts on here. But that’s a bit up in the air. Here’s an example of a working test case:
{
orders(first: 10, query:"tag:test_tag") {
edges {
cursor
node {
id
name
tags
}
}
}
}