Internal Consumption
Base path: /api/internal-consumption
Internal consumption tracks products used within the salon (e.g., dye or treatments consumed during services). Costs are always calculated using the purchase_price, never the sale price.
This feature can be disabled via Settings > Features (internal_consumption_enabled). It requires purchase_orders_enabled to be active.
GET /internal-consumption/orders
List all internal consumption orders with staff name and item counts.
Auth: Logged in
Query parameters:
| Parameter | Type | Description |
|---|---|---|
page | integer | Page number (activates pagination) |
limit | integer | Items per page (default 50) |
from | date (YYYY-MM-DD) | Start date filter |
to | date (YYYY-MM-DD) | End date filter |
Each order in the list includes an item_count field.
POST /internal-consumption/orders
Create a new internal consumption order and immediately deduct stock.
Auth: Logged in
Request body:
| Field | Type | Required | Description |
|---|---|---|---|
staff_id | integer | Yes | Staff member who consumed the products |
items | array | Yes | Array of consumed items (min 1) |
notes | string | No | Reason / notes |
Item object
{
"product_id": 5,
"qty": 2,
"unit_price": 3.50
}
unit_price should be the product's purchase_price. The order total is calculated as the sum of qty * unit_price across all items.
The order receives an auto-generated number using the EIGEN sequence (e.g., EIGEN2601). Stock is deducted from products.quantity_on_hand and inventory_transactions rows are created with a negative delta.
Response (201): Created order object with order_number, total, staff_name, and the full items array including product_name and product_sku.
GET /internal-consumption/orders/:id
Get a single order with all its items.
Auth: Logged in
Response: Order object with items array. Each item includes product_name, product_sku, and product_article_number.
DELETE /internal-consumption/orders/:id
Delete an internal consumption order and restore stock.
Auth: Admin
Deleting an order is fully reversible: each consumed product's quantity_on_hand is incremented by the recorded quantity, and a reversing inventory_transactions row is created with a positive delta and reason "Eigen verbruik {order_number} teruggedraaid".
Response: { "ok": true }
Auto-numbering
Internal consumption orders use the EIGEN sequence prefix with yearly reset.
Format: EIGEN{YY}{NN} (e.g., EIGEN2601, EIGEN2602).