# Booking Engine

### Tap into the Availability API

Have you ever dreamt of building a delightfully custom booking experience straight on your own website's frontend? You've come to the right place! With this API, you can seamlessly fetch room availability, gorgeous imagery, and pricing in the blink of an eye.

### 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>Feed us the specific dates you want to check availability for! (Format: YYYY-MM-DD).</td></tr><tr><td><code>property</code></td><td>string</td><td>Simply your unique property ID (UUID).</td></tr></tbody></table>

#### Response

Sit back and let the API deliver exactly what you need. It will return all the available rooms, their stunning rates, right alongside helpful availability data for the selected dates.

**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>An incredibly handy array of all the wonderfully available rooms matching your dates.</td></tr><tr><td><code>days[].room_id</code></td><td>string</td><td>The securely unique identifier reserved just for this room (UUID).</td></tr><tr><td><code>days[].room_name</code></td><td>string</td><td>The catchy name of the room.</td></tr><tr><td><code>days[].room_description</code></td><td>string</td><td>A nice, descriptive text giving everyone a feel for the room.</td></tr><tr><td><code>days[].date</code></td><td>array</td><td>A tiny array bundling the date alongside the specific price tag for this room.</td></tr><tr><td><code>days[].date[].date</code></td><td>string</td><td>The exact date laid out cleanly in YYYY-MM-DD.</td></tr><tr><td><code>days[].date[].price</code></td><td>number | false</td><td>The room's price for this date! If you see 'false', it means we are sadly fully booked.</td></tr><tr><td><code>days[].image_fullpath</code></td><td>array</td><td>A wonderful array bringing gorgeous image paths directly for your UI.</td></tr><tr><td><code>name</code></td><td>string</td><td>Your brilliant property name.</td></tr><tr><td><code>city</code></td><td>string</td><td>The city your guests will be exploring.</td></tr><tr><td><code>country</code></td><td>string</td><td>Your property's home country.</td></tr><tr><td><code>postal_code</code></td><td>string</td><td>The local postal code.</td></tr><tr><td><code>payment_gateway</code></td><td>object</td><td>A little section outlining your payment gateway setup.</td></tr><tr><td><code>payment_gateway.status</code></td><td>boolean</td><td>A simple flip letting you know if the payment setup is live.</td></tr><tr><td><code>payment_gateway.currency</code></td><td>string</td><td>Your home currency (e.g., "gbp").</td></tr><tr><td><code>payment_gateway.options</code></td><td>array</td><td>A neat list showing which payment options guests can choose.</td></tr><tr><td><code>state</code></td><td>string</td><td>The gorgeous state or province you reside in.</td></tr><tr><td><code>rate</code></td><td>string</td><td>Your stellar property rating.</td></tr><tr><td><code>phone</code></td><td>string</td><td>A quick ring! This is your property phone number.</td></tr><tr><td><code>description</code></td><td>string</td><td>The inviting general property description.</td></tr><tr><td><code>googleMapLink</code></td><td>string</td><td>A fantastic direct Google Maps link. Great for tired travelers!</td></tr><tr><td><code>address</code></td><td>string</td><td>The complete address telling them precisely where to go.</td></tr><tr><td><code>website</code></td><td>string</td><td>Your beautifully built property website URL.</td></tr><tr><td><code>main-image</code></td><td>string</td><td>The very crucial URL pointing straight to your stunning main property image.</td></tr><tr><td><code>howToReachUsLink</code></td><td>string</td><td>That handy link providing step-by-step directions to reach the property safely!</td></tr></tbody></table>
