# Inventory stock level rules

> Create, edit, switch on and test stock level rules that change a product's stock status when its quantity crosses a threshold.

Source: https://docs.vestislabs.com/inventory/inventory-stock-level-rules/

**Stock Level Rules** are rules that trigger based on inventory quantities. Each rule says when a stock quantity counts as low, out of stock, in stock or overstock, and can send a notification. You can set rules for individual SKUs or for whole styles.

**Where to find it:** Inventory → Rules & Automation → Stock Level Rules
**Requires:** permission `UPDATE_STYLE_INVENTORY`

## Choose SKU level or style level

At the top of the page, select a tab:

- **SKU Level Rules**: the **Select Product** list contains each size and colour of a style, for example one entry per SKU.
- **Style Level Rules**: the **Select Product** list contains styles, with quantities added up across their variants.

Each tab has its own rules. The steps below are the same for both.

## Create a rule

1. **Click "Create New Rule"**
   Click **Create New Rule** at the top of the **Stock Level Rules** card. If you have no rules yet, you can click **Create Your First Stock Level Rule** instead.

   ![The Create New Rule dialog with the Rule Name, Apply To, Condition and Action fields](https://docs.vestislabs.com/assets/inventory/assets/inventory-stock-level-rules/62-create-rule.webp)

2. **Enter the rule name**
   In **Rule Name**, type a name, for example **Basic Low Stock Alert**. This field is required.

3. **Choose what the rule applies to**
   In **Apply To**, select **All Products**, **Specific Category** or **Specific Product**. For a category or product, also pick it in **Select Category** or **Select Product**.

   ![The Apply To list with All Products, Specific Category and Specific Product](https://docs.vestislabs.com/assets/inventory/assets/inventory-stock-level-rules/63-apply-to.webp)

4. **Set the condition**
   In **Condition**, select **Stock is less than or equal to**, **Stock equals exactly**, **Stock is greater than or equal to** or **Stock is between**.

5. **Enter the value**
   Type the **Threshold Value**. For **Stock is between**, type a **Minimum Value** and a **Maximum Value** instead. The values must be positive numbers, and the maximum must be greater than the minimum.

   ![The Condition list with the four ways to compare stock, above the Threshold Value](https://docs.vestislabs.com/assets/inventory/assets/inventory-stock-level-rules/64-condition.webp)

6. **Choose the action**
   In **Action**, select **Mark as Low Stock**, **Mark as Out of Stock**, **Mark as In Stock** or **Mark as Overstock**.

7. **Turn on notifications (optional)**
   Check **Send notification when rule is triggered**.

8. **Limit the rule to a date range (optional)**
   Check **Set date range for rule activation (optional)**, then choose a **Start Date** and an **End Date**. The rule is only active between those dates. Click **Clear** to remove a date.

   ![The rule form with Set date range for rule activation checked, showing the Start Date and End Date](https://docs.vestislabs.com/assets/inventory/assets/inventory-stock-level-rules/65-date-range.webp)

9. **Click "Create Rule"**
   Click **Create Rule**. Click **Cancel** to close without saving.

The rule appears under **Your Stock Level Rules**.

## Manage your rules

Each rule card shows its name, what it applies to, its **Condition**, **Action**, **Notification** (**Send notification** or **No notification**) and, if set, its **Active Date Range**. A green border and tick mean the rule is on and currently valid.

- Use the switch on the card to turn the rule on or off.
- Click the pencil icon to open **Edit Rule** (**Update the details of your existing rule.**), then click **Save Changes**.
- Click the bin icon to delete the rule. **Delete Rule** asks you to confirm, and the rule is removed when you click **Delete**.
- Click **Show affected products** to see each product's **Current Stock** and **Status**, with **Rule Triggered** or **Not Triggered**.

## Test your rules

**Rule Testing** (**Test how your rules will behave**) lets you check your rules before relying on them.

1. **Enter a quantity**
   In **Test Stock Quantity**, type a stock quantity, for example 8.

2. **Click "Test"**
   Click **Test**. The result lists each rule that would be triggered and its action, or shows **No rules triggered**.

   ![The Rule Testing card with a stock quantity of 8 entered and the rule that is triggered](https://docs.vestislabs.com/assets/inventory/assets/inventory-stock-level-rules/67-test.webp)

> [!NOTE]
> The test only compares the quantity you type with your rules. It does not change any stock.
