Remove out of stock item from cart

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)

jam_chan
Shopify Partner
920 23 188

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