Remove out of stock item from cart

msaspence
Tourist
3 0 2

If I add an item to my cart and then it subsequently goes out of stock the API returns a 422 when trying to remove it from my cart.

I POST to `/cart/change.js` and try and set the quantity to 0 and it returns 422:

{
"status": 422,
"message": "Cart Error",
"description": "The product 'xxx' is already sold out."
}

 

Reply 1 (1)
sillycube
Shopify Partner
693 16 100

Just use POST /cart/update.js: https://shopify.dev/api/ajax/reference/cart#post-cart-update-js

BYOB - Build Your Own Bundles, SPO - SEO App to research keywords & edit social link preview