Product Visibility By Channel - API

Highlighted
Excursionist
19 0 5

Hi there,

It is possible for a product's visibility to be fine tuned to specific channels like Amazon, Ebay, Facebook, Messenger, Instagram, etc.

However, the API docs for product visibility - https://shopify.dev/docs/admin-api/rest/reference/products/product still show only 'web' and 'global' as possible values. 

 

bfcb3063057fed4129a2f0b4cd543a99.png

 

 

 

 

On searching again we landed here - https://shopify.dev/docs/admin-api/rest/reference/sales-channels/productlisting?api[version]=2020-07... 

16f446e3c472b6ffbd924992eb00ce24.png

 

 

 

 

 

I think this has what could give details on whether a product is available in differnet channels like Amazon, Ebay, Facebook, Messenger, Instagram, (not just broad Web/POS) but the api description says it returns the product ids published to 'your app', so it might be intended to be used by sales channel apps.

Could someone help clarify whether it is possible to track exaclty which channels the product is visible on and if so which endpoint should we be looking at?

0 Likes
Highlighted
Shopify Partner
661 46 132

This is definitely doable via the GraphQL API. Below is an example, where I pass the product ID for the query and it iterates through the first 5 sales channels (aka publications) that the product is published on.

Hope this helps!

{
  product(id: "gid://shopify/Product/4423635632180") {
    id
    title
    resourcePublications(first: 5, onlyPublished: true) {
      edges {
        node {
          publication {
            id
            name
          }
        }
      }
    }
  }
}
0 Likes
Highlighted
Excursionist
19 0 5

Hi Greg,

Thank you for the Graph QL solution.

However, we were looking if this is possible with the REST API as webhooks are needed to keep this data updated in the app. Unfortunately, a GraphQL solution would be too slow for most use-cases.

I am curious as to why this isn't included with the Published Scope? As it only shows web (online store only) and global (online and POS).

0 Likes
Highlighted
New Member
4 0 0

Hi all,

Although this problem yet to be solved with adding good API endpoint (or graphQL permission option for private app). There are new way to add/remove visibility on different sales channels in bulk. It is possible through admin tools. Here how to do it:

1. Select all products (or some), click "More actions" > "Add available channels"

Screenshot_2.jpg

2. Select Channels and click confirm

Screenshot_3.jpg

This will NOT have instant effect, changes will be done in few moments

Cheers!

0 Likes