The inventory module in Kantuta POS is built around two core resources: Categories (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Eleazarguitar18/kantuta_pos_back/llms.txt
Use this file to discover all available pages before exploring further.
Categoria) and Products (Producto). Categories organize your catalog; products are the individual items tracked with real-time stock levels, cost, and selling price. All deletes are soft — records are flagged as inactive (estado: false) rather than removed from the database, preserving historical references in sales and purchase records. Stock is maintained automatically: creating a sale decrements stock_actual, and creating a purchase (compra) increments it and updates costo_compra.
Categories
Categories group related products together and allow you to filter your catalog. Inactive categories are automatically excluded fromGET /inventario/categorias list responses.
Create a Category
| Field | Type | Required | Description |
|---|---|---|---|
nombre | string | ✅ | Category name (max 100 characters) |
id_user_create | integer | ✅ | Audit field |
id_user_update | integer | Optional | Audit field |
List All Categories
estado: true). Soft-deleted categories are filtered out automatically.
Get a Category by ID
Update a Category
CrearCategoriaDto are optional in the update DTO.
Soft-Delete a Category
estado: false on the category. Products under this category are not affected; their individual state is managed separately.
Products
Products are the billable items in your catalog. Each product is linked to exactly one category and tracks both its selling price (precio_venta) and acquisition cost (costo_compra), allowing the system to compute margin data for reports.
Create a Product
| Field | Type | Required | Description |
|---|---|---|---|
nombre | string | ✅ | Full product name |
codigo_barras | string | Optional | Barcode string for scanner integration |
precio_venta | number | ✅ | Public selling price (min 0) |
costo_compra | number | ✅ | Acquisition cost (min 0) |
stock_actual | integer | ✅ | Current on-hand quantity (min 0) |
stock_minimo | integer | ✅ | Alert threshold — triggers low-stock flag when stock_actual falls to or below this value (min 0) |
id_categoria | integer | ✅ | ID of the parent category |
id_user_create | integer | ✅ | Audit field |
id_user_update | integer | Optional | Audit field |
List All Products
categoria object (eager loaded via TypeORM’s eager: true setting on the ManyToOne relation).
Get a Product by ID
Update a Product
CrearProductoDto are optional in the update. Use this to correct pricing, update the barcode, or adjust stock_minimo.
Soft-Delete a Product
GET /inventario/producto and cannot be added to new sales.
Stock Fields Explained
stock_actual
Current on-hand quantity. This is the real-time count of units physically available. It is automatically decremented when a sale is created and incremented when a purchase (
compra) is registered.stock_minimo
Low-stock alert threshold. When
stock_actual reaches or drops below this value, the product is flagged as low-stock in reports and dashboard KPIs. Set this to a realistic reorder point for each SKU.Stock Updates via Purchases
When acompra (stock purchase) is created in the system, the backend automatically:
- Increments
stock_actualby the purchased quantity for each product in the purchase. - Updates
costo_comprato reflect the new acquisition cost, keeping your margin calculations current.
stock_actual to record received goods — always use the purchases module (POST /compras) to maintain a full purchasing history and accurate cost data.
Barcode Support
Thecodigo_barras field is an optional string on every product. It accepts any barcode format (EAN-8, EAN-13, UPC-A, Code 128, etc.) as a plain string — no special encoding is required.
Use this field to enable barcode-scanner workflows on the frontend:
- Scan a barcode at the POS terminal.
- Query
GET /inventario/productoand filter client-side bycodigo_barras, or implement a dedicated search endpoint that filters by this field. - Auto-populate the product line in the sale form.
Inventory Snapshot Report
For a complete inventory report suitable for PDF generation, use the reportes module:auditor query parameter to embed the requester’s name in the report header. See the Reports guide for details.
Endpoint Summary
Categories
| Method | Endpoint | Description |
|---|---|---|
POST | /inventario/categorias | Create a category |
GET | /inventario/categorias | List active categories |
GET | /inventario/categorias/:id | Get category by ID |
PATCH | /inventario/categorias/:id | Update a category |
DELETE | /inventario/categorias/:id | Soft-delete a category |
Products
| Method | Endpoint | Description |
|---|---|---|
POST | /inventario/producto | Create a product |
GET | /inventario/producto | List all products (with categoria) |
GET | /inventario/producto/:id | Get product by ID |
PATCH | /inventario/producto/:id | Update a product |
DELETE | /inventario/producto/:id | Soft-delete a product |