Settings

This is where you connect booking and chat, and add the business details the site and assistant need. Nothing here is invented for you — fill in what applies, and the booking and chat experience will use it.

Connections

Calendar (appointments)

Connected

Connect your calendar sub-account so booking requests sync to your calendar. Webhook URLs and credentials are stored server-side.

Chat & lead tracking

Connected

Connect lead capture so chat conversations and booking requests are saved to your CRM. Credentials are stored server-side.

Facebook Messenger

Not connectedSeparate connection

A separate connection. Requires access to China's business Page and messaging permissions, granted through the Page settings.

Webhook URLs and API credentials are kept server-side and never exposed in this page. The toggles above reflect connection state only.

Business details to provide

These fields are blank by design. Add them and the booking assistant and chat will surface them automatically. Nothing is assumed.

Settings are stored locally for now. When you connect the calendar and chat, they will sync to your sub-account.

Booking workflows (drafts — not active)

Five workflows are drafted for China's sub-account — the same account that owns the "Book With China" calendar and the $25 Booking Deposit product. They use existing fields only, run in America/New_York, and send email + SMS where a sender is configured. Build them in the CRM, leave them off until the missing pieces below are resolved, then test with a real $25 deposit. Full spec: WORKFLOWS.md in the project.

1

Appointment saved — booking acknowledgment

Trigger: Appointment Created (Book With China). No payment-status branch — sends on every new booking. Notifies China with all booking details; sends the client a 'Booking received' acknowledgment with the $25 deposit link (covers both paid and unpaid). No confirmation language. Draft.

2

Deposit received

Trigger: $25 Booking Deposit payment succeeded. Matches it to the specific appointment (reference, or unambiguous email), sets Payment Status = Deposit Paid, records the transaction ID, and notifies China. Unmatched/ambiguous → creates a verify-task, never auto-confirms.

3

Appointment confirmed

Trigger: Appointment Status = Confirmed AND Payment Status = Deposit Paid. Sends the client confirmation with service, date/time, location, and reschedule/cancel links; notifies China. Duplicate-confirmation guard included.

4

Appointment reminders

24-hour and 2-hour reminders before confirmed appointments. Skip already-passed times, stop on cancellation, auto-adjust on reschedule. Reads live appointment fields.

5

Changes — cancel / reschedule

Client + internal notices on cancellation (Appointment Status = Cancelled) and rescheduling (Start Time changed, still Confirmed). No invented refund, deposit-transfer, or cancellation-policy text.

Missing pieces before activation

  • Payment matching by reference: the hosted deposit link does not return the booking reference. Need a payment-link/invoice variant that carries reference, or a per-booking invoice, for automatic deposit→appointment matching. Until then the webhook matches by unambiguous email and otherwise creates a verify-task for China.
  • Webhook signing secret: no secrets configured. Add PAYMENT_WEBHOOK_SECRET (andPAYMENT_WEBHOOK_SIG_HEADER if the header name differs) to server secrets, and point the payment processor's event webhook at https://chinashairhaven.com/api/payment-confirmation. Without it the webhook fails closed (503) in production.
  • Calendar access token: CALENDAR_ACCESS_TOKEN in server secrets is required for the webhook to write "Confirmed" back to the actual calendar event.
  • Email + SMS sender: the sub-account's verified sending domain/email and SMS sender/number must be configured and contacts opted in, or workflows #1, #3, #4, #5 cannot send.
  • Fields: confirm every merge field is present in the field picker before activating each workflow; pick the closest existing equivalent if one is missing — never invent a new field.

What's working vs. what needs a connection

Working now

  • Filterable service menu with starting prices and estimated totals
  • Style gallery with reference photo support
  • Real calendar availability and booking — appointments save to China's calendar
  • Chat assistant answering from the real menu only
  • Editable business-detail settings

Needs a connection

  • Booking + chat lead tracking is connected — saved bookings fire a CRM tracking event alongside the calendar appointment
  • Facebook Messenger: requires Page access & messaging permissions
  • Payment matching by reference + webhook secret still needed for automatic deposit→confirmation (see workflows section above)