Introduction

If you're a developer and want to make a custom stock rule without customer support, this article will help you achieve that goal. Otherwise, please refer to these articles instead.

How are stock rules processed?

Rules are evaluated using a strict subset of javascript.

What variables can I use in a stock rule and how are they parsed?

Stock Rule Variables
free
 - On hand minus reserved inventory.
on_hand
- Inventory physically on the shelf in the warehouse.
reserved
 - Inventory held for unshipped orders
fba
 - FBA inventory.
skip
 - Skip this item, do not push quantities for it.
store_default
- Use the store's stock rule configurable in settings.

What functions are available in a stock rule and how are they parsed?

If you're a developer and want to make a custom stock rule without customer support,
here are the functions you can use. Rules are evaluated using a strict subset of javascript.

No more than - Never advertise more than this much inventory as available. Great to fight competitor's repricing tools or to stay under eBay's item limit. Note: This will toggle between being a unit off to ensure stock sync sees a valid change in stock to push regularly.

no_more_than(free, 10)

No less than - Never advertise LESS than this much inventory as available. Directly permit overselling. Note: This will toggle between being a unit off to ensure stock sync sees a valid change in stock to push regularly.

no_less_than(free, 100)

Snapping - Starting with the "start" value only provide rough figures for actual availability. e.g. 50, 100, 200, 400, 1000, 2000, 10000, 20000.

snapping(free, 50)
Did this answer your question?