How to set inventory quantity when 'Continue selling when out of stock' is enabled?

Hello :waving_hand:

I found this documentation https://shopify.dev/docs/api/admin-graphql/2024-07/mutations/productvariantupdate?language=Node.js .The mutation allows enabling the Continue selling when out of stock (inventoryPolicy) functionality, but how do I set the quantity? I want to set, how much can be sold items when it’s out of stock.

I don’t think you can do that natively. If you’re telling Shopify to “continue selling when out of stock” it will sell an infinite amount.

If you want to only sell X units, untick “continue selling” and just set the stock level to X. And then when it sells out, it’ll actually be sold out and stop selling.