# Booking Engine

### Use the Availability API

If you want to build a fully custom booking experience on your frontend, you can fetch room availability directly via the public API.

### Related API Pages

* [API Authentication](https://docs.hostelmate.co/api-documentation/authentication)
* [Booking List](https://docs.hostelmate.co/api-documentation/bookings-list)
* [Booking Detail](https://docs.hostelmate.co/api-documentation/bookings-get)
* [Booking Create](https://docs.hostelmate.co/api-documentation/bookings-create)
* [Booking Update](https://docs.hostelmate.co/api-documentation/bookings-update)
* [Booking Logs](https://docs.hostelmate.co/api-documentation/bookings-logs)
* [Booking Delete](https://docs.hostelmate.co/api-documentation/bookings-delete)
* [Payments](https://docs.hostelmate.co/api-documentation/payments)
* [Guest Get](https://docs.hostelmate.co/api-documentation/guests-get)
* [Guest Update](https://docs.hostelmate.co/api-documentation/guests-update)

#### Endpoint

```http
POST /api/v1/get-new-avilablilty
```

#### Example `curl` Request

```bash
curl "/api/v1/get-new-avilablilty" \
  -H "accept: application/json, text/plain, */*" \
  -H "content-type: application/json" \
  -H "origin: https://docs.hostelmate.co" \
  --data-raw '{
    "dates":["2024-10-04","2024-10-05"],
    "property":"bedb0caf-099b-4cd8-b009-7830211f3c59"
  }'
```

#### Request Payload

<table><thead><tr><th width="104.3515625">Field</th><th width="92.70703125">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>dates</code></td><td>array</td><td>Dates to check availability for (format: YYYY-MM-DD).</td></tr><tr><td><code>property</code></td><td>string</td><td>Your property ID (UUID).</td></tr></tbody></table>

#### Response

The API will return available rooms, rates, and related availability info for the specified date(s).

**Response Structure**

```json
{
    "days": [
        {
            "room_id": "265b373a-6248-4424-bf18-dc2bbf63a920",
            "room_name": "Deluxe Mixed Room",
            "room_description": "this is the room description test ",
            "date": [
                {
                    "date": "2025-10-02",
                    "price": 108
                }
            ],
            "image_fullpath": [
                "https://cdn.domain.com/room_image/oyY8W97TnEpRv7XDGCFWpIbFr.jpg",
                "https://cdn.domain.com/room_image/s2N7hsqPWECSTlGdS1JAsgS1B.jpg",
                "https://cdn.domain.com/room_image/D3HkQXEyB0w3n4bOiEVzAiwL8.jpg",
                "https://cdn.domain.com/room_image/MG30KI5I9s6GTSYMkE4C5Z3LN.jpg"
            ]
        }
    ],
    "name": "Alphatel London Bridge",
    "city": "London",
    "country": "United Kingdom",
    "postal_code": "SE1 9SG",
    "payment_gateway": {
        "status": true,
        "currency": "gbp",
        "options": [
            "nomod"
        ]
    },
    "state": "UK",
    "rate": "12",
    "phone": "+00000000000",
    "description": "",
    "googleMapLink": "https://www.google.com/maps?q=PLACEHOLDER",
    "address": "8th Floor, Building, UK",
    "website": "https://domain.com/",
    "main-image": "https://cdn.domain.com/property_image/kF3Ekirdo60z5e3r5HNCgMpBv.jpg",
    "howToReachUsLink": "https://www.google.com/maps?q=PLACEHOLDER",
}
```

**Response Fields**

<table><thead><tr><th width="272.6796875">Field</th><th width="100">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>days</code></td><td>array</td><td>Array of available rooms for the requested dates</td></tr><tr><td><code>days[].room_id</code></td><td>string</td><td>Unique identifier for the room (UUID)</td></tr><tr><td><code>days[].room_name</code></td><td>string</td><td>Name of the room</td></tr><tr><td><code>days[].room_description</code></td><td>string</td><td>Description of the room</td></tr><tr><td><code>days[].date</code></td><td>array</td><td>Array of date and price information for this room</td></tr><tr><td><code>days[].date[].date</code></td><td>string</td><td>Date in YYYY-MM-DD format</td></tr><tr><td><code>days[].date[].price</code></td><td>number | false</td><td>Room price for the selected date; ‘false’ means no availability.</td></tr><tr><td><code>days[].image_fullpath</code></td><td>array</td><td>Array of image paths for the room</td></tr><tr><td><code>name</code></td><td>string</td><td>Property name</td></tr><tr><td><code>city</code></td><td>string</td><td>City where the property is located</td></tr><tr><td><code>country</code></td><td>string</td><td>Country where the property is located</td></tr><tr><td><code>postal_code</code></td><td>string</td><td>Postal code of the property</td></tr><tr><td><code>payment_gateway</code></td><td>object</td><td>Payment gateway configuration</td></tr><tr><td><code>payment_gateway.status</code></td><td>boolean</td><td>Whether payment gateway is enabled</td></tr><tr><td><code>payment_gateway.currency</code></td><td>string</td><td>Currency code (e.g., "gbp")</td></tr><tr><td><code>payment_gateway.options</code></td><td>array</td><td>Available payment options</td></tr><tr><td><code>state</code></td><td>string</td><td>State/province where the property is located</td></tr><tr><td><code>rate</code></td><td>string</td><td>Property rating</td></tr><tr><td><code>phone</code></td><td>string</td><td>Property phone number</td></tr><tr><td><code>description</code></td><td>string</td><td>Property description</td></tr><tr><td><code>googleMapLink</code></td><td>string</td><td>Google Maps link to the property</td></tr><tr><td><code>address</code></td><td>string</td><td>Full address of the property</td></tr><tr><td><code>website</code></td><td>string</td><td>Property website URL</td></tr><tr><td><code>main-image</code></td><td>string</td><td>URL of the main property image</td></tr><tr><td><code>howToReachUsLink</code></td><td>string</td><td>Link with directions to reach the property</td></tr></tbody></table>
