Client Surfaces
Online booking, client portal (OTP login), walk-in queue check-in, intake forms, consent forms, and feedback.
8 min read
Overview
Client surfaces are the public, outward-facing pages a client uses without a staff account. They are all token- or OTP-protected and scoped to one brand:

| Surface | Public URL | Auth |
|---|---|---|
| Online booking | /book/[slug] |
Phone + OTP |
| Embeddable booking widget | /book/[slug]/widget |
Phone + OTP |
| Client portal | /book/[slug]/portal |
Phone or email + OTP |
| Loyalty card | /card/[slug] |
Same OTP session as the portal |
| Referral landing | /r/[code] |
None (code in the URL) |
| Walk-in check-in | /checkin/[locationId] |
None (location must have check-in enabled) |
| Queue board | /queue/[locationId] |
None |
| Intake form | /intake/[token] |
Unguessable token |
| Consent form | /consent/[token] |
Unguessable token |
| Feedback form | /feedback/[token] |
Single-use token |
Online Booking
/book/[slug] renders the phone-first QuickBooking flow (SALO-2502). The older multi-step BookingFlow component (booking-flow.tsx) is no longer mounted by any page; only its tests import it.
Booking Flow
- Phone — the client enters a 10-digit Indian mobile number. Other numbers are told to call the salon.
- Code — a verification code is sent by WhatsApp when the brand has WhatsApp available, otherwise SMS (WhatsApp falls back to SMS if the send is refused). The phone is verified before anything about it is revealed, so the page cannot be used to probe which numbers are customers.
- You — a known client is greeted by first name. A new number gives a name (and a branch for multi-location brands) and a client record is created immediately.
- Service — the client picks a category, then types to find a service, or chooses "decide later", which alerts the salon to message them.
- Time — the next free slots over the following days are shown. The stylist is chosen for the client: the least-loaded eligible stylist, with same-gender matching applied (SALO-2122).
- Book — the booking is created (see below).
- Deposit — shown only if a deposit applies.
If the code cannot be delivered on any channel, the client can ask for a callback instead. That creates an alert for staff, no client record, and sends nothing to the unverified number.
What booking creates
- Stylist chosen (the normal path): an appointment with status
scheduled, after the same skill, leave, shift, store-hours and overlap checks the slot pickers use. The client is matched by phone or email within the org, or created. A booking confirmation is sent. - No stylist, or
request_only: a booking request inonline_bookings. Staff assign a stylist and confirm it under Dashboard > Booking Requests; nothing is sent to the client until then. - Deposit: a per-service deposit override wins over the brand default (
require_deposit+deposit_pct). Abooking_depositsrow is created aspendingand the client pays through Stripe or Razorpay (whichever the brand has configured). If the deposit row fails to create, the booking still stands and staff can record the deposit manually.
Availability and slot locking
Slots come from the same availability engine as the operator calendar. There is no provisional slot hold: nothing is reserved while a client browses, and a slot taken in the meantime is rejected at booking time with "That time is no longer available". The booking_sessions table does not hold slots; it records that a phone reached the contact step so an abandoned-booking cron can send a WhatsApp recovery message to sessions older than 30 minutes that never completed.
Settings
Per brand in booking_settings: is_online_booking_enabled, advance_days (0-365), slot_interval_min (1-480), cancellation_hours (0-720), require_deposit, deposit_pct, booking_instructions, show_staff, same_gender_staff. Services can be hidden from online booking (online_bookable) and carry their own deposit rule.
Embedded widget
/book/[slug]/widget shows the same booking flow in an iframe-friendly page, with an optional "Chat" tab to the AI front-desk agent when the brand has it enabled. WhatsApp bookings are handled separately by the AI agent (see ai.md).
Brand customisation
The page applies the brand's theme tokens (primary, secondary, accent colours, font, logo) as CSS variables. No custom CSS is needed.
Client Portal
/book/[slug]/portal lets a client see and manage their own data. It is available only when the brand has enabled it (portal_configs.is_enabled); otherwise the page says the portal is not available.
Login: OTP, not magic link
There is no magic link and no password. The client enters a phone number (SMS or WhatsApp) or an email address and receives a one-time code:
- Code is valid for 10 minutes and is single use. Phone codes are 6 characters from an unambiguous alphanumeric set; email codes are 6 digits.
- 5 wrong guesses burn the code and lock that identifier out until the code would have expired.
- Sends are limited to 3 per identifier per 10 minutes, plus per-IP caps.
- A successful verification sets a signed (HMAC)
httpOnlycookie,portal_session_<brandId>, valid for 7 days. Email-only sessions work for clients with no phone on file.
The loyalty card page (/card/[slug]) reuses this same OTP and session.
Portal Features
| Tab / area | What the client sees or does |
|---|---|
| My Bookings | Upcoming appointments; reschedule to an available slot; cancel (blocked inside the brand's cancellation_hours, default 2 hours, and blocked once a visit has started or finished) |
| History | Past visits (shown only once there are completed ones); rate a visit 1-5 stars with an optional comment |
| Loyalty | Points, current and next tier, spin wheel, won prizes, raffles |
| VIP | Active memberships and allowance |
| Vouchers | Gift cards (shown only if the client has any) |
| Receipts | Invoices (shown only if the client has any) |
| Refer | Personal referral code and share link |
| Profile | Edit display name, email, and notification preferences (WhatsApp reminders, email reminders, promotional) |
A header strip also shows wallet balance, cashback, loyalty points and remaining package sessions when non-zero. The portal config also holds booking_window_days, advance_booking_hours, require_phone, welcome_message and confirmation_message.
Related sub-pages under the portal route: /book/[slug]/memberships (membership plans) and /book/[slug]/upgrade/[appointment_id] (upsell an existing booking).
Walk-in Check-In
"Check-in" is a walk-in queue, not an arrival marker for an existing appointment.
- Staff enable check-in per location (
locations.checkin_enabled, with an optional welcome message) and put/checkin/[locationId]on a tablet or QR code. - A walking-in client enters their name (required), and optionally phone, a service and notes, then taps join.
- They are added to the location's
walk_in_queueand shown their position (#N). There is no appointment lookup and no "Checked In" status on the calendar. - Staff manage the queue at Dashboard > Queue (Waiting, In Service, Done, Cancelled) and can start an appointment from a queue entry, which leads to checkout.
/queue/[locationId]is a live lobby display of waiting and in-service entries. It shows first names only and never the notes.
Intake Forms
A brand has one intake form (intake_forms, one row per brand), configured under Dashboard > Settings > Intake.
- Field types: text, long text, select (with options), checkbox. Each can be required. There is no conditional logic, file upload, digital signature or expiry.
- Delivery is manual: staff generate a unique link (optionally tied to an appointment or client) from the settings page and share it themselves. Nothing sends the form automatically before an appointment.
- Submission: the client opens
/intake/[token], answers, and submits once. Required fields are validated; a second submit is rejected. - Responses (the latest 100 submitted) are listed in the Intake settings screen. They are stored with
appointment_idandclient_idwhen supplied, but are not currently surfaced on the appointment view.
Consent Forms
Consent forms (consent_forms) are configured under Dashboard > Settings > Consent: a title, a body, an active flag, and requires_signature.
- Delivery is manual: staff pick a form, optionally enter a client name, and generate a share link. The settings page builds the link as
/embed/consent/<token>, while the public form page is served at/consent/<token>. - Signature is a typed full name, not a drawn signature, stored in
signature_dataalong with the agreement time and the client's IP address. - A token can be signed once. A signed form shows "Consent already recorded".
- Responses (latest 100) are listed in the settings screen.
- There is no per-service waiver assignment, expiry, PDF download, or enforcement that blocks a booking or service until a waiver is signed.
Feedback Forms
/feedback/[token] is a post-visit form (SALO-2576):
- Star ratings (1-5): an overall rating, plus optional stylist, service quality, store and front-desk ratings, and up to 5 owner-defined custom questions. Which built-in questions appear is configurable per brand.
- Optional "What could be better?" chips (waiting time, price, cleanliness, staff behaviour, result of service) and a comment up to 1000 characters.
- The token is single use and expires 7 days after the visit; the form can also be closed by turning the campaign off.
- Low overall scores (default 3 or below) trigger a staff alert; higher scores can be shown the brand's review link. See
reputation.md.
Embed Security
Only the booking widget route (/book/:slug/widget) is served with Content-Security-Policy: frame-ancestors * (set in next.config.ts) so it can be framed on third-party sites. The check-in and queue pages are not given that header. Every public surface is scoped to one brand (and location where relevant), and every public write endpoint is rate limited.
Key Data Entities
- booking_sessions — a phone that reached the booking contact step; used for abandoned-booking recovery, not slot holding
- online_bookings — a booking request awaiting staff confirmation
- booking_deposits — a deposit due or paid for an online booking
- client_otp_tokens — one-time codes for the portal and quick booking
- portal_configs — per-brand portal switches and policy
- walk_in_queue — a check-in entry for a location
- intake_forms / intake_responses — the brand's questionnaire and each client's answers
- consent_forms / consent_responses — consent text and each typed-name signature
Configuration Options
| Setting | Scope | Description |
|---|---|---|
| Online booking enabled | Brand | Whether /book/[slug] accepts bookings |
| Advance days, slot interval, cancellation hours | Brand | Booking window and policy |
| Deposit required / percent | Brand, per service | Brand default; a service-level rule overrides it |
| Show staff, same-gender staff | Brand | Stylist display and matching |
| Client portal enabled, cancellation hours, welcome message | Brand | Portal availability and policy |
| Check-in enabled and message | Location | Whether /checkin/[locationId] works |
| Intake form | Brand | The single questionnaire and its fields |
| Consent forms | Brand | Any number of forms, each with optional typed signature |
| Feedback questions | Brand | Which rating questions and chips are shown |