Listar movimientos de inventario
POST /api/inventory/list-movements
Descripción
Devuelve el historial paginado de movimientos de insumos.
Detalles
Retorna el historial cronológico de movimientos de inventario (entradas, salidas, ajustes y consumos) con el insumo, la bodega y quién lo registró. Cada movimiento incluye tipo, cantidad y saldo resultante. Acepta búsqueda textual, filtro por tipo, por bodega y por rango de fechas, e incluye indicadores del periodo.
Permisos requeridos
inventory.stock.view
Request
| Nombre | Tipo | Requerido | Reglas |
|---|---|---|---|
| search | string | No |
max:100
|
| movementType | string | No |
enum:purchase,purchase_reversal,sale,sale_reversal,transfer_in,transfer_out,adjustment,waste,waste_reversal,count,dispatch_out,dispatch_in,dispatch_return,production_out,production_in,production_reversal
|
| storageLocationId | int | No |
min_value:1
|
| dateFrom | string | No |
max:30
|
| dateTo | string | No |
max:30
|
Paginación
| defaultLimit | 50 |
| maxLimit | 100 |
| defaultDir | desc |
| withTotal | true |
| allowedSorts | [createdAt, movementType, quantity, balanceAfter] |
Ejemplo de request
curl -X POST https://restofy.pro/api/inventory/list-movements \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <accessToken>"
Los valores son demo: reemplázalos por datos reales del negocio.
Ejemplo de respuesta
Actualizado: 2026-11-02T19:00:57Z
HTTP 200
Request
{
"search": null,
"movementType": "dispatch_out",
"storageLocationId": null,
"dateFrom": null,
"dateTo": null,
"limit": 100
}
Response
{
"success": true,
"message": "Operación realizada correctamente",
"data": {
"movements": [
{
"movementId": 2,
"movementUuid": "5577a88f-d116-11f1-8bb6-de64ef616b7c",
"inventoryItemId": 1,
"itemName": "Lomo de res b8e83",
"categoryName": "Cat Insumo 6ae8d776b8e91",
"storageLocationId": 1,
"locationName": "Bodega Principal",
"movementType": "dispatch_out",
"quantity": "-3000.0000",
"baseUnitSymbol": "g",
"countingSymbol": "g",
"countingFactor": "1.0000",
"costPerUnitCents": 40,
"balanceAfter": "7000.0000",
"transferId": null,
"referenceId": 1,
"referenceType": "inventory_dispatch",
"actorId": 5,
"actorName": "App Testing",
"notes": "Despacho Nº 1",
"createdAt": "2026-11-02T18:33:27.000Z"
}
],
"pagination": {
"page": 1,
"limit": 100,
"total": 1,
"totalPages": 1,
"hasNext": false,
"hasPrev": false
},
"kpis": {
"totalMovements": 1,
"entriesCount": 0,
"exitsCount": 1,
"valueMovedCents": 120000
}
}
}