Based on the documentation if my request payload is trying to add more than the available quantity then it would add the available amount and return the following response
{
"status": 422,
"message": "Cart Error",
"description": "You can't add more #{item.name} to the cart."
}
The issue is that when I do exactly that, nothing gets added to the cart, just the error response is received. Is that the expected behavior?
That’s weird, and interesting. As fair as I’m aware, this has always been the case. Was not aware of the mismatch with documentation.
Looking forward to see an explanation.
I have just tested using the following example, from the documentation, on a variant ID with exactly 50 in stock. Tracking inventory and dont have continue policy. I get the same error as you.
Hey Taylor, thanks for your reply. I had seen the changelog and my confusion is that the current response is the same for both scenarios, when I do or do not have the item in the cart already.
What is missing is the documented behavior that if the item is not in the cart, the call would automatically add the remaining amount then respond with the 422 code but it doesn’t