# Bookings

Visitors pick a free time from your Google Calendar and book right on your page. The appointment then sits in both calendars, with a Meet link if you like.

Source: https://sharepa.ai/en/docs/bookings

## Requirements

1. **One-time plan**: Bookings are part of the [one-time plan](https://sharepa.ai/en/einmal-plan).
2. **Connect Google Calendar**: In the app under Settings › Bookings. sharepa only sees when you are busy.
3. **Create a booking type**: Name, length, weekly times, buffers, location. Every type has a short name like `erstgespraech` that the code uses.
4. **Code with `window.sharepaTermine`**: No form and no external booking widget. The code only talks to the interface below.

If the page has no booking type when it is published, sharepa assigns all active types of your account to it. You can narrow this down in the app on the page under Settings › Bookings, or in the chat with the connector (`set_page_booking`).

> **No booking type, no times**
>
> If the account has no active booking type, `typen()` fails with `termine.aus`. The page should then show "Bookings are not set up for this page yet." instead of loading forever.

## Flow on the page

1. Wait until `window.sharepaTermine` exists.
2. `typen()` loads the booking types of the page.
3. `zeiten(type, from, to)` loads free start times.
4. The visitor picks a time and enters name and email.
5. `buchen({ … })` books. sharepa briefly shows a security check.

## Example

```js
const TYPE = "erstgespraech";
const format = new Intl.DateTimeFormat(undefined, {
  weekday: "short", day: "numeric", month: "long", hour: "2-digit", minute: "2-digit",
});
const day = (d) => d.toISOString().slice(0, 10);

function ready(fn) {
  if (window.sharepaTermine) fn();
  else document.addEventListener("sharepaTermine", fn, { once: true });
}

ready(async () => {
  const today = new Date();
  const until = new Date(today.getTime() + 13 * 86400000);
  const { slots } = await sharepaTermine.zeiten(TYPE, day(today), day(until));
  for (const start of slots) showTime(start, format.format(new Date(start)));
});

async function book(start, name, email) {
  await sharepaTermine.buchen({
    type: TYPE, start, location: "meet", name, email,
    answers: { topic: "…" },
  });
}
```

A complete example in HTML and React is in the [guide](https://sharepa.ai/en/guides/bookings#for-people-who-build-by-hand). All methods and error codes are in the [reference](https://sharepa.ai/en/docs/reference/bookings).

## Time zones

`zeiten()` returns start times in UTC, such as `2026-11-03T09:00:00Z`. Show them with `Intl.DateTimeFormat` without a time zone, and every visitor sees their own time. `from` and `to` are calendar days in your time zone, `to` is included.

## What happens after a booking

- The person booking gets a confirmation with a link to cancel, and an invitation in their calendar.
- You get an email with all details. The appointment is in your Google Calendar, with a new Meet link for Google Meet.
- The booking shows up as an entry in the app and goes to your webhook, if you have one.
- A reminder goes out 24 hours before, if there were more than 24 hours left at the time of booking.

## Limits

Every booking counts as an entry, so the limits of [forms](https://sharepa.ai/en/docs/forms#limits) apply. On top of that, at most 50 bookings per account and day. `from` and `to` are at most 31 days apart.

## Related guides

- [Bookings on your page, with Google Calendar](https://sharepa.ai/en/guides/bookings)
- [Booking page on your website: a GDPR-friendly alternative to the Calendly widget](https://sharepa.ai/en/articles/booking-page-website)
- [Publishing from the chat](https://sharepa.ai/en/guides/mcp-connector)
