API

Owner - Customer Management

Owner endpoints for viewing customer profiles, booking history, and managing relationships.

Base path: /api/v1/owner/customers

Used by: owner-booki-web-app · Role: owner, branch-manager
organizationId: From authenticated user's JWT token (no tenant header needed)

Owner endpoints allow business owners to view customer information, booking history, preferences, and manage customer relationships.


GET /api/v1/owner/customers — List Customers

Auth: Protected (Authorization: Bearer <accessToken>) · branch-manager+
Used by: owner-booki-web-app · Role: owner, branch-manager
Description: Fetch all customers who have booked with your organization.

Request

Query Parameters (optional):

  • page (number, default: 1)
  • limit (number, default: 10, max: 100)
  • search (string): Search by name or email
GET /api/v1/owner/customers?page=1&limit=20&search=john

Response (200 OK)

{
  "items": [
    {
      "_id": "69def5f827e1a548fd0cce1a",
      "email": "john@example.com",
      "phone": "09161234567",
      "type": "customer",
      "name": "John Cruz Smith"
    }
  ],
  "pages": 1,
  "pageRange": "1-1 of 1"
}

cURL Example

curl -X GET "http://localhost:4001/api/v1/owner/customers?page=1&limit=20" \
  -H "Authorization: Bearer OWNER_TOKEN"

GET /api/v1/owner/customers/:type/:id — Get Customer Details

Auth: Protected (Authorization: Bearer <accessToken>) · branch-manager+
Used by: owner-booki-web-app · Role: owner, branch-manager
Description: Fetch booking history for a specific customer or guest.

Request

GET /api/v1/owner/customers/customer/69def5f827e1a548fd0cce1a

Path Parameters:

  • type (string): customer | guest
  • id (string): Customer ID

Response (200 OK)

{
  "items": [
    {
      "_id": "69defc2e27e1a548fd0cce1c",
      "packageName": "Hair Coloring Package",
      "finalBookingDate": "2026-04-20",
      "finalBookingTime": "14:30:00",
      "status": "pending"
    },
    {
      "_id": "69df045327e1a548fd0cce1e",
      "packageName": "Rebond + Treatment",
      "finalBookingDate": "2026-04-20",
      "finalBookingTime": "14:30:00",
      "status": "pending"
    },
    {
      "_id": "69df0733ab436daa9cc2fb87",
      "packageName": "Manicure + Pedicure",
      "finalBookingDate": "2026-04-20",
      "finalBookingTime": "14:30:00",
      "status": "pending"
    },
    {
      "_id": "69df07f2579debdcb74d4118",
      "packageName": "Gel Nail Package",
      "finalBookingDate": "2026-04-20",
      "finalBookingTime": "12:30:00",
      "status": "confirmed"
    }
  ],
  "pages": 1,
  "pageRange": "1-4 of 4"
}

cURL Example

curl -X GET http://localhost:4001/api/v1/owner/customers/customer/69def5f827e1a548fd0cce1a \
  -H "Authorization: Bearer OWNER_TOKEN"
curl -X GET http://localhost:4001/api/v1/owner/customers/guest/69def5f827e1a548fd0cce1a \
  -H "Authorization: Bearer OWNER_TOKEN"