Skip to main content
All CollectionsInventory Management
Advanced stock rule configuration
Advanced stock rule configuration

Developer / advanced user configuration instructions for stock rules.

Updated over 6 months ago

Advanced users / developers only!

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.

Stock Rule Variables

free: Net available stock (on_hand - reserved).
on_hand: Current physical stock.
reserved: Stock reserved for open orders.
fba: FBA inventory.
skip: Do not push quantities to this listing.
store_default: Use the store's configured stock rule.

Stock Rule Functions

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)

Incoming inventory from Purchase Orders

Include incoming inventory from POs due within a set number of days. The number of days due can be adjusted higher or lower as desired. This example rule includes incoming stock from POs due within the next 30 days:

free + incoming_due_by(30)

Divide across listings (Premium and Enterprise plans only)

Split stock levels across multiple listings. Prevents advertising 100% of stock for items listed multiple times. Note: This function is typically applied to a store's stock rule. If only targeting a single item to divide stock, then apply the rule to each listing linked to that item.

Structure:

divide_across_listings(stock_rule, num_unique_listings, multiplier, fixed_reserve)

  • stock_rule: Any regular stock rule

  • fixed_reserve: An additional fixed reserve constant (e.g. "10" will reserve 10 extra units).

  • num_unique_listings: The number of active listings linked to an item/kit. Can be a constant or literal "num_unique_listings" to use the current number of listings. (e.g. if constant 3 is provided, the available quantity would be divided 3 ways).

  • multiplier: Allows inflating or deflating by desired factor. (e.g. 0.80 multiplier advertises 80% of the calculated amount).

Basic usage:

divide_across_listings(free, num_unique_listings)

Advanced usage:

divide_across_listings(free, num_unique_listings, 0.90, 5)

  • Uses calculated free quantity

  • Hold 5 units of additional reserve

  • Divides automatically across active number of listings

  • Advertises only 90% of available stock

Did this answer your question?