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.module
Request
| Nombre | Tipo | Requerido | Reglas |
|---|---|---|---|
| search | string | No |
max:100
|
| movementType | string | No |
enum:purchase,sale,transfer_in,transfer_out,adjustment,waste
|
| 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>" \
-H "X-Tenant-Key: <tenantKey>"
Los valores son demo: reemplázalos por datos reales del negocio.
Ejemplo de respuesta
Actualizado: 2026-09-08T16:35:34Z
HTTP 200
Request
[]
Response
{
"success": true,
"message": "Operación realizada correctamente",
"data": {
"movements": [
{
"movementId": 1,
"movementUuid": "ffffffff-ffff-ffff-ffff-ffffffffff10",
"inventoryItemId": 1,
"itemName": "Lomo de Res",
"categoryName": "Carnes y Aves",
"storageLocationId": 1,
"locationName": "Bodega Principal",
"movementType": "purchase",
"quantity": "10.0000",
"baseUnitSymbol": "g",
"countingSymbol": "g",
"countingFactor": "1.0000",
"costPerUnitCents": 500,
"balanceAfter": "10.0000",
"transferId": null,
"referenceId": null,
"referenceType": null,
"actorId": 15,
"actorName": "App Testing",
"notes": null,
"createdAt": "2026-09-08T16:30:58.000Z"
}
],
"pagination": {
"page": 1,
"limit": 50,
"total": 1,
"totalPages": 1,
"hasNext": false,
"hasPrev": false
},
"kpis": {
"totalMovements": 1,
"entriesCount": 1,
"exitsCount": 0,
"valueMovedCents": 5000
}
}
}