# Yatoon REST API

Yatoon 4.4.3 exposes authenticated business endpoints under `/wp-json/yatoon/v1`.
Use WordPress Application Passwords over HTTPS for external integrations, or a
logged-in WordPress session with an `X-WP-Nonce` header for same-site tools.
The WordPress user must also have the matching Yatoon capability.

## Scheduling authority

- Local mode: authorized API clients may create and reschedule bookings. Yatoon
  recalculates price and tax and rechecks staff, location rules, hours, breaks,
  time off, external calendar busy periods, group sessions, and resources.
- Square or Vagaro mode: the API refuses scheduling/status writes with HTTP 409.
  Use the synchronized workflow or external platform so its store timezone and
  calendar remain authoritative.
- Paid bookings cannot be moved through the API when the new assignment changes
  the payable price.

## Endpoints

| Method | Path | Purpose |
| --- | --- | --- |
| GET, POST | `/bookings` | List or create Local-mode bookings |
| GET, PATCH, PUT, DELETE | `/bookings/{id}` | Read, update, or cancel |
| GET, POST | `/services`, `/staff`, `/locations`, `/customers` | List or create directory records |
| GET, PATCH, PUT, DELETE | `/{entity}/{id}` | Read, update, or safely delete a record |
| GET, POST | `/group-sessions` | List or create Local-mode capacity sessions |
| PATCH, PUT, DELETE | `/group-sessions/{id}` | Update or cancel a session |
| GET | `/group-sessions/{id}/attendees` | List attendees for staff operations |

Direct Square and Stripe provider refunds are available in Pro. Collection
endpoints accept `page`, `per_page`, and `search`; booking lists also accept
status, staff, service, location, and date filters.

Never expose an Application Password in browser JavaScript. Rotate it when an
integration is retired, and disable the REST API module if the site does not use
external integrations.
