REST API - Product Status

Solved
Markus04xD
Tourist
8 0 4

When getting a list or a single product using REST API, it doesn't return the status field/property for some products? An example below of two different products.

Markus04xD_0-1617673773323.png

Using API version 2021-04

https://shopify.dev/docs/admin-api/rest/reference/products/product?api%5Bversion%5D=2021-04

 

syf_
Shopify Staff
Shopify Staff
86 19 15

This is an accepted solution.

Hi @Markus04xD,

This issue arises as a result of caching on our end. Check out this forum post about a similar behaviour.

Below is a summary of workarounds on this issue:

  1. Use GraphQL for your API call as we don't do any caching on GraphQL
  2. If you have write_products scope, you can force the cache to expire by making a blank update on the product (usually adding a space to the title works).

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

Markus04xD
Tourist
8 0 4

Hi @syf_ ,

 

Thanks, I got it working now. Another workaround is to specify the field directly on the API call. I found that it will always return the "status" field.

godatafeedsteve
Shopify Partner
2 0 1

Actually, we found that status does not always return when using the fields query parameter as well. We have started a new topic for this issue. Maybe it is related to caching as well.

Inconsistent property "status" in GET products response using fields parameter - Shopify Community

0 Likes
Markus04xD
Tourist
8 0 4

It might just be a caching issue then. I haven't had issues returning the status field when specifying fields, around ~15K products. 

Using ShopifySharp library: https://github.com/nozzlegear/ShopifySharp

0 Likes