less than a minute read • Updated 8 minutes ago
Inventory Management Overview
How Foxy's webhooks and cart events work together to help you track product inventory, since Foxy doesn't manage your product catalog directly.
Foxy doesn’t manage your products for you — products are defined as links and forms on your own website, which send the product details to the cart. Because Foxy doesn’t maintain your product catalog, it also doesn’t track your inventory levels automatically. That said, there are several features you can combine to track and enforce inventory levels for your store.
How inventory tracking works in Foxy
You’ll need somewhere outside of Foxy to store and update inventory levels — this could be a text file, a database, or a CMS. You’ll also want a unique identifier for each product so you can match it back to the correct inventory record after a transaction. We recommend using the code attribute for this, though any custom product attribute will work.
From there, Foxy gives you a few levels of control, depending on how tightly you need to manage stock:
Basic tracking uses the transaction webhook to update your inventory records after each completed sale, combined with the
quantity_maxproduct attribute to prevent a customer from ordering more than what’s available. This works well for stores with low transaction volume, where the odds of two customers checking out for the same item at the same time are low.Intermediate tracking adds two safeguards on top of the basics: expiring products out of the cart after a set amount of time, and confirming stock is still available right before the customer pays, using the pre-payment webhook.
Advanced tracking is for stores that can’t afford to oversell, such as one-off items or limited event tickets. It involves setting up temporary inventory locks tied to what’s currently in customers’ carts, using Foxy’s cart JavaScript events alongside the webhooks above.
Notes
None of these approaches require Foxy to store or manage your inventory data — Foxy only provides the hooks (webhooks and JavaScript events) needed to keep your own system in sync.
The right level of tracking depends on your transaction volume and how costly overselling would be for your store.