Re: Product.status not always populated

Product.status not always populated

ClementBR
Shopify Partner
161 2 48

We are using the 2020-10 REST API and have come across products which don't have a status field.

For an example please see X-Request-Id: 99bef7fd-09ed-4238-b4dc-7c44cf0d8f6f and screenshot below:

             ClementBR_0-1613554395494.png

That's a bug right? It seems like the status field hasn't been populated on all fields. Can we assume that the status is 'active' then?

 

Replies 6 (6)

Samuel_Moddapps
Tourist
16 0 3

We are also seeing this. It was only recently that we could see the status in the api at all.

I don't think you can assume it is 'active' if not present, I just set a product to 'archived' on our dev shop and still don't get the status in the response.

Gregarican
Shopify Partner
1033 86 292

Was able to replicate this as well. Below are two screen shots, one a REST API request hitting the default "current" REST API version's endpoint. And another a GraphQL API request hitting the 2020-10 API version's endpoint. REST API doesn't include status, while I can specifically retrieve the status property for the same product.

rest.pnggql.png

Josh
Shopify Staff
1134 84 235

Hey folks, 

@ClementBR reached out to me and we looked into this and realized these are cached responses from the Product API where your apps would have used older API versions.

There are a few options available here to fix the products: 

- Patience for the cache to clear, and use a newer API version for all future calls so it doesn't happen again (no set timeframe for the cache expiry)

- Update a product with a 'blank' change to break the cache if you have access (a space in a product title generally works)

- Use GraphQL for your API calls, responses are not cached with GraphQL which is why you saw what you did @Gregarican 

At any rate, once older API versions have been deprecated and are no longer in use this will no longer be able to happen as well. 

Josh | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

Samuel_Moddapps
Tourist
16 0 3

Hi Josh,

I don't know if this is the whole story.

We have pulled products on one of our dev shops and last week we saw status on some of our products, but pulling earlier this week we saw fewer products with status, and today I don't see any products.

We have tried with multiple api versions and even api keys in all cases, by default we are currently on 2020-07, and outside trying last week we would not have used the other api versions in a while, so those responses probably would not have been cached.

Updating products or swapping to a newer api does not seem to push the status through to the response. 

This is quite frustrating as status is something exposed to merchants via the admin panel, but we don't have access to it, so when merchants ask if they can action on it, we have to tell them we just don't have access as GraphQL is not something we have integrated.

syf_
Shopify Staff
95 21 25

Hi @Samuel_Moddapps,

The Product status field was added for the API version 2020-10 release according to this changelog. If you're using the 2020-07 version of the API, I believe this field would not be available in the response data returned and that's consistent with what you're experiencing. I would recommend using the latest supported version of our APIs in this case.

There might still be the issue of caching if you do bump your API version up as Josh explained in his post.

Hopefully this helps in clarifying this issue for you.

Best,
Seth.

syf_ | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me 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

nickippolito
Shopify Partner
5 0 3

Hi @Josh ,

I’m having this same problem all of a sudden.  I've been developing a Store for a client and building a recommended products area in the Cart Drawer on my site with Javascript. I was fetching the recommended products fine until the other day now they are not fetching and are all blank.  See example of url below for the product_id: 7404559237307 

 

For an examplehttps://coastwoodfurniture.myshopify.com/recommendations/products.json?product_id=7404559237307

Password: Coastwood

 

Can someone help me find out why this api is not working that would be awesome! I’ve exhausted all my options.