The inventory module tracks materials, tools, equipment, consumables, and spare parts (repuestos) across multiple warehouses. Stock is maintained per warehouse/item pair in theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/ency07/B2B/llms.txt
Use this file to discover all available pages before exploring further.
inventory_stock table and updated atomically via inventory movements. All stock queries are filtered by tenant_id for multi-tenant isolation.
Item types
| Type | Description |
|---|---|
Material | Raw or processed material |
Herramienta | Hand tools and instruments |
Equipo | Heavy equipment and machinery |
Consumible | Single-use supplies |
Repuesto | Spare parts and replacement components |
getInventoryStock(tenantCode?) → stock list
Returns all warehouse/item stock pairs for the tenant, joining warehouses and inventory_items:
createInventoryMovement(tenantCode, movement)
Requires the inventory.movement action permission. Resolves itemCode and warehouse codes to their internal IDs before inserting. Movement codes are auto-generated sequentially (MOV-2026-NNNN). Movements are inserted with status: "Aplicado" — they take effect immediately.
Transferencia, the insert uses source_warehouse_id and destination_warehouse_id. For Entrada and Salida, only warehouse_id is set.
Stock validation rules:
SalidaandTransferenciamovements checkavailable_quantity >= movement.quantitybefore processing. If the check fails, the action throws"Stock insuficiente en bodega origen. Disponible: X, Requerido: Y".Entradamovements have no stock floor — you can always add stock.- Movement codes follow the format
MOV-YYYY-NNNN(zero-padded to 4 digits), generated from aCOUNTquery oninventory_movementsscoped to the tenant.
createInventoryItem(tenantCode, itemData)
Creates a new inventory item definition and, optionally, an initial stock entry and Entrada movement in the specified warehouse.
initialQuantity is provided along with warehouseId, the action:
- Upserts an
inventory_stockrow (on conflict:tenant_id, warehouse_id, item_id). - Inserts an
Entradamovement withnotes: "Carga inicial de inventario".
getWarehouses(tenantCode?) → warehouse list
Returns all active (non-deleted) warehouses for the tenant:
code values as sourceWarehouse / destWarehouse when calling createInventoryMovement.
Low stock alerts
Items withavailable_quantity ≤ 10 are flagged across the ERP:
almacenistadashboard: appear in both the notification bell (notificationsarray withisDanger: quantity <= 0) and the pending queue ("Reordenar <name> (<code>)").- Operations health score: each low-stock SKU reduces the
inventoryhealth score by 10 points (max(0, 100 − count × 10)), surfaced in the admin command center.