Inconsistent property "status" in GET products response using fields parameter

Solved
godatafeedsteve
Shopify Partner
2 0 1

The details of the issue:

We are requesting the "status" field in the GET products REST endpoint, however we are not consistently getting the “status” property back for every product sku.

For example: https://{mystore}.myshopify.com/admin/api/2021-04/products.json?fields=id,title,status,published_at,...

Once we get the all pages using the pagination cursor, the end result shows many products without this "status" property at all. Our results show that only 10,624 products have a value for status out of 19,179 total products. We don't see any pattern as we see status values for draft, active, and archived for products. 

Why would the status property not be returned in a product object in the GET products response, especially if we are specifically requesting the status property using the fields parameter?

What developer tools are you using?

Postman for manual testing and proprietary app to get all pages programmatically

What documentation are you following?

https://shopify.dev/docs/admin-api/rest/reference/products/product#index-2021-04

Which programming language are you using?

.NET, C#

What has been tried to remedy the situation so far? What troubleshooting steps have you taken?

Using the GET /admin/api/2021-04/products.json request, we don’t get back status unless the product is active. When we use the "fields" query parameter and specify status as well as the other attributes we want, then we see inconsistency where the status property is not always present for all products in the json response.

What's the intended behavior you are expecting?

We expect to find a status property and corresponding value for all products when requesting status in the fields query parameter like this: https://{mystore}.myshopify.com/admin/api/2021-04/products.json?fields=id,title,status,published_at,...

 

szb
New Member
1 0 0

We have the same problem on our store! Some products are just returned without status. We have tried to change the state of some products and save them, then revert the state and save. It helped for some limited time. After a few days other products are also missing the status. This is very problematic since we cannot know what products are archived and which are active.

0 Likes
syf_
Shopify Staff
Shopify Staff
86 19 15

This is an accepted solution.

Hi,

This issue is a result of caching and has been mentioned a few times on the forums (here and here). Some workarounds have been suggested in those posts. My personal recommendation would be to use GraphQL.

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