Skip to main content

API and webhooks

TheBooking exposes a versioned REST API for reading and mutating booking data and outbound webhooks for receiving plugin events.

Base URL​

https://example.com/wp-json/thebooking/v1/API/

Only routes in the public /API/ namespace are supported for external clients. WordPress administration routes under /backend/ are internal implementation details.

Start here​

  1. Create a scoped token under Settings > API & Webhooks.
  2. Verify authentication.
  3. Read the integration workflows and the guide of each resource: availability, services, providers, customers, and reservations.
  4. Browse the API reference for routes, parameters, request examples, and response examples.
  5. Add signed webhooks when the external system needs event-driven updates.

The machine-readable contract remains available as OpenAPI 3.1 YAML.

API reference sections​

Response envelope​

Successful responses include status: "OK". List operations and auth/verify/ return their result in response; creation operations return the new id; edit and remove operations return only the status.

Errors of TheBooking have this shape. A missing or invalid token, or a missing scope, returns the standard WordPress REST error instead, with code, message, and data.status.

{
"status": "KO",
"message": "Human-readable error"
}

Authentication failures are WordPress REST errors with HTTP 401; insufficient scope returns 403.