Ad

Create Unpublished Product In Shopify Via API

- 1 answer

In the Shopify Admin each product has a series of checkboxes that allow the user to toggle between Online store, Point of sale, Buy button, and Mobile app.

Here's what it looks like:

enter image description here

I'm pushing products into the Shopify via the API.

How can I push a product through the Shopify API as hidden on the web?

I dived deep and Here are the settings for each configuration:

---

Online store ✓
Point of sale
Buy button
Mobile app

published_at: "2016-02-18T17:14:00-05:00",
published_scope: "web",

---

Online store ✓
Point of sale ✓
Buy button
Mobile app

published_at: "2016-02-18T17:14:00-05:00",
published_scope: "global",

---

Online store ✓
Point of sale ✓
Buy button ✓
Mobile app

published_at: "2016-02-18T17:14:00-05:00",
published_scope: "global",

---

Online store ✓
Point of sale ✓
Buy button ✓
Mobile app ✓

published_at: "2016-02-18T17:14:00-05:00",
published_scope: "global",

---

Online store ✓
Point of sale
Buy button ✓
Mobile app ✓

published_at: "2016-02-18T17:14:00-05:00",
published_scope: "web",

---

Online store 
Point of sale
Buy button ✓
Mobile app ✓

published_at: null,
published_scope: "web",

---

Online store 
Point of sale
Buy button
Mobile app

published_at: null,
published_scope: "web",

---

My general observations for testing this is as follows.

  • No way to detect if a product has Buy button or Mobile app enabled for a product.
  • No way to toggle these fields in the API.
  • The published_scope property has two options web and global
Ad

Answer

To hide a product on all channels (web and poc).

Include this in the product request.

    "published": false,
    "published_scope": "web",
Ad
source: stackoverflow.com
Ad