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.

Problem when updating product_status and published_scope

Problem when updating product_status and published_scope

davidalarcon
Shopify Partner
8 0 4

I am experiecing problems (see below) using my private app and postman

When I send a "product_status" update (from Draft to Active)
And the user is sending an update for "published_scope"  (from web to global or vice-versa)
Only product status is being updated and product scope remains the same

I have to perform several calls to get product status and published scope updated. Is there any explanation for this?

Also, I found that if I send "product status", "published scope" and "published_at" it is updated in a single call.
Is there any explanation about this behaviour?
Is "published_at" a necessary attribute to perform both attributes updates in a single call?

I've trying using postman and my private app aswell and "published_scope" field is never updated. Doesn't matter if the product_status is active or draft. And Shopify doesn't return an error.

I didn't find anything on API documentation..

 

Thank you

Replies 4 (4)

davidalarcon
Shopify Partner
8 0 4

This is still happening, anyone had the same experience performing this type of action?

Thomotron
Shopify Partner
7 0 3

I've run into this issue as well. I haven't been able to publish any products created via the REST API with version 2022-10 and above.

 

It's one thing to necro a year+ old thread, it's another to necro it for the wrong API...

iristan
Tourist
4 0 1

Hey David,
Did you end up finding a workaround? You've described my exact issue 🙂  

Iris

ShopifyDevSup
Shopify Staff
1453 238 531

Hi @iristan and @davidalarcon,

I've taken a look into this further on my own test store and was not able to replicate this issue. Just to clarify as well, this issue is pertaining to the REST Admin API and I will be moving this thread to our Products, Variants, and Collections board, as this current board is specifically for questions regarding our GraphQL Admin API.

 

Here is an example from my own test store using the Postman API Client with a Custom App installed on my store.

1. Here's a GET Request to the individual products.json endpoint that shows the status field is currently set to draft, and the published_scope field is currently set to web, prior to the PUT request

 

Request

GET /admin/api/2024-01/products/8189617307810.json?fields=id,created_at,updated_at,published_scope,status

Response

{
   "product": {
       "id": 8189617307810,
       "created_at": "2024-02-23T17:44:00-05:00",
       "updated_at": "2024-03-18T11:29:08-04:00",
       "published_scope": "web",
       "status": "draft"
   }
}

 

 

2. Here's the PUT request where I was successfully able to update both the status and published_scope fields without specifying the published_at field at the same time, to clarify that field as well published_at is automatically updated when the product status changes.

 

Request

PUT /admin/api/2024-01/products/8189617307810.json 

Request Body

{"product":{"id":8189617307810,"status":"active", "published_scope":"global"}}

Response

{
   "product": {
       "id": 8189617307810,
       ...
       "updated_at": "2024-03-18T11:32:31-04:00",
       "published_at": "2024-03-18T11:32:31-04:00",
       ...
       "published_scope": "global",
       ...
       "status": "active",

       ...

   }

}

Since we're not able to replicate this behaviour on our end to be able to help you further we'd like to ask if you can reach out to our Support Team via our Shopify Help Center with some specific examples of this behaviour occurring including the following details, and we can definitely help take a closer look:

 

  • A recent example of this issue occurring on a currently supported api version (2023-04 to 2024-04)
    • including timestamp (within the last 14 days)
    • full HTTP request and response, both URL, Body, and Headers (don't include private keys or tokens)
  • A link to the affected product in your admin
  • The App that you are running the queries from

If you are still able to replicate this behaviour, please let our support team know with the following information above and we can absolutely help look into the specific cases further!

 

I hope this helps and I you have a great day 🙂

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog