Skip to main content

API Overview

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 for 30-day sessions.

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, setup, tokens
Bookings/api/bookingsAppointments CRUD
Clients/api/crmClient management (CRM)
Services/api/servicesServices and categories
POS/api/posPoint of Sale
Inventory/api/inventory + /api/suppliersProducts, categories, stock, purchase orders
Internal Consumption/api/internal-consumptionInternal product usage
Staff/api/staffStaff and schedules
Reporting/api/reportingReports and statistics
Notifications/api/notificationsIn-app notifications
Settings/api/settingsConfiguration and feature toggles
Campaigns/api/campaignsMarketing email campaigns
Backup/api/backupBackup and restore
Public/api/publicOnline booking page (no auth)

Additional modules (not separately documented)

ModuleBase pathDescription
Payments/api/paymentsStripe webhook + payment handling
Calendar/api/calendarGoogle Calendar integration
Reviews/api/reviewsClient reviews
Waitlist/api/waitlistWaitlist management
Loyalty/api/loyaltyLoyalty programme
Gift Cards/api/gift-cardsGift card management
Promotions/api/promotionsDiscount codes and promotions
Packages/api/packagesService packages
Recurring/api/recurringRecurring bookings
Audit/api/auditAudit log
Locations/api/locationsMulti-location support
WhatsApp/api/whatsappWhatsApp messaging
Accounting Export/api/accounting-exportAccounting data export