Sales channel for a given product

Solved

Sales channel for a given product

Jayaraj
Tourist
5 0 3

I have multiple sales channels on my store. Given a product id, how do I find all the sales channel enabled for that given product via API?

 

API can be REST or GraphQL.

Accepted Solution (1)

ShopifyDevSup
Shopify Staff
1453 238 497

This is an accepted solution.

Hi Jayaraj,

 

Thanks for your post. This is possible using a GraphQL query such as the one below, noting that the 'read_publications' scope is required which is currently available only to custom apps installed on Shopify Plus stores and which needs to be added by Partner Support by request.

 

The query:

 

query {
 product(id: "gid://shopify/Product/12345") {
   resourcePublications(first: 10) {
    nodes {
     isPublished
     publication {
      name
      id
     }
   }
  }
 }
}
 

Some related documentation:

 

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us 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

View solution in original post

Reply 1 (1)

ShopifyDevSup
Shopify Staff
1453 238 497

This is an accepted solution.

Hi Jayaraj,

 

Thanks for your post. This is possible using a GraphQL query such as the one below, noting that the 'read_publications' scope is required which is currently available only to custom apps installed on Shopify Plus stores and which needs to be added by Partner Support by request.

 

The query:

 

query {
 product(id: "gid://shopify/Product/12345") {
   resourcePublications(first: 10) {
    nodes {
     isPublished
     publication {
      name
      id
     }
   }
  }
 }
}
 

Some related documentation:

 

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us 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