> For the complete documentation index, see [llms.txt](https://docs.hostelmate.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hostelmate.co/api-documentation/booking-engine.md). Agents can also search and read this documentation through its [MCP server](https://docs.hostelmate.co/~gitbook/mcp).

# Booking Engine

Build your own booking flow with the Hostel Mate API. Check availability and prices for a stay, then create the booking, using your API key.

Build your own booking flow on your website. You need two calls:

1. **Check availability** for the guest's stay: which rooms can be booked, and for how much.
2. **Create the booking** for the room the guest picks.

Both use your API key. See [Authentication](https://docs.hostelmate.co/api-documentation/authentication.md).

### Related API Pages

* [API Authentication](https://docs.hostelmate.co/api-documentation/authentication.md)
* [Availability](https://docs.hostelmate.co/api-documentation/availability.md)
* [Rates Calendar](https://docs.hostelmate.co/api-documentation/rates.md)
* [Booking Create](https://docs.hostelmate.co/api-documentation/bookings/create.md)
* [Booking List](https://docs.hostelmate.co/api-documentation/bookings/list.md)
* [Payments](https://docs.hostelmate.co/api-documentation/payments.md)

#### Step 1: Check availability

```http
GET /api/v1/client/availability
```

```bash
curl "https://api.hostelmate.co/api/v1/client/availability?check_in=2026-11-02&check_out=2026-11-05&guests=2" \
  -H "X-API-Key: <your_api_key>"
```

<table><thead><tr><th width="120">Parameter</th><th width="100">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>check_in</code></td><td>string</td><td><strong>Required.</strong> First night of the stay (YYYY-MM-DD).</td></tr><tr><td><code>check_out</code></td><td>string</td><td><strong>Required.</strong> Departure day (YYYY-MM-DD). A stay from the 2nd to the 5th is 3 nights.</td></tr><tr><td><code>guests</code></td><td>integer</td><td>Number of guests, 1 to 50 (default: 1).</td></tr></tbody></table>

You get every room your booking page shows. For each room:

* whether the whole stay can be booked (`bookable`);
* the total;
* each night's price and free beds.

It's the same answer your own booking page gives a guest for those dates. Prices are integers in minor units: `2500` = 25.00.

The answer also carries your rooms' photos and descriptions, your property details, payment methods and booking page settings, so you can build the whole page from this one call.

Every field, rule and error code is on the [Availability](https://docs.hostelmate.co/api-documentation/availability.md) page.

#### Step 2: Create the booking

Pick a room with `"bookable": true` and send it to [Booking Create](https://docs.hostelmate.co/api-documentation/bookings/create.md). [From availability to a booking](https://docs.hostelmate.co/api-documentation/availability.md#from-availability-to-a-booking) explains:

* how to pass the nights and prices;
* what to do for several guests in a dorm;
* what to do if the beds are taken in between.

***

> **Note: `POST /api/v1/get-new-avilablilty` is a legacy endpoint and will be retired soon.** It still works for now, but it gets no new features.
>
> If you're still using `get-new-avilablilty`, please move to [Availability](https://docs.hostelmate.co/api-documentation/availability.md). You only change the URL to `https://api.hostelmate.co/api/v1/client/availability` and add your `X-API-Key` header. Your request body and your code stay the same: every field you read today comes back with the same name and value, and photo links point to the same photos on `cdn.hostelmate.co`. See [Moving from get-new-avilablilty](https://docs.hostelmate.co/api-documentation/availability.md#moving-from-get-new-avilablilty).
