Aperçu de l'API
The SalonERP REST API runs on http://localhost:4000/api and provides endpoints for all modules of the system.
Base URL
http://localhost:4000/api
Authentication
La plupart des points de terminaison nécessitent un token JWT Bearer via the Authorization header:
Authorization: Bearer <jwt>
Tokens are obtained via POST /api/auth/login and expire after 8 hours. Mobile clients can use a refresh token with POST /api/auth/refresh.
Public endpoints under /api/public/* require no authentication.
Error Format
All errors follow a consistent 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
List endpoints support optional pagination via query parameters:
GET /api/bookings?page=2&limit=20
Paginated Response
{
"items": [ ... ],
"total": 148,
"page": 2,
"limit": 20,
"pages": 8
}
Without ?page
Returns a plain array (backward compatible).
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 |