This option is only available for WooCommerce License Keys (extended) premium plugin.
This plugin allows you to, optionally, add or import your own custom license key codes if you don’t wish these to be generated automatically.
Custom license key codes will become the stock and availability of a product.
Configure a product or variation
Check the license key option labeled as “Do not auto-generate codes” to disable automatic code generation and enable stock management through custom license keys.

When this option is checked, buttons will appear below it, allowing easy access to custom license keys management actions (read about the management page).
Stock management
The stock will be calculated based on the amount of unassigned (not associated with an order / purchased) custom license keys with no product restriction, or those restricted to the product in relation.
Same as regular stock management, depending on the WooCommerce settings, the stock information will appear on the product page if configured.

Cart and checkout restrictions
Products with low or no stock (depending on the quantity selected) will not be added to the cart, updated in the cart or will prompt an error during checkout.