So you were not encountering the 422 error at all before for newly created variants? Are you able to check how long it takes before the products can be added to cart now?
So previously we were not getting the 422 error at all for newly created variants. Everything worked smoothly without breaking. But now, we’re encountering the error, and it sometimes takes 1-4 seconds for products to be added to the cart.
Is there a solution for this or a timeline for when we can expect a fix? Also, is there a way to detect if a product is ready to be added to the cart? @paige-shopify
That’s interesting! I wasn’t aware we had shops that could create variants on the fly and add them to cart immediately without encountering a 422 error. Typically there’s a delay of one or more seconds. What kind of mutation are you using to make them?
Regarding if there is a way to check whether a product is ready to be added to cart, there isn’t one at this time. Only way to confirm is a successful (non-422 response) add to cart request.
I was using the productDuplicate mutation.
Reference:
Please read this again. We have been facing this issue since the first week of February. Your support has not been satisfactory, and the responses feel like automated bot replies. I’m not sure whether our context is actually being read or understood. This has been a very disappointing support experience.
We are experiencing the same issue, dynamically created variants are not available when the cart is loaded. This happened a while ago and the problem returned Wednesday, March 4th.
It seemed to be resolved after about 24 hours, when everything started working again, but now we see this problem happening depending on the customers location. I verified this with a VPN. Sessions from the US can not add to cart, session form Germany work flawlessly.
-
Is this a known limitation of adding newly created variants to cart via Ajax?
Yes, this is a known limitation. Preparing a variant for the cart does take some time to process. -
Is there a supported way to detect when a variant becomes cart-ready?
Please see the responses to your questions below:
- Intermittent 422 error when adding newly created variant to cart via /cart/add.js - #24 by Paige-Shopify
- Intermittent 422 error when adding newly created variant to cart via /cart/add.js - #16 by Paige-Shopify
Thanks for sharing context on the expected behavior. That may be where our miscommunication lies. The expected behavior is not how our cart and inventory system currently functions. I agree that one way to address this would be to provide a deterministic way to know when a variant is ready to be added to cart, but we don’t currently have plans to introduce that. However, I can certainly submit this as a feature request on our end.
Can anyone affected by this issue share a request ID for a 422 response from the AJAX Cart API?
There’s always been an inconsistent delay of 1s, 4s, 6s, etc. I’m looking to investigate whether shops are seeing this more frequently or experiencing longer delays than before. That way I can see if there’s a degradation with the cart or how we prepare inventory.
Is it possible to check the commits from the end of January? It was working fine then. We’ve been using this for almost two years without any issues, but since the beginning of February we’ve started facing this problem. If possible, could you please roll back to that version?
Here is a request ID for reference: 8da53482-2621-4c98-b6f1-793956fd287a-1773055881.
I assume you’re able to trace the corresponding line items and payload using this ID.
However, I would disagree with the point about this being an existing inconsistent delay. In my experience, there were never delays when adding a newly created variant to the cart before. This behavior seems to have been introduced recently, which is also reflected by multiple people reporting the same issue now.
Previously, there was no 422 error when adding new product variants to the cart.
However, in our experience, if we directed to the cart immediately, there would be a blank state product with no title or image and a price of $0.0. This is definitely not ideal for the customer, so to avoid this, we would wait until the product variant was available in the product via the Ajax Product JavaScript query.
This was more common with non-US-based stores, so our thinking was that the CDN took longer to populate overseas servers.
Our approach has been working until a few weeks ago, and now, even when the product variant appears in the Ajax Product query, we still get a 422 error.
Thanks for sharing all this context, everyone. I’m digging into this and will provide an update when I have more to share.
We have exactly the same problem too. We also wait for the variant to appear, but even after the confirmation of the variant, the cart can not be loaded.
Initially we thought that this happens more to US customers than to European customers, but we have now quantified this issue and have a clear picture. We are using a VPN to automatically add a product to the cart every 15 minutes from 26 locations all over the world. We plot all this data and can clearly see that there are times when nearly the whole world if affected for a few hours and at times only some locations are affected for a short time.
This is the list of the individual VPN endpoints where the test results have different colors:
And this is the same data plotted with the end-points on the Y-axis and the time on the X-axis:
Purple is the cart error, where the variant could not be found. Vertical lines in this plot mean worldwide problems (which seem to happen often), horizontal lines mean that a certain location fails repeatedly (which we have not observed yet).
I think this is a test that Shopify server-operators should run itself to monitor their infrastructure. If you Shopify Guys @Paige-Shopify are interested in it, please contact me.
Any update on this? Its been 3 days we haven’t heard back from you guys!
Someone from Shopify support wrote a very long AI generated text to me, but basically only said that everything is fine with Shopify, there are no problems. If we experience any problems, than we are doing something wrong, as the server infrastructure of Shopify is perfectly fine…. What a joke…
Meanwhile we can see a change in the observed problems. In my last post I clearly showed that there are times when all of Shopify’s servers worldwide suffer from propagation problems, but the problems come and go in a random pattern, there are no clear times anymore when it happens and it happens evenly on all servers.
We now also monitor if the price in the cart is correct and we can clearly see that servers in the US (where we sell in USD instead of Euro) report wrong prices in more than 50% of the cases.
Even though we set USD and a Euro price upon creation of the variant, Shopify calculates their own USD price in these cases and gives it a higher priority than the USD price we use during creation of the variant.
Hi all, just wanted to provide an update:
- I’m still investigating this issue with the developers of the Cart API.
- 422 errors have always existed as the process involves making product data on one system available on another (this is mostly evident on shops that only sell customized products). We haven’t made any changes to this.
- Based on the feedback here, we’ll look into infrastructure as well.
Hi, do you have any updated on this?
I wanted to follow up regarding the request ID: 8da53482-2621-4c98-b6f1-793956fd287a-1773055881. It’s been over 10 days since we last heard from you. Despite providing the request ID, I was wondering if there have been any updates or if you’ve been able to investigate the issue.
Looking forward to your response.
Are you still seeing errors at the same frequency?
Hey,
Yes, I’m still facing the same error. Here’s the x-request-id: f445ea56-ba9b-4513-a897-7c6b314eea60-1774614376 for you to review.
Thanks!


