2 λεπτά ανάγνωσης

# Bookings through the API

**With the** **[REST API](https://www.bookingmood.com/en-US/api-reference)****, your own application can check availability and create, change and cancel bookings in Bookingmood. Use it when bookings have to follow rules Bookingmood doesn't know, such as quotas per member: your application checks those rules, and Bookingmood checks availability, restrictions and prices.**

Create an API key under _[Settings](https://www.bookingmood.com/admin/organizations/-/settings/api-keys)_ › _[API keys](https://www.bookingmood.com/admin/organizations/-/settings/api-keys)_, see [Developers](https://www.bookingmood.com/en-US/docs/developers). Booking needs `bookings:write`, checking availability `products:read`. Call the API from your server only: anyone with the key can book.

## [Check availability](#check-availability)

`GET /availability?product_ids=…` returns per unit which dates are available, booked or closed. To check one stay as Bookingmood would when booking it, including restrictions such as the minimum stay and the number of guests, send it to `POST /cart-validate`.

## [Create a booking](#create-a-booking)

- Check your own rules first, for example whether the member still has nights left.
- Send the stay to `POST /cart-checkout`. Each item has the `product_id`, the `interval` (arrival and departure date), the `occupancy` and the `form_values` of the [booking form](https://www.bookingmood.com/en-US/docs/booking-form).
- Bookingmood checks availability again, calculates the price and creates the booking. The response holds the booking's `booking_id` and `reference`, and a `payment_url` when the unit asks for an online payment first: the booking is then completed once that payment is made.

The booking gets the status the unit gives new bookings, see [Booking requests vs instant bookings](https://www.bookingmood.com/en-US/docs/bookings/booking-requests-vs-instant-bookings). Confirmation emails and [scheduled messages](https://www.bookingmood.com/en-US/docs/guest-communication/message-schedule) go out as for any other booking.

### [Several units in one booking](#several-units-in-one-booking)

Put one item per unit in the same `POST /cart-checkout` request, for example three rooms for the same nights. They become one booking with one invoice. `POST /book` is a shortcut for a single unit.

To rent a whole house as well as its rooms, create the house as a unit of its own and [link it](https://www.bookingmood.com/en-US/docs/units/main-and-sub-units) to the rooms: booking the house blocks the rooms, and booking a room blocks the house.

## [Change or cancel a booking](#change-or-cancel-a-booking)

The stays of a booking are its calendar events.

- To cancel a stay, set its `status` to `CANCELLED` with `PATCH /calendar_events?id=eq.…`. Its dates become available again right away.
- To change the dates, set `start_date` and `end_date` the same way. Bookingmood doesn't check availability or recalculate the price when you do: check `GET /availability` first, and recompute the price on the booking in Bookingmood if it should change.

## [Keep bookings going through your application](#keep-bookings-going-through-your-application)

Your rules only apply to bookings your application makes. To make sure guests can't book around them:

- Don't put a widget or website with the _Book_ interaction online. Set the _Interaction_ of your widgets to _None_ to only show availability, or to _[Link to URL](https://www.bookingmood.com/en-US/docs/channels/link-to-url)_ to send guests to your application. See [Widget settings](https://www.bookingmood.com/en-US/docs/channels/widget-settings#interaction).
- Keep the API key on your server, never in a website or app.
- Only give Bookingmood access to people who manage bookings: admins can create any booking in Bookingmood itself.

## [Keep other calendars up to date](#keep-other-calendars-up-to-date)

To copy bookings to another system as they happen, for example to write them into Google Calendar, use [webhooks](https://www.bookingmood.com/en-US/docs/developers/webhooks): `calendar_events.created`, `calendar_events.updated` and `calendar_events.cancelled` tell your application which stay changed. [iCal feeds](https://www.bookingmood.com/en-US/docs/synchronization/ical) also work, but the other system decides how often it reads them.

Τελευταία τροποποίηση 26 Νοεμβρίου 2026
