Saltar al contenido principal

Descripción general de la 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

Most endpoints require a JWT Bearer token 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": {}
}
StatusMeaning
400Validation errors, invalid input
401Missing or invalid token
403Insufficient permissions
404Resource not found
409Duplicate or conflicting
500Unexpected 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

ModuleBase pathDescription
Authentication/api/authLogin, registration, tokens
Bookings/api/bookingsAppointments CRUD
Clients/api/crmClient management
Services/api/servicesServices and categories
POS/api/posPoint of Sale
Inventory/api/inventoryProducts and stock
Staff/api/staffStaff and schedules
Reporting/api/reportingReports and statistics
Notifications/api/notificationsIn-app notifications
Settings/api/settingsConfiguration
Public/api/publicOnline booking page