Restofy Docs
Insumos de inventario POST

Crear insumo

POST /api/inventory-items/create-inventory-item

Descripción

Registra un nuevo insumo en el maestro del restaurante con código autogenerado.

Detalles

* El código se asigna de forma automática con el patrón INS-NNN y no es editable. * Las tres unidades (control, conteo y compra) deben ser de la misma dimensión. * El nombre debe ser único entre los insumos disponibles; falla si ya existe. * Falla si la categoría o alguna de las unidades no está disponible.

Permisos requeridos

catalog.module dispatches.module recipes.module

El usuario solo necesita uno de los permisos listados.

Request

Nombre Tipo Requerido Reglas
name string Sí
min:2 max:150
internalName string No
max:150
description string No
max:1000
categoryUuid string Sí
min:36 max:36
unitId int Sí
min_value:1
countingDefaultUnitId int Sí
min_value:1
purchaseDefaultUnitId int Sí
min_value:1
defaultConsumptionLocationId int Sí
min_value:1
costCents int Sí
min_value:0
reorderPoint string No
decimal min_value:0 default:0
isActive int No
enum:0,1 default:1

Ejemplo de request

curl -X POST https://restofy.pro/api/inventory-items/create-inventory-item \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <accessToken>" \
  -d '{
    "name": "string",
    "categoryUuid": "string",
    "unitId": 1,
    "countingDefaultUnitId": 1,
    "purchaseDefaultUnitId": 1,
    "defaultConsumptionLocationId": 1,
    "costCents": 1
}'

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

Ejemplo de respuesta

Actualizado: 2026-11-02T19:00:57Z
HTTP 200

Request

{
    "name": "Insumo Test 6ae8d72f0551d",
    "categoryUuid": "d4e498dc-0819-4d6d-9f28-57cddf6ec76f",
    "unitId": 2,
    "countingDefaultUnitId": 2,
    "purchaseDefaultUnitId": 2,
    "defaultConsumptionLocationId": 4,
    "costCents": 100,
    "reorderPoint": 10
}

Response

{
    "success": true,
    "message": "Insumo creado",
    "data": {
        "inventoryItem": {
            "inventoryItemId": 27,
            "name": "Insumo Test 6ae8d72f0551d",
            "internalName": null,
            "description": null,
            "inventoryItemCategoryId": 12,
            "categoryUuid": "d4e498dc-0819-4d6d-9f28-57cddf6ec76f",
            "categoryName": "Cat Insumo 6ae8d72eabd85",
            "unitId": 2,
            "countingDefaultUnitId": 2,
            "purchaseDefaultUnitId": 2,
            "defaultConsumptionLocationId": 4,
            "baseUnitId": 2,
            "baseUnitSymbol": "g",
            "sku": "INS-081",
            "costCents": 100,
            "reorderPoint": "10.0000",
            "isActive": 1,
            "isAvailable": 1
        }
    }
}