What's your biggest current challenge? Have your say in Community Polls along the right column.
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Product created via Admin API "unavailable on 4 sales channels"

Product created via Admin API "unavailable on 4 sales channels"

Ruben00001
Excursionist
20 2 4

I created a product by POST request using the Admin API. However, in the Shopify admin panel I can see that this product is "unavailable on 4 sales channels" and is only available on the "Point of Sale" channel. I want the products I create to be available on all of my sales channels by default.

 

The "published_scope" of this product is set to "global".

 

Reading other posts it seems that Shopify doesn't allow the editing of which sales channels products appear on via an API but only via the admin page. I don't want to choose which channels they appear on but have them appear on all of them by default.

Replies 9 (9)

hassain
Shopify Staff (Retired)
624 104 189

Hey @Ruben00001 ,

 

There is currently no way through the Shopify API to publish a resource across all Sales Channels by default. As per our documentation, setting the attribute of published_scope=global just means that the product is published to both the Online Store channel and the Point of Sales channel. (https://shopify.dev/docs/admin-api/rest/reference/products/product). This property does not allow you to publish your product to all channels by default. 

 

There is an option to publish resources to specific channels via the Shopify GraphQL Admin API. It is through the mutations of "publishablePublish" (https://shopify.dev/docs/admin-api/graphql/reference/mutation/publishablepublish) where you can publish any resource (e.g. product or collection) to any channel you choose. However to use this mutation you need the access scope of "write_publications", which you can only get if you reach out to Shopify "Partner Specialist" Support and ask them to add it to your app. EDIT: The publishablePublish scope is currently only available to private apps installed on Shopify Plus stores. At this time we're unable to provide a timeline regarding availability for other apps, but keep an eye on our changelog as future updates will be posted there.

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

Ruben00001
Excursionist
20 2 4

Thanks @hassain.

 

Why would I need a "Partner Specialist" for this GraphQL mutation? Do you only grant access to "write_publications" to  them? If so, why?

merlandsson
Visitor
2 0 0

Hi @hassain , I just wondering why my products are removed from channel "website" when they onced marked? I do sometimes add product information (pictures and product texts) and choose my sales channels BEFORE the products are in stock. And then, when it is in stock, they are automatically removed from sale channel "website" and I manually need to mark this box again. How do I solve this? 

joelajackson
Visitor
1 0 0

Hi Hassain!

 

This is helpful. I want to clarify. We're building a react app outside of shopify for our store using the storefront api.

 

The products are being entered in a separate cms. Is there no way to sync them across and set the sales channel for our storefront app without shopify partner specialist support?

 

This is a decision making point as to whether we use shopify on this project. Thanks!!

piotr5
Visitor
2 0 0

Hello, is it possible to mark all sales channels for a new product via API when adding it to the store?

juan3211
Shopify Partner
126 0 42

Hi, Shopify experts .... any news after lots of months and years? Thanks

_jh
Visitor
3 0 0

Make sure to set the published_scope field to "global" and published_at field to current date time and provide both fields in the update product API payload. The product will show up. 

MyRetroPosters
Visitor
1 0 0

FYI in late 2023, this still doesn't work with latest api version!!   setting "global" and a published date time still results in only "Online Store" sales channel being set.

jam_chan
Shopify Partner
927 23 190

I think you can use the publishablePublish to publish a product with the publication ID. Though I don't think it can publish to all publications at once

BYOB - Build Your Own Bundles, SPO - SEO App to research keywords & edit social link preview