Adding out-of-stock items to cart and checking out does not throw error on server - How to handle inventory levels? #352
Unanswered
tannergaucher
asked this question in
Help
Replies: 1 comment
-
Hi @tannergaucher! Great question. Mind dropping that into https://github.com/Shopify/storefront-api-feedback/discussions as it seems to be a Storefront API question related to our new Cart API? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Greetings!
I noticed that I can add a product to my cart and checkout where the
selectedVariant
object has values ofcurrentlyNotInStock: true
andquantityAvailable: 0
Currently I'm disabling buttons on the client based on the
currentlyNotInStock
boolean, but obviously the situation requires more than a client-only solution, as in a high-volume scenario stock levels have likely changed since I loaded the page.Does Shopify really not handle product inventory levels server-side? I expected the
cartLineAdd
mutation to not send a 200 response on an out-of-stock product. And the same for checking out.What's the correct way to ensure that we are not allowing customers to purchase items that are not in stock?
Beta Was this translation helpful? Give feedback.
All reactions