API-Übersicht
Die SalonERP REST API läuft auf http://localhost:4000/api and provides endpoints for all modules of the system.
Base URL
http://localhost:4000/api
Authentication
Die meisten Endpunkte erfordern a JWT Bearer token via the Authorization header:
Authorization: Bearer <jwt>
Tokens werden über POST /api/auth/login erhalten und laufen nach 8 Stunden ab. Mobile clients can use a refresh token with POST /api/auth/refresh.
Öffentliche Endpunkte unter /api/public/* benötigen keine Authentifizierung.
Error Format
Alle Fehler folgen einem konsistenten JSON format:
{
"error": "Error message in Dutch",
"details": {}
}
| Status | Meaning |
|---|---|
| 400 | Validation errors, invalid input |
| 401 | Missing or invalid token |
| 403 | Insufficient permissions |
| 404 | Resource not found |
| 409 | Duplicate or conflicting |
| 500 | Unexpected server error |
Pagination
Listen-Endpunkte unterstützen optionale Paginierung via query parameters:
GET /api/bookings?page=2&limit=20
Paginated Response
{
"items": [ ... ],
"total": 148,
"page": 2,
"limit": 20,
"pages": 8
}
Without ?page
Gibt ein einfaches Array zurück (rückwärtskompatibel).
Defaults: limit=50, max limit=200.
Modules
| Module | Base path | Description |
|---|---|---|
| Authentication | /api/auth | Login, registration, tokens |
| Bookings | /api/bookings | Appointments CRUD |
| Clients | /api/crm | Client management |
| Services | /api/services | Services and categories |
| POS | /api/pos | Point of Sale |
| Inventory | /api/inventory | Products and stock |
| Staff | /api/staff | Staff and schedules |
| Reporting | /api/reporting | Reports and statistics |
| Notifications | /api/notifications | In-app notifications |
| Settings | /api/settings | Configuration |
| Public | /api/public | Online booking page |