Bug: Fulfillable inventory calculation issue in functions

My team is requesting an API that enables customizing the fulfillable inventory calculation logic for ProductVariant objects across all sales channels. This would allow merchants to implement complex inventory management strategies while maintaining consistent inventory representation across sales channels, addressing the current disconnect between OMS Functions and inventory display logic.

The core issue

Shopify’s current inventory architecture calculates available inventory using native backend logic that cannot be customized. While the fulfillment constraint functions API allows excluding locations during fulfillment routing, this exclusion only applies at checkout—not during inventory display queries.

Specific pain points

  1. Inventory display vs checkout discrepancy: When using fulfillment constraint functions to exclude locations based on business logic (safety stock, daily capacity limits), the fulfillable inventory displayed on product pages, Storefront API responses, and sales channel listings doesn’t reflect these exclusions. Customers see products as “available” but encounter checkout failures when routing functions exclude relevant locations.

  2. Limited sales channel propagation: Current workarounds using metafields or custom calculations only affect the Online Store channel through Liquid templating but don’t propagate to Facebook Shop, TikTok Shop, Google Shopping, or other sales channels, creating inconsistent availability across channels.

  3. Lack of granular inventory control: Merchants cannot implement sophisticated strategies like:

  • Dynamic safety stock patterns
  • Channel-specific inventory allocation rules
  • Customer based availability (B2B vs B2C)
1 Like

Hey @blanklob :waving_hand: thanks for sharing your use case here.

You’re right that fulfillment constraint functions currently only apply during checkout and don’t affect the inventory display calculations that power the sellableOnlineQuantity field across sales channels. so I definitely understand where you’re coming from here when it comes to limitations.

We don’t currently have an API or other functionality to customize the inventory calculation logic as this is primarily done on our end, I can recommend a workaround using a combination of inventory state management (using reserved, safety_stock states) and fulfillment constraints to achieve some of your goals. though.

You might want to consider using our inventory adjustment APIs to programmatically manage inventory based on your business rules, effectively creating your own safety stock patterns, though this would have to be managed on your app’s backend and would still be pre-empted by our internal logic, but I did want to suggest this as something to look into if it works for you.

I really appreciate your feedback here, and I’ll be submitting a feature request on your behalf for something like an “Inventory Calculation Function” that would allow folks to customize how available inventory is calculated and displayed across all channels. I definitely agree this would be useful.

Hope this helps a bit - let me know if I can help out further. :slight_smile: