Solved

Product created via API not listed to sales channels via Auto Collection

jstaab
Shopify Partner
20 1 11

This help article details a method for auto-listing products to sales channels within a shop. In order to avoid managing sales channels within our app (since that's sort of out of scope for us), we recommend to merchants they follow this approach. On occasion a merchant will come to us complaining that a product is not being listed to their online store, despite being successfully linked to their auto collection that is published to the online store. Here's the breakdown:

1. Merchant creates an auto-collection with conditions being quantity > 0, and list the collection on the online store sales channel.

2. Our app synchronizes a product, variant, and inventory level to Shopify.

3. The product appears on the auto-collection's page, but when you view the product's own page, it is not linked to any sales channels.

So my question is: does this approach work? Does it only work for products added on Shopify's end? Am I missing something? I want to allow merchants to manage their own sales channels, as that's not part of our app's job at all, but they need the ability to do it automatically.

Accepted Solution (1)
jstaab
Shopify Partner
20 1 11

This is an accepted solution.

Ok, I was able to implement this using the request detailed here, under "Show a hidden product by changing the published attribute to true". To publish to POS as well as the online store, I had to add "published_scope: global" to the request as well.

View solution in original post

Replies 7 (7)

jstaab
Shopify Partner
20 1 11

Digging more into this, it seems that collection channel availability isn't actually related to product channel availability, which means the above approach is totally bogus — can anyone confirm whether that's the case?

As an alternative, I went to the GraphQL api to see if I could solve this problem on my end using the "publications" property of products. Unfortunately, when I try to query `publications`, I get the following message: "Access denied for publications field. Required access: `read_publications` access scope. This scope is currently available only to private apps installed on Shopify Plus stores."

My app is public, and does not require merchants to have a Shopify Plus account. Is there no way to auto-list items to available channels?

GrahamS
Shopify Staff (Retired)
193 36 53

Hey @jstaab ,

You are correct in your conclusion - collection availability has no bearing on product availability. If you make a collection available to a particular channel but the products themselves are not, then the collection will be exposed but empty.

As far as publications access goes, right now the general API permission allows you to modify Online Store and POS access, and if your app is a sales channel, then access for or against your own channel on products. Publication status is otherwise scoped to the app associated with a given sales channel, unless you were to be given the permissions outlined in the message you received via your GQL query.

To learn more visit the Shopify Help Center or the Community Blog.

jstaab
Shopify Partner
20 1 11

Thanks Graham, that's really helpful. Follow-up question: how do I opt a product in to the online store and POS channels via the GraphQL API? I saw that the channelId and channelHandle arguments are deprecated, so I went to query publications to get the publicationId to use, but got the above error. How do I find out what the publication ids for the default channels are?

jstaab
Shopify Partner
20 1 11

@GrahamS I'd love to get this resolved, any tips?

GrahamS
Shopify Staff (Retired)
193 36 53

Hey @jstaab ,

Looking into this, it looks like there isn't a GQL equivalent to that REST function. The ability to adjust publication status via publishablePublish mutations does exist, however it is currently gated behind a Plus-only permission, leading to the error that you're currently encountering.

I'm going to speak to the team to see if this is expected as a behaviour for the long term, and in the meantime you may need to use REST if you're looking to adjust publication status specifically for Online Store and POS.

Best,

To learn more visit the Shopify Help Center or the Community Blog.

jstaab
Shopify Partner
20 1 11

Ok, thank you Graham, I'll take a look at the REST api. Are there plans to reconcile the two? My impression was that the REST API was deprecated, but there are a number of workarounds I've had to implement that require its use.

jstaab
Shopify Partner
20 1 11

This is an accepted solution.

Ok, I was able to implement this using the request detailed here, under "Show a hidden product by changing the published attribute to true". To publish to POS as well as the online store, I had to add "published_scope: global" to the request as well.