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.
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?
Hey, i just solved this, same problem. It gives this error because i’ve tried to make request with product.id, shopify expects variant id’s like this kind of api requests. For examaple product.variants[0].id, this was my problem and variant id fixed it, i hope it fixes yours too.
Note: i see you mentioned about variant id’s, but it gives same error if variant id is wrong too, thats why i wanted to point out.
Hi Rajasekar, I just wanted to chime in and say we are observing this same issue and your observations are consistent with what we are seeing. Up to about a month ago we were able to dynamically create products without this problem. We are currently using the delay technique.