How to query products that are available to a certain sales channel

Solved
Mandskitchen
New Member
2 0 2

Hi,

I am using the Storefront GraphQL API to build a ReactNative app.

I have a need to query all products (and their variants) which are available in a certain sales channel (in my case, "Mobile App").

I can query the products with a certain `product_type` , but I can't find any query parameter to search by `sales channel`

Is it possible? If yes, what's the parameter?

 

Thanks in advance!

vix
Shopify Staff
Shopify Staff
535 105 105

This is an accepted solution.

Hi @Mandskitchen 

Only products that are "published" to your sales channel i.e mobile app will be surfaced in the queries you are making from that Storefront Access Token. 

Vix | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

Mandskitchen
New Member
2 0 2

Just so that I understand this right, the access token that I have can be dependent on a sales-channel, and then only those products will be visible against the access token?

vix
Shopify Staff
Shopify Staff
535 105 105

Correct - If you are in the products area you will see the ability to publish to specific channels. If you head to your app, and query for all products, you should only see the ones published to this channel. 

Vix | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

power777
Tourist
9 0 4

vix:

 

I'm facing a similar issue. The product JSON shows the total inventory on all sales channels for example 180 in this case (image attached). I want to build a product feed only for the online store channel. I'm already using the published status parameter in the query.

 

image.png