Skip to content
Knowledge ERP Docs
API Reference ↗
Inventory

Expiring Stock

A report and automation trigger that surface held inventory units approaching (or past) their expiration date, so perishable or dated stock is used or pulled before it's wasted.

Inventory units can carry an expiration date (and an optional lot number). Knowledge ERP surfaces the ones running out of shelf life so you can use, sell, or pull them before they're wasted — both as a report you can scan and as an automation trigger that can notify the right people on its own.

What counts as "expiring" #

The expiring-stock view considers a unit only when all of these hold:

  • it has an expiration date,
  • it still has quantity remaining, and
  • it is in a held status — In Stock, Checked Out, On Hold, or In Transit. Depleted (Out of Stock) and Discontinued units are ignored.

Already-expired units are included — they're the most urgent — and the list is ordered soonest-to-expire first.

The Expiring Stock report #

Open Inventory → Reorder Queue → Expiring Stock. The table lists each qualifying unit with its name, Product, location, lot number, expiration date, days until expiry (shown as Expired in red once past, amber within two weeks), and quantity remaining.

A single filter, Expiring within, sets the look-ahead window — 7, 14, 30 (default), 60, 90, 180 days, or a year. The report respects your active location filter, and an Export CSV action downloads exactly what's shown.

Alerting automatically #

Pair the data with an automation rule using the Inventory: Stock nearing expiration trigger. The rule carries its own Days before expiry setting, so different rules can watch different lead times (e.g. notify the floor 14 days out, and a manager 60 days out). Every matching unit fires the rule's actions — send an email or in-app notification, create a task, and so on — with this context available for conditions and {{templates}}:

  • item_name, inventory_item_uuid
  • sku_uuid, sku_name
  • location_uuid, lot_number
  • expiration_date, days_until_expiry
  • quantity_remaining

The check runs daily as part of the scheduled-automation pass.

Doing it from the API #

Fetch the current expiring-stock list (default 30-day window):

curl "https://your-domain.com/api/v1/inventory/expiring-stock?days=60&location_id=<location-id>" \
  -H "Authorization: Bearer $TOKEN"

Each entry returns id, name, product_id, product_name, location_id, location_name, lot_number, expiration_date, days_until_expiry (negative when already expired), and quantity_remaining_percent. The days window defaults to 30; location_id is optional.