Product published_status vs status

Solved
Shopify Partner
16 0 1

Hi!

I've noticed from the Products search API https://shopify.dev/docs/admin-api/rest/reference/products/product#index-2020-07

That there are options to search by `published_status` and `status`. Are these two fields related? For example does `status=active` imply that `published_status=published` ?

 

If they are not the same:

  • how are they different?
  • how would I query for products with `status=active` on the admin graphql, since we can only query by `published_status` field on that API?
0 Likes
Shopify Staff
Shopify Staff
23 3 3

This is an accepted solution.

Hi @sengming,

I'd try to explain the difference between the the status and published_status fields of the Product resource, and hopefully I can clarify any confusion you have.

For the Rest API,

  • the status field of a Product resource indicates the product status. Possible values are active, draft, or archived.

  • the published_status of a Product resource indicates what channel the product is available on. Using the values published, unpublished, or any, the channel used is the online store. There is flexibility to select products from a specific channel also. You can use the following [channel_name]:[hidden|visible] as the value (the value should be url encoded). For example finding all products published on the Buy Button channel would use /admin/api/2020-10/products.json?published_status=buy_button%3Avisible (url encoded).

 

To answer your question about how to query for products that have an active status using GraphQL, see the example below

{
  products(first:10, query: "status:active") {
    edges {
      node {
        id
        status
      }
    }
  }
}

 

I hope this helps, and the differences between the status and published_status fields are clearer now.

 

Best,

Seth.

Shopify Partner
16 0 1

Thank you @syf_ for the thorough answer!

0 Likes