Restofy Docs
Inventario POST

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). Cada movimiento incluye tipo, cantidad y saldo resultante después del movimiento. Acepta búsqueda textual opcional.

Permisos requeridos

inventory.module

Request

Nombre Tipo Requerido Reglas
search string No
max:100

Paginación

defaultLimit 50
maxLimit 100
defaultDir asc
withTotal true
allowedSorts [createdAt, movementType, quantity, balanceAfter]

Ejemplo de request

curl -X POST https://app.restofy.co/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-07-15T13:20:48Z
HTTP 200

Request

[]

Response

{
    "success": true,
    "message": "Operación realizada correctamente",
    "data": {
        "movements": [
            {
                "movementId": 1,
                "movementUuid": "ffffffff-ffff-ffff-ffff-ffffffffff10",
                "inventoryItemId": 1,
                "storageLocationId": 1,
                "movementType": "purchase",
                "quantity": "10.0000",
                "costPerUnitCents": 500,
                "balanceAfter": "10.0000",
                "transferId": null,
                "referenceId": null,
                "referenceType": null,
                "actorId": 15,
                "notes": null,
                "createdAt": "2026-07-15T13:18:27.000Z"
            }
        ],
        "pagination": {
            "page": 1,
            "limit": 50,
            "total": 1,
            "totalPages": 1,
            "hasNext": false,
            "hasPrev": false
        }
    }
}