# Yatoon Booking Setup Guide

This guide is for salon owners installing Yatoon Appointment Booking on an existing WordPress site.

## Requirements

- WordPress 5.8 or newer
- PHP 7.4 or newer
- HTTPS enabled on the booking site
- Pretty permalinks enabled in WordPress
- A working WordPress email setup, preferably SMTP

## Basic Setup

1. Upload and activate the Yatoon plugin from **Plugins > Add New > Upload Plugin**.
2. Open **Yatoon Booking > Setup Wizard**.
3. Add business name, address, phone number, timezone, and booking hours.
4. Add at least one staff member in **Yatoon Booking > Staff**.
5. Add services in **Yatoon Booking > Services** and assign services to staff.
6. Create or edit a public booking page and add:

```text
[yatoon_booking]
```

Optional display shortcodes:

```text
[yatoon_service_menu]
[yatoon_catalog]
[yatoon_gallery]
[yatoon_customer_portal]
[yatoon_staff_portal]
```

## 10-Minute Launch Path

1. Complete the Setup Wizard and verify the WordPress timezone.
2. Add one staff member, assign at least one service, and confirm that staff member's working hours.
3. Add the booking shortcode or Booking Form block to a public HTTPS page.
4. Choose Local or Square as the active platform; do not mix test and production Square credentials.
5. Make one private test booking, then change, reschedule, and cancel it from the customer management link.
6. Open **Yatoon Booking > Operations > Reliability** and resolve every item marked **Needs attention** before publishing.

## Local Mode

Use Local mode if the salon wants availability and bookings to run entirely inside WordPress.

1. Go to **Yatoon Booking > Settings > General**.
2. Set **Active Platform** to **Local**.
3. Configure business hours, closed dates, staff services, buffers, and minimum lead time.
4. Test at least one booking on the public booking page.

## Square Setup

Square sync is available in the Pro package.

1. Create or open a Square Developer application at `https://developer.squareup.com/apps`.
2. Copy the Square access token.
3. Copy the Square location ID for the salon.
4. Go to **Yatoon Booking > Settings > General**.
5. Set **Active Platform** to **Square**.
6. Paste the access token and location ID.
7. Choose **Sandbox** for testing or **Production** for the live salon.
8. Save settings and use **Test Connection** / **Sync Now**.
9. Confirm that Square staff and service variations are mapped correctly before taking public bookings.

## Square Payment Setup

Square online payments are available in the Pro package.

1. Confirm Square appointment sync works first.
2. In Square Developer Dashboard, use the same Square application and copy the matching Application ID, Access Token, and Location ID for Sandbox or Production.
3. In WordPress, go to Yatoon Settings > Payments.
4. Enable Square Online Payments.
5. Paste the Square Application ID.
6. Choose Deposit only or Full appointment amount.
7. Select payment methods: Card, Apple Pay, Google Pay, Cash App Pay, and/or Square Gift Card.
8. Set Square Seller Country, usually `US` for United States salons.
9. For Apple Pay, register the website domain in the Square application Apple Pay settings. Apple Pay requires HTTPS and Safari on a supported Apple device.
10. Test in Sandbox before switching to Production credentials.

Notes:

- Apple Pay and Google Pay buttons appear only when the browser, device, Square account, and domain setup support them.
- Cash App Pay is currently US-focused.
- Square Gift Card payments require an active Square gift card for the same Square seller.
- Yatoon verifies the Square payment server-side before saving the booking.

## Square Sync Health and Recovery

Open **Yatoon Booking > Operations > Reliability** whenever Square Calendar, POS, or the website appear out of sync.

1. Click **Sync Square now** once and wait for completion.
2. Review **Latest Square sync**, **Latest Square webhook**, and the seven-day trend.
3. Retry failed jobs only after the network or Square service has recovered.
4. If the problem remains, download diagnostics before changing credentials. The package excludes stored API secrets and customer rows.

Avoid repeatedly clicking Sync or replacing a working access token during a temporary Square outage.

## Change Services Safety

Service changes are checked against business hours, breaks, Closed Dates, qualified staff, existing appointments, shared resources, and a final pre-save conflict check. In Square mode, Square remains the final availability source. If a service does not fit, choose a shorter service, use Any staff, or reschedule the appointment first.

## Caching and Theme Notes

- Exclude the booking page, customer management page, REST requests, and WordPress AJAX requests from full-page caching.
- Purge page/CDN caches after updating Yatoon or changing booking styles.
- Do not combine or delay Yatoon checkout/payment JavaScript unless the optimization plugin has been tested through a complete booking.
- Test desktop Edge/Chrome and a real iPhone/Safari after changing the WordPress theme or optimization settings.

## Vagaro Setup

Vagaro sync is available in the Pro package.

1. Get the Vagaro API key and business ID from the Vagaro business account.
2. Go to **Yatoon Booking > Settings > General**.
3. Set **Active Platform** to **Vagaro**.
4. Save the API key and business ID.
5. Use **Test Vagaro Connection**.
6. Confirm staff, service, and availability mapping before publishing the booking page.

## Stripe Deposits

Stripe deposits and prepayment are available in the Pro package.

1. In Stripe, copy the publishable key and secret key.
2. Create a webhook endpoint using the webhook URL shown in Yatoon settings.
3. Copy the webhook signing secret.
4. Go to **Yatoon Booking > Settings > Deposit & Prepay**.
5. Enable deposits and enter the keys.
6. Test with Stripe test mode before switching to live keys.

## Twilio SMS

SMS reminders are available in the Pro package.

1. Create or open a Twilio account.
2. Copy the Account SID, Auth Token, and sender phone number.
3. Go to **Yatoon Booking > Settings > SMS Notifications**.
4. Enable customer confirmations, reminders, and optional admin alerts.
5. Send a test SMS before enabling SMS for customers.

## Google Calendar

Google Calendar sync is available in the Pro package.

1. Create a Google Cloud project.
2. Enable the Google Calendar API.
3. Create OAuth credentials.
4. Add the redirect URI shown in Yatoon settings.
5. Copy the client ID and client secret into Yatoon.
6. Click **Connect Google Calendar** and authorize the salon calendar.

## Pre-Launch Checklist

- Book one local test appointment.
- Book one multi-service appointment.
- Book one group appointment.
- Test Any Staff assignment.
- Cancel and reschedule from the manage booking link.
- Confirm email delivery.
- Confirm SMS delivery if enabled.
- Confirm Square/Vagaro/Google sync if enabled.
- Confirm staff portal access.
- Confirm the booking page on mobile.
