Product.status not always populated

ClementBR
Shopify Partner
114 2 22

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?

 

0 Likes
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.

0 Likes
Greg_Kujawa
Shopify Partner
1016 83 220

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

0 Likes
Josh
Shopify Staff
Shopify Staff
1131 82 191

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 @Greg_Kujawa 

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. 

0 Likes
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
Shopify Staff
81 18 14

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

0 Likes