Zederkof Stock — Read-only API

v1.0.0 · read-only · token required

This API exposes the Zederkof Stock system as read-only JSON. Every endpoint is a GET request — there are no write operations. Data covers products, stock levels, alert rules, stockout history, demand forecasts, sales aggregates and more.

Authentication

All data endpoints require a read-only access token. Admins can create and revoke named tokens (zk_ro_…) in the admin panel under Settings → Konto → API-tokens; the full token is shown only once. Send it as a Bearer token:

Authorization: Bearer YOUR_READONLY_TOKEN

or, alternatively, as a header:

X-API-Key: YOUR_READONLY_TOKEN
The discovery index (/api/v1), /health, /docs and /openapi.json do not require a token. Everything else returns 401 without a valid key. Requests other than GET return 405.

Base URL

https://stock.zederkof.dk/api/v1

Quick start

curl -H "Authorization: Bearer YOUR_READONLY_TOKEN" \
  "https://stock.zederkof.dk/api/v1/products?stockStatus=no-stock&limit=20"

Response envelope

List endpoints return a consistent envelope:

{
  "data": [ /* array of items */ ],
  "pagination": { "page": 1, "limit": 100, "total": 1234, "totalPages": 13, "hasMore": true },
  "meta": { "resource": "products", "version": "1.0.0", "generatedAt": "2026-06-24T10:00:00.000Z" }
}

Single-resource endpoints return { "data": { ... }, "meta": { ... } }. Errors return { "error": { "code": "...", "message": "..." } }.

Status codes

CodeMeaning
200OK
401Missing / invalid token
404Unknown resource or item not found
405Non-GET method (read-only API)
500Server error

Endpoints

GET /api/v1

API discovery index (no auth). Lists all resources and links.

GET /api/v1/health

Health check (no auth).

GET /api/v1/docs

This HTML documentation page (no auth).

GET /api/v1/openapi.json

OpenAPI 3.0 specification (no auth).

GET /api/v1/summary

Aggregate dashboard counts for the whole system.

GET /api/v1/products

List products with stock levels.

GET /api/v1/products/{idOrSku}

A single product by BC systemId or SKU, including alerts, BOM and assembly components.

GET /api/v1/categories

Distinct product categories with product counts.

GET /api/v1/alerts

Stock-level alert rules (thresholds + seasonal windows).

GET /api/v1/stockouts/daily

Day-by-day lost sales / lost quantity during stockouts.

GET /api/v1/stockouts/events

Zero / restock events with their causes.

GET /api/v1/stockouts/periods

Ledger-derived stockout periods (start, end, days out).

GET /api/v1/forecasts

Seasonal demand forecasts & reorder points (per SKU / variant / month).

GET /api/v1/sales-cache

Cached sales aggregates used for stockout analysis.

GET /api/v1/calendar-events

Calendar events used for chart highlights.

GET /api/v1/sku-merge-groups

SKU merge groups with their members.

GET /api/v1/favorites

Favorited products.

GET /api/v1/assembly-components

BOM relations (parent SKU -> component SKU with quantity per unit).

OpenAPI

A machine-readable spec is available at https://stock.zederkof.dk/api/v1/openapi.json.