Hi Shopify Team,
We are currently working with Shopify Functions (such as Cart & Checkout Validation, Cart Transform, and Discount Functions).
Our use case requires us to check the product inventory count in order to apply certain rules or restrictions. However, we are unable to find a way to directly access inventory data inside these functions.
Some questions we have:
-
Is inventory information (like available stock quantity) exposed to functions?
-
If not, what’s the recommended approach to validate inventory before applying discounts or custom validations?
-
Do we need to fetch this information via Admin API/Storefront API separately, or is there a way to include it in the Function input?
Any guidance or best practices around this would be really helpful.
Thanks!