Restofy Docs
Costos POST

Listar costo de insumos

POST /api/costing/list-item-costs

Descripción

Listado paginado de insumos con su costo vigente y el valor de su stock.

Detalles

Devuelve el costo vigente de cada insumo, su variación en los últimos 30 días y el valor de su stock. El stock y su valor pueden verse de una bodega o de todas. Incluye el valor total del inventario y cuántos insumos subieron o no tienen costo.

Permisos requeridos

costs.module

Request

Nombre Tipo Requerido Reglas
search string No
max:100
storageLocationId int No
min_value:1

Paginación

defaultLimit 50
maxLimit 100
defaultDir asc
withTotal true
allowedSorts [name, costCents, stockValueCents, varianceBasisPoints, inventoryItemId]
tieBreak inventoryItemId asc

Ejemplo de request

curl -X POST https://restofy.pro/api/costing/list-item-costs \
  -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-11-02T19:00:57Z
HTTP 200

Request

{
    "search": "Insumo Test 6ae8d72fecf2f"
}

Response

{
    "success": true,
    "message": "Operación realizada correctamente",
    "data": {
        "kpis": {
            "inventoryValueCents": 152758000,
            "itemsUp": 1,
            "itemsWithoutCost": 0
        },
        "items": [
            {
                "inventoryItemId": 27,
                "inventoryItemUuid": "2aaa1762-d116-11f1-8bb6-de64ef616b7c",
                "name": "Insumo Test 6ae8d72fecf2f",
                "categoryName": "Cat Insumo 6ae8d72f8faa0",
                "countingSymbol": "g",
                "costCents": 20,
                "lastPurchaseCostCents": 20,
                "varianceBasisPoints": 30000,
                "stockQuantity": 400,
                "stockValueCents": 8000,
                "productsCount": 0,
                "hasCostReset": 0
            }
        ],
        "pagination": {
            "page": 1,
            "limit": 50,
            "total": 1,
            "totalPages": 1,
            "hasNext": false,
            "hasPrev": false
        }
    }
}