StockManager’s inventory module is the central hub for your product catalog. Every item in the system carries a barcode, a set of numeric limits, and a lifecycle status that controls whether it appears in sales flows. From the moment a product is added, the system tracks its quantity against a configurable minimum threshold and flags items that are running low or approaching their expiration date — giving you actionable signals before stock problems affect your customers.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/InnoDev69/StockManager/llms.txt
Use this file to discover all available pages before exploring further.
Product fields
Each product stored in StockManager has the following fields. Character and value limits are enforced at the API layer before any data reaches the database.| Field | Type | Limit | Required |
|---|---|---|---|
name | string | max 25 characters | ✅ |
barcode | string | max 20 characters | ✅ |
description | string | max 200 characters | ❌ |
quantity | integer | 0 – 10,000 | ✅ |
min_quantity | integer | 0 – 1,000 | ✅ |
price | float | 0 – 1,000,000 | ✅ |
expiration_date | string (YYYY-MM-DD) | max 10 characters | ❌ |
status | integer | 1 = active, 0 = disabled | ✅ |
barcode is used as the lookup key during sales registration. If you leave it blank during a CSV import, the system auto-generates a code in the format PRD000001.
Soft-delete pattern
Deleting a product in StockManager does not remove it from the database.
DELETE /api/products/<id> sets status = 0, hiding the item from all active views and preventing it from appearing in new sales. Historical sale records that reference the product are preserved. To reverse the action, send POST /api/products/<id>/activate, which sets status = 1 and makes the product available again.View modes
TheGET /api/products_all endpoint accepts a view_mode query parameter that filters the result set server-side:
view_mode value | Filter applied |
|---|---|
all (default) | All products regardless of quantity |
in_stock | quantity > min_quantity |
low_stock | quantity > 0 AND quantity <= min_quantity |
out_of_stock | quantity = 0 |
in_stock for your day-to-day product browser and low_stock / out_of_stock for replenishment workflows.
Sorting and pagination
Results can be ordered by any of three fields, in either direction:- Sort fields:
name,stock,price - Order:
asc(default) ordesc
page (1-based) and limit (max 250, default 50) to step through large catalogs efficiently. The response always includes total, pages, page, and limit so your UI can render accurate page controls.
Stock alert system
Every time a product is created or updated,check_and_notify_low_stock runs automatically. It compares each active product’s quantity against its min_quantity:
- If
quantity < min_quantityand no alert has been sent yet, awarningnotification is created for the current user and pushed over the SSE stream. - The
notified_low_stockflag is set to1so the same alert is not repeated on every subsequent save. - Once the product is restocked and
quantity >= min_quantity, the flag resets to0, re-arming the alert for the next time stock drops.
GET /api/stats) returns the low_stock count and low_stock_list (up to 10 products where quantity <= min_quantity, sorted by quantity ascending) so you can see the situation at a glance.
Expiration tracking
Products with anexpiration_date set are monitored continuously. The dashboard stats endpoint (GET /api/stats) returns expire_soon, a count of products whose expiration_date is on or before 7 days from today — this includes items that are already past their expiration date and products of any status. Use this figure to drive first-expiry-first-out workflows or to create manual notifications for your team.