Solved

Can I filter Admin API products by sales channel?

sslotsky-gtsb
Tourist
4 1 1

When using the admin/bulk API, is it possible to request only the products that are active in the current sales channel? 

I do see there's a publishable_status filter that looks like it could be relevant but I can't find documentation on what that filter is for or what the possible values are.

Our solution so far has been to add the publishedOnCurrentPublication field to the query so we can filter them out after we source the data from the bulk API. But it would be swell if we could avoid fetching the unwanted ones altogether!

Accepted Solution (1)

sslotsky-gtsb
Tourist
4 1 1

This is an accepted solution.

It looks like the answer is in another thread 

 

the published_status of a Product resource indicates what channel the product is available on. Using the values published, unpublished, or any, the channel used is the online store. There is flexibility to select products from a specific channel also. You can use the following [channel_name]:[hidden|visible] as the value (the value should be url encoded). For example finding all products published on the Buy Button channel would use /admin/api/2020-10/products.json?published_status=buy_button%3Avisible

View solution in original post

Replies 2 (2)

sslotsky-gtsb
Tourist
4 1 1

This is an accepted solution.

It looks like the answer is in another thread 

 

the published_status of a Product resource indicates what channel the product is available on. Using the values published, unpublished, or any, the channel used is the online store. There is flexibility to select products from a specific channel also. You can use the following [channel_name]:[hidden|visible] as the value (the value should be url encoded). For example finding all products published on the Buy Button channel would use /admin/api/2020-10/products.json?published_status=buy_button%3Avisible

sewerynzeman
Shopify Partner
7 1 3

Getting back to this answer year later.

 

I've noticed that after migration of Private apps to Custom apps – the latter are not having an app handle assigned, therefore Custom app's Sales channels cannot be used anymore in `[channel_name]:[hidden|visible]` pattern to filter out products visible for particular App's Sales channel.

 

This said – accepted answer is no longer valid for all cases.