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
min_value:1
storageLocationId int
min_value:1
mode string
enum:add,remove,set
quantity string
decimal min_value:0
unitId int
min_value:1
note string
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>" \
  -H "X-Tenant-Key: <tenantKey>" \
  -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-09-08T16:35:34Z
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
    }
}