How to query to Get Product Variant if Price is 0

Topic summary

An external system is incorrectly overwriting product prices to $0, prompting the need for an automated detection system. The goal is to create an hourly Flow schedule that identifies all product variants priced at $0 and sends alerts to Slack.

Technical Challenges:

  • The Admin API’s productVariants query doesn’t support a price filter parameter, making direct filtering impossible
  • While the products query does support price filtering, this approach requires additional variant identification steps
  • Attempted workaround using a smart collection (products with price = $0) partially works with the query format collection:465903092033
  • However, the collection filter unexpectedly excludes $0 products even when they exist in the collection

Current Status:
The issue remains unresolved. The collection-based filtering approach shows promise but fails to return the target $0 variants. The collection_id filter exists in API version 2024-10 but Flow currently uses 2024-04, limiting available options. A workaround or alternative approach is still needed.

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

We’ve been having an issue recently with an external system overwriting our prices to 0. I’m trying to create an hourly schedule to get all the product variants in my store with 0 price, then I’ll use the HTTP request action to post to Slack, but so far I can’t figure out how to use Flow to filter down to just the 0 price variants. It keeps sending the info for all variants up to the first 100. Is there something wrong with my advanced query of price:0 or is there another better method?

As noted in the filter parameters documentation linked beneath the query, there is no query filter for price for product variants in the Admin API, so this is not a valid query. There is, however, a query filter for price for products, so maybe you can use Get product data instead and identify the relevant variants from there.

Thanks, it does look like collection is an acceptable filter parameter, so I set up a smart collection with the condition that product price equals 0 to filter down to the $0 price products. But I’ve tried multiple formats for the collection ID query and it’s not working. Do you know the proper format for the query? For example, I’m using fake collection IDs, but with my real collection ID I’ve tried both of these and neither worked.

  • collection:465903092033
  • collection:‘465903092033’

It looks like support for collection_id as a query filter was added in Admin API version 2024-10 but Flow is currently using 2024-04, which does not support that query parameter. It should become available in the near future when Flow adopts 2024-10 but in the meantime you may need a different approach.

I might be referring to a different filter - there is “collection” referenced on this 2024-04 documentation for productVariants, under query filters

https://shopify.dev/docs/api/admin-graphql/2024-04/queries/productVariants#argument-query-filter-default

1 Like

So what I have found is that this query filter format does work in Flow for get ProductVariant data – collection:465903092033 – but the filter for some reason excludes $0 products, even if they are present in the collection. I’m not sure why that is though or if there is a work around.