Skip to content

API Reference

Complete REST API reference for the Booking Management platform.

Base URL

{YOUR_API_URL}/api

All endpoints are prefixed with /api. Replace {YOUR_API_URL} with your deployment URL (e.g. https://api.example.com).

Authentication

The API uses PASETO V4 tokens for authentication. Include the token in the Authorization header:

http
Authorization: Bearer <token>

Tokens are obtained via the Auth API login endpoint. Most endpoints require a valid token unless noted otherwise.

Standard Response Format

All responses follow a consistent JSON structure:

json
{
  "success": true,
  "data": {},
  "message": "Operation completed successfully"
}
FieldTypeDescription
successbooleanWhether the request succeeded
dataanyResponse payload (object, array, or null)
messagestringHuman-readable status message

Pagination

List endpoints support pagination via query parameters:

GET /api/bookings/:orgId/list?page=1&limit=20
ParameterTypeDefaultDescription
pagenumber1Page number (1-indexed)
limitnumber20Items per page

Paginated responses include metadata:

json
{
  "success": true,
  "data": [],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 150,
    "totalPages": 8
  }
}

Error Codes

Status CodeMeaningDescription
200OKRequest succeeded
201CreatedResource created successfully
400Bad RequestInvalid request body or parameters
401UnauthorizedMissing or invalid authentication token
403ForbiddenInsufficient permissions for the requested action
404Not FoundResource does not exist
500Internal Server ErrorUnexpected server-side failure

Error Response Example

json
{
  "success": false,
  "message": "Validation failed: email is required"
}

Rate Limiting

API requests are rate-limited per IP address. When the limit is exceeded, the server responds with 429 Too Many Requests.

HeaderDescription
X-RateLimit-LimitMaximum requests allowed in the window
X-RateLimit-RemainingRequests remaining in the current window
X-RateLimit-ResetTimestamp (epoch seconds) when the window resets
json
{
  "success": false,
  "message": "Too many requests, please try again later"
}

Endpoint Groups

GroupPrefixDescription
Auth/api/authAuthentication, token management, password reset
Bookings/api/bookingsBooking lifecycle — create, update, check-in, checkout
Invoices/api/invoiceInvoice creation, listing, and updates
Payments/api/paymentPayment recording and management
Quotes/api/quoteQuotation creation, listing, updates, and deletion

Released under the MIT License.