Hey everyone,
I came across this post on the Shopify Community where a merchant mentioned that customers weren’t able to add products to their cart.
When I looked into it, I saw they were using the /cart/update.js
endpoint to add products, and it was returning a 422 error from Shopify’s Cart AJAX API mentioning that the product is sold out
.
I checked the product JSON using the /products/{handle}.js
endpoint, and here’s what I found (screenshot below):
- The product is clearly visible on the storefront and marked as available.
- I’m using the correct variant ID in the API call.
- The variant is marked as available: true, with a positive inventory count.
- Both the product and the variant are published to the Online Store channel.
I tried changing the api to add.js
but still faced the same issue.
That caught my attention, so I decided to dig deeper into the issue and reached out to Shopify support about this, but they said they couldn’t assist further and suggested hiring a Shopify developer instead.
The reason this stood out to me is because I am a Shopify developer, and this is the first time I’ve come across something like this. Given that the API call is correctly structured and the product is in stock and live on the store, this kind of error shouldn’t really happen — yet it is.
So I’m hoping someone here has encountered this before?
Would love to hear your thoughts or suggestions.
Thanks in advance!