# GraphQL API: How to check if variant is available in the Online store sales channel?

**URL:** <https://community.shopify.dev/t/graphql-api-how-to-check-if-variant-is-available-in-the-online-store-sales-channel/33170>\
**Category:** GraphQL Admin API Troubleshooting\
**Tags:** general-gql-troubles\
**Created:** [April 9, 2026, 5:47pm UTC](https://community.shopify.dev/t/graphql-api-how-to-check-if-variant-is-available-in-the-online-store-sales-channel/33170 "2026-04-09T17:47:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pridentt](https://sea1.discourse-cdn.com/shopifycommunity/user_avatar/community.shopify.dev/pridentt/32/1376_2.png) [@Pridentt](https://community.shopify.dev/u/Pridentt)\
**Post date:** [April 9, 2026, 5:47pm UTC](https://community.shopify.dev/t/graphql-api-how-to-check-if-variant-is-available-in-the-online-store-sales-channel/33170/1 "2026-04-09T17:47:53Z")

</div>

From the [ProductVariant](https://shopify.dev/docs/api/admin-graphql/latest/objects/ProductVariant) fields, I noticed that I can use `availableForSale`, but it looks like this would also return true it the variant is available in other sales channel that’s not the online store.

Also, I saw the `sellableOnlineQuantity` looks promising, but if the `inventoryPolicy` field is set to `CONTINUE` (selling when out of stock) then the `sellableOnlineQuantity` field doesn’t say much.

Any insight is appreciated, maybe I’m just confused about these fields!

---

<div class="post-metadata">

**Author:** ![KyleG-Shopify](https://sea1.discourse-cdn.com/shopifycommunity/user_avatar/community.shopify.dev/kyleg-shopify/32/6799_2.png) [@KyleG-Shopify](https://community.shopify.dev/u/KyleG-Shopify)\
**Post date:** [April 14, 2026, 4:41pm UTC](https://community.shopify.dev/t/graphql-api-how-to-check-if-variant-is-available-in-the-online-store-sales-channel/33170/2 "2026-04-14T16:41:45Z")

</div>

Hey @Pridentt, is your main goal to see if a variant has inventory available, or if it is available to the online store?

It’s not possible to filter or set publications at the variant level, so you can use the [`published_status:published`](https://shopify.dev/docs/api/admin-graphql/latest/queries/products#argument-query-filter-published_status) on a products query to return all of the products published to the online store.

For the `availableForSale` field, this is `false` only when the variant tracks inventory, denies overselling, and has 0 (or less) total available quantity across all locations. In all other cases it returns `true`.

So to find products available to the online store and able to be sold, combining `published_status:published` WITH `availableForSale: true` would work.

---

<div class="post-metadata">

**Author:** ![Pridentt](https://sea1.discourse-cdn.com/shopifycommunity/user_avatar/community.shopify.dev/pridentt/32/1376_2.png) [@Pridentt](https://community.shopify.dev/u/Pridentt)\
**Post date:** [April 14, 2026, 5:36pm UTC](https://community.shopify.dev/t/graphql-api-how-to-check-if-variant-is-available-in-the-online-store-sales-channel/33170/3 "2026-04-14T17:36:47Z")

</div>

Hi @KyleG-Shopify, sorry maybe I should have specified, I’m basically trying to validate if the variant is available to be added to cart in the storefront.

I ended up using this query:

```auto
query VariantOnlineInventoryMany($ids: [ID!]!) {
    nodes(ids: $ids) {
      ... on ProductVariant {
        id
        availableForSale
        product {
          status
        }
      }
    }
  }

```

Then validating that if `availableForSale === true` AND `product.status` is `ACTIVE` or `UNLISTED`, then I consider it available to be added in the storefront.

Is this correct? Or should I also consider `published_status`? Thanks!

---

<div class="post-metadata">

**Author:** ![KyleG-Shopify](https://sea1.discourse-cdn.com/shopifycommunity/user_avatar/community.shopify.dev/kyleg-shopify/32/6799_2.png) [@KyleG-Shopify](https://community.shopify.dev/u/KyleG-Shopify)\
**Post date:** [April 14, 2026, 6:58pm UTC](https://community.shopify.dev/t/graphql-api-how-to-check-if-variant-is-available-in-the-online-store-sales-channel/33170/4 "2026-04-14T18:58:24Z")

</div>

That would work, but it could still lead to some issues as it’s a little bit too generalized. If the shop is using markets or other contextualized features, the buyers may end up in a checkout that isn’t valid for them.

If you’re building carts, I would recommend the storefront API instead to ensure the buyer context is used

> **[Cart](https://shopify.dev/docs/storefronts/headless/building-with-the-storefront-api/cart)**
>
> Learn about the benefits of using Shopify-powered carts, and how you can extend a cart's functionality.

---

<div class="post-metadata">

**Author:** ![Pridentt](https://sea1.discourse-cdn.com/shopifycommunity/user_avatar/community.shopify.dev/pridentt/32/1376_2.png) [@Pridentt](https://community.shopify.dev/u/Pridentt)\
**Post date:** [April 15, 2026, 12:00am UTC](https://community.shopify.dev/t/graphql-api-how-to-check-if-variant-is-available-in-the-online-store-sales-channel/33170/5 "2026-04-15T00:00:48Z")

</div>

Yeah I don’t have a problem with that, I’m not building carts, I was just getting this data to show alerts in my app’s UI, thanks Kyle!
