The Products API gives you full control over StockManager’s item catalog. You can retrieve paginated and filtered product lists, look up individual items, create new entries, make partial updates, soft-delete records by disabling them, and bring them back with the activate endpoint. All routes require an active session; write operations additionally require theDocumentation 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.
admin or root role.
GET /api/products_all
Returns a paginated list of all products in the inventory, including disabled ones (status = 0). Designed for inventory management screens where administrators need visibility over the full catalog.
Full-text search applied simultaneously to
name, barcode, and description fields.Stock-level filter. Accepted values:
all · in_stock (quantity > min_stock) · low_stock (quantity > 0 and quantity ≤ min_stock) · out_of_stock (quantity = 0).Column to order results by. Accepted values:
name · stock · price. Any other value silently falls back to name.Sort direction. Accepted values:
asc · desc.1-based page number. Values below 1 are clamped to 1.
Number of records per page. Clamped between 1 and 250.
Response
Array of product objects for the current page.
Total number of records matching the applied filters.
Current page number.
Total number of pages given
total and limit.Records-per-page value used for this response.
GET /api/products
Returns a paginated list of active products only (status = 1). This is the primary endpoint used by point-of-sale and search screens where only sellable items should appear.
The
view_mode filter for this endpoint does not include low_stock. Use GET /api/products_all if you need low-stock visibility.Search by product
name or barcode.Stock-level filter. Accepted values:
all · in_stock (quantity > 0) · out_of_stock (quantity = 0).Column to order results by. Accepted values:
name · stock · price.Sort direction. Accepted values:
asc · desc.1-based page number.
Records per page. Clamped between 1 and 250. Default is 24, optimised for grid card layouts.
Response
Same structure asGET /api/products_all. The status field will always be 1 in results from this endpoint.
Example — list in-stock products, second page
Response
GET /api/products/:id
Returns the full details of a single product identified by its numeric ID. UnlikeGET /api/products, this endpoint does not filter by status — it returns the product record regardless of whether it is active or disabled.
Path Parameter
The unique integer ID of the product.
Response
Unique product ID.
Product barcode.
Product name.
Product description.
Current quantity available.
Minimum stock alert threshold.
Unit sale price.
Expiration date (
YYYY-MM-DD) or null.Creation timestamp.
Last update timestamp.
| Status | Meaning |
|---|---|
200 | Product found and returned. |
401 | No active session. |
404 | No product exists with the given ID. |
POST /api/products
Creates a new product in the inventory. Requires theadmin or root role.
Authenticate as admin or root
Ensure your session belongs to a user with role
admin or root. A 403 is returned otherwise.Submit product data
Send a JSON body with the required fields. Optional fields can be omitted entirely.
Request Body
Product barcode. Maximum 20 characters.
Product name. Maximum 25 characters.
Initial stock quantity. Maximum 10,000.
Minimum stock threshold for low-stock alerts. Maximum 1,000.
Unit sale price. Maximum 1,000,000.
Optional product description. Maximum 200 characters.
Optional expiration date in
YYYY-MM-DD format.Response
201 Created
| Status | Meaning |
|---|---|
201 | Product created successfully. |
400 | Missing required fields or validation error. |
401 | No active session. |
403 | Authenticated user lacks admin or root role. |
500 | Database or internal error. |
Example — create a product
Response
PUT /api/products/:id
Partially updates an existing product. Only the fields present in the request body are modified; omitted fields retain their current values. Requires theadmin or root role.
Path Parameter
The unique integer ID of the product to update.
Request Body
All fields are optional. At least one field must differ from the current stored value; sending identical values returns400.
New product name. Maximum 25 characters.
New description. Maximum 200 characters.
Updated stock quantity. Maximum 10,000.
Updated minimum stock threshold. Maximum 1,000.
Updated unit sale price. Maximum 1,000,000.
Updated expiration date in
YYYY-MM-DD format.Explicit status override.
1 = active, 0 = disabled. Prefer the dedicated /activate and DELETE endpoints for lifecycle changes.Response
200 OK
| Status | Meaning |
|---|---|
200 | Product updated successfully. |
400 | No fields to update (all submitted values match current state). |
401 | No active session. |
403 | Authenticated user lacks admin or root role. |
DELETE /api/products/:id
Performs a soft delete by settingstatus = 0 on the product. The record is preserved in the database and can be reactivated at any time. Requires the admin or root role.
Path Parameter
The unique integer ID of the product to disable.
Response
200 OK
| Status | Meaning |
|---|---|
200 | Product disabled successfully. |
401 | No active session. |
403 | Authenticated user lacks admin or root role. |
POST /api/products/:id/activate
Re-enables a previously disabled product by settingstatus = 1. Requires the admin or root role.
Path Parameter
The unique integer ID of the product to reactivate.
Response
200 OK
| Status | Meaning |
|---|---|
200 | Product activated successfully. |
401 | No active session. |
403 | Authenticated user lacks admin or root role. |
500 | Internal error during activation. |
GET /api/items
Lightweight autocomplete endpoint that searches active products by name or barcode and returns up to 10 matches. Intended for typeahead inputs on sale and lookup screens.Search term matched against both
name and barcode. Returns an empty array if the parameter is missing or blank.Response
Returns a JSON array of up to 10 product objects. An empty array[] is returned when no products match or the q parameter is empty — this is not an error condition.
Unique product ID.
Product barcode.
Product name.
Product description.
Current quantity available.
Unit sale price.
| Status | Meaning |
|---|---|
200 | Search completed (may return empty array). |
401 | No active session. |