API

Packages - Public

Public tenant-scoped package endpoints for customers browsing available services.

Base path: /api/v1/packages

Used by: customer-booki-web-app, cms-booki-web-app · Role: guest / customer
organizationId: Resolved by tenant middleware from x-tenant-slug header (auto-injected from subdomain)

These are the public package endpoints that return service offerings for a specific business (tenant). Customers use them to browse available packages before booking.

For owner-side package management (create, update, delete), see Organizations - Packages.


GET /api/v1/packages — List Public Packages

Auth: Public (requires x-tenant-slug header)
Used by: customer-booki-web-app, cms-booki-web-app · Role: guest / customer
Description: Fetch all active packages (services) offered by a specific business tenant. Customers use this to browse services before making a booking.

Request

Headers (required):

X-Tenant-Slug: janes-salon

Query Parameters (optional):

  • page (number, default: 1)
  • limit (number, default: 10, max: 100)
  • search (string): Search by package name or description
  • sort (string, default: _id)
  • order (string, default: desc): asc | desc
GET /api/v1/packages?page=1&limit=20

Response (200 OK)

{
  "items": [
    {
      "_id": "507f1f77bcf86cd799439031",
      "organizationId": "507f191e810c19729de860ea",
      "name": "Haircut + Wash",
      "description": "Professional haircut with shampoo and blow dry included.",
      "amount": 350,
      "createdAt": "2026-01-10T08:00:00Z"
    },
    {
      "_id": "507f1f77bcf86cd799439032",
      "organizationId": "507f191e810c19729de860ea",
      "name": "Manicure + Pedicure",
      "description": "Full manicure and pedicure with gel color of choice.",
      "amount": 450,
      "createdAt": "2026-01-10T08:05:00Z"
    }
  ],
  "pages": 2,
  "pageRange": "1-2 of 8"
}

Error Responses

422 Unprocessable Entity — Missing tenant slug:

{
  "statusCode": 422,
  "message": "Tenant identifier is required to process this request."
}

cURL Example

curl -X GET "http://localhost:4001/api/v1/packages?page=1&limit=20" \
  -H "X-Tenant-Slug: janes-salon"

GET /api/v1/packages/:id — Get Package by ID

Auth: Public
Used by: customer-booki-web-app, cms-booki-web-app · Role: guest / customer
Description: Fetch details for a single package by its ID. No tenant slug required — the package ID uniquely identifies the record.

Request

GET /api/v1/packages/507f1f77bcf86cd799439031

Path Parameters:

  • id (string, required): Package ID (24-hex)

Response (200 OK)

{
  "_id": "507f1f77bcf86cd799439031",
  "organizationId": "507f191e810c19729de860ea",
  "name": "Haircut + Wash",
  "description": "Professional haircut with shampoo and blow dry included.",
  "amount": 350,
  "createdAt": "2026-01-10T08:00:00Z",
  "updatedAt": "2026-03-01T12:00:00Z"
}

Error Responses

404 Not Found — Package does not exist:

{
  "statusCode": 404,
  "message": "Package not found."
}

cURL Example

curl -X GET http://localhost:4001/api/v1/packages/507f1f77bcf86cd799439031