Dedicated to the Hydrogen framework, headless commerce, and building custom storefronts using the Storefront API.
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.
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.
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?
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?
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!!
Hello, is it possible to mark all sales channels for a new product via API when adding it to the store?
Hi, Shopify experts .... any news after lots of months and years? Thanks
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.
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.
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