Restofy Docs
Control de inventario POST

Ajustar stock de un insumo

POST /api/inventory/create-adjustment

Descripción

Registra un ajuste manual de inventario para un insumo en una bodega.

Detalles

Aplica un ajuste manual sobre el stock de un insumo en una bodega. Puedes agregar una cantidad, quitarla o fijar la cantidad real tras un conteo físico. La cantidad se envía en cualquier unidad del insumo y queda registrada como un movimiento con su motivo y el saldo resultante.

Permisos requeridos

inventory.module

Request

Nombre Tipo Requerido Reglas
inventoryItemId int Sí
min_value:1
storageLocationId int Sí
min_value:1
mode string Sí
enum:add,remove,set
quantity string Sí
decimal min_value:0
unitId int Sí
min_value:1
note string Sí
min:1 max:255

Ejemplo de request

curl -X POST https://restofy.pro/api/inventory/create-adjustment \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <accessToken>" \
  -d '{
    "inventoryItemId": 1,
    "storageLocationId": 1,
    "mode": "string",
    "quantity": "string",
    "unitId": 1,
    "note": "string"
}'

Los valores son demo: reemplázalos por datos reales del negocio.

Ejemplo de respuesta

Actualizado: 2026-10-09T02:12:12Z
HTTP 200

Request

{
    "inventoryItemId": 27,
    "storageLocationId": 4,
    "mode": "add",
    "quantity": 10,
    "unitId": 2,
    "note": "Carga inicial"
}

Response

{
    "success": true,
    "message": "Ajuste guardado",
    "data": {
        "movementId": "2",
        "balanceAfter": 10
    }
}