This topic and discussion board has been closed.
To stay updated on announcements related to the API please review this post about the new Developer changelog.
In 30 days, inventory levels will no longer be returned by the public product.json that's available on the storefront of newly created shops. If you want to consume inventory information about a product, you'll have to auth with the store first. This is a part of our effort to eliminate bots and crawlers from knowing inventory levels of products from stores that they haven't explicitly been granted access to.
The inventory quantity will still be available through liquid, and won't affect any themes on our theme store.
Feel free to post questions here, and I'll be happy to answer.
Shayne | Developer Advocate @ 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
Hi Shayne,
I understand the desire to prevent crawlers gathering data. However, I have two concerns about this announcement:
1. We use the ScriptTag API to load a widget on the product page which then fetches inventory levels using the product.json API. This avoids having to edit theme templates. It sounds like this is no longer supported and we will now need to have store owners paste Liquid code into templates themselves?
2. The 30 day window is rather short to be able to implement, test, and rollout any possible workaround. Plus, it means the the change will take affect on December 17. This a very busy time of year for rmany stores and doesn't seem like the best time to push out a breaking API change.
I'd be interested to hear your thoughts on the above.
Cheers,
Matt
Shayne,
30 days is very tight during this time of year. If we manage multiple assets that use this feature differently, we're in big trouble with holidays coming up:
We definitely need more time for this. Please consider extending the timeline.
Best,
joshie
Would you guys consider adding in an `availability` field?
Wouldn't this also affect OptionSelectors?
I believe OptionSelectors renders the product data as JSON using the Liqiud product variable so don't think it will be affected.
Sidenote: a lot of stores use OptionSelectors so I'd expect crawlers will just start harvesting that data instead.
Hey everyone,
Thanks for your feedback. The 30 day deprecation date will be for new shops only. Existing stores will continue to have the inventory_quantity available through their product.json. Shops created after the deprecation will not have this attribute available.
Shayne | Developer Advocate @ 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
We call product.json through the API. Will this be affected?
I'm thinking not, because all our shops authorize the app, but want confirmation. Thanks
Shayne,
How can one still be able to tell if a product is available or not, from public .json?
(similar to liquid {{product.available}})
Thanks!
Shayne,
How can we tell if a product variant is available or not, from public .json?
(similar to liquid {{product.available}})
Previously, we were checking inventory_quantity, in case inventory_managed == 'shopify'.
This is a critical feature for Upsell apps.
Thanks
Shayne,
I just spent a good deal of time trying to figure out why my theme was not working on a new store before finding this post. I am not happy about this change.
If you remove the inventory levels you should at the very least replace it with an available attribute to be consistant with the liquid product json. Better yet, you should give the store owner control over this behavior instead of deciding you know what is best for them. You could always make the default to suppress the inventory information. My stores makes heavy use of product.json through ajax requests in order to overcome the limitations of Shopify and I do not have a concern about bots collecting inventory levels.
I am amost afraid to post this incase you decide to "fix" this as well, but it looks like we can work around the lack of the available attribute on the public product.json by creating a collection for each product and using the public:
collections/{{collection-handle}}/products.json
The output includes the available attribute.
If I am an older store how do I get the newer JSON? I don't want inventory levels showing up.
thanks
Thanks to all Community members that participated in our inaugural 2 week AMA on the new E...
By Jacqui Mar 10, 2023Upskill and stand out with the new Shopify Foundations Certification program
By SarahF_Shopify Mar 6, 2023One of the key components to running a successful online business is having clear and co...
By Ollie Mar 6, 2023