Hotel Booking Starter Kit

Hotel Booking Mock API for Frontend Development

The Hotel Booking Starter Kit is a ready-made mock REST API for travel and reservation interfaces. It returns realistic JSON for hotels, rooms, availability, bookings, a guest profile and a guest login, so you can build search results, room selection and a booking confirmation before a booking system exists. It is included with the Free plan, and you can edit every response after launching.

Free plan10 endpointsHotelsRoomsAvailabilityBookingsGuest ProfilesAuthentication

What you can build

Build the hotel, room and booking screens

These screens follow a guest from choosing a hotel to a confirmed reservation, using the kit's real endpoints.

  1. Hotel selection

    GET /hotels returns properties with city, star rating, review count and a from-price, and GET /hotels/featured fills a landing page. GET /hotels/hotel_001 returns one hotel together with its rooms.

    • GET/hotels
    • GET/hotels/featured
    • GET/hotels/hotel_001
  2. Room availability

    GET /rooms/available returns rooms with type, capacity, price per night and amenities, plus a search object holding the check-in date, check-out date and guest count. GET /rooms lists every room type.

    • GET/rooms/available
    • GET/rooms
  3. Reservation and confirmation

    POST /bookings returns 201 with a confirmed booking, including a confirmation number, nights and total, for the final step of a booking flow.

    • POST/bookings
  4. Guest bookings

    GET /bookings lists a guest's reservations and GET /bookings/booking_001 returns one with its hotel details, enough for a my-bookings page.

    • GET/bookings
    • GET/bookings/booking_001
  5. Guest sign-in and profile

    POST /auth/login returns a guest and a token, and GET /guests/me returns the guest's loyalty level, booking count and upcoming booking.

    • POST/auth/login
    • GET/guests/me

Endpoint reference

All 10 Hotel Booking endpoints

This list is generated from the kit itself. Paths match exactly, so only these paths exist after you launch it.

Hotel Booking Starter Kit endpoints
MethodPathStatusWhat it returns
GET/hotels200List hotels. Returns available hotel properties.
GET/hotels/featured200Featured hotels. Returns highlighted properties for landing pages.
GET/hotels/hotel_001200Hotel detail. Returns one hotel with its available rooms.
GET/rooms200List rooms. Returns room types and pricing.
GET/rooms/available200Available rooms. Returns rooms currently available for booking.
GET/bookings200List bookings. Returns reservations belonging to the current guest.
GET/bookings/booking_001200Booking detail. Returns one booking and its hotel information.
POST/bookings201Create booking. Simulates successfully creating a reservation.
POST/auth/login200Guest login. Simulates successful guest authentication.
GET/guests/me200Guest profile. Returns the authenticated guest profile.

Example responses

What the endpoints return

These are real responses from the kit. They are abbreviated: lists show their first item with the number of omitted items, and long text is shortened. The launched endpoint returns the full response.

List hotels

GET /hotels → 200 (abbreviated)json
{
  "data": [
    {
      "id": "hotel_001",
      "name": "Harbour View Hotel",
      "slug": "harbour-view-hotel",
      "city": "Brighton",
      "country": "United Kingdom",
      "rating": 4.7,
      "review_count": 842,
      "stars": 4,
      "description": "Modern seafront hotel with spacious rooms, breakfast and ocean views.",
      "amenities": [
        "Wi-Fi"
        // ... 3 more items in the full response
      ],
      "image_url": "https://images.example.com/hotels/harbour-view.jpg",
      "price_from": 129,
      "currency": "GBP"
    }
    // ... 1 more item in the full response
  ],
  "pagination": {
    "page": 1,
    "per_page": 10,
    "total_items": 2,
    "total_pages": 1
  }
}

Available rooms

GET /rooms/available → 200 (abbreviated)json
{
  "data": [
    {
      "id": "room_001",
      "hotel_id": "hotel_001",
      "name": "Deluxe Sea View",
      "type": "double",
      "sleeps": 2,
      "beds": 1,
      "price_per_night": 159,
      "currency": "GBP",
      "available": true,
      "amenities": [
        "Sea view"
        // ... 3 more items in the full response
      ]
    }
    // ... 1 more item in the full response
  ],
  "search": {
    "check_in": "2026-09-14",
    "check_out": "2026-09-17",
    "guests": 2
  }
}

Create booking

POST /bookings → 201json
{
  "success": true,
  "message": "Booking confirmed.",
  "data": {
    "id": "booking_002",
    "confirmation_number": "FGA-93562",
    "hotel_id": "hotel_001",
    "room_id": "room_002",
    "check_in": "2026-10-03",
    "check_out": "2026-10-05",
    "nights": 2,
    "guests": 3,
    "total": 418,
    "currency": "GBP",
    "status": "confirmed"
  }
}

Call the endpoints

curl and fetch examples

These URLs only work after you launch the kit, because the kit then exists in your own project. Replace YOUR_PROJECT_KEY with the project key shown in your dashboard.

Terminal: GET /rooms/availablebash
curl -i \
  https://apis.getforgeapi.com/YOUR_PROJECT_KEY/rooms/available
Terminal: POST /bookingsbash
curl -i \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{"hotel_id":"hotel_001","room_id":"room_002","check_in":"2026-10-03","check_out":"2026-10-05","guests":3}' \
  https://apis.getforgeapi.com/YOUR_PROJECT_KEY/bookings
fetch: GET /hotelsts
const API_BASE_URL = "https://apis.getforgeapi.com/YOUR_PROJECT_KEY";

const response = await fetch(API_BASE_URL + "/hotels");

if (!response.ok) {
  throw new Error("Request failed with status " + response.status);
}

const json = await response.json();
// json.data is the array of hotels; json.pagination describes the page.

More request examples are in Calling endpoints.

Frontend example

A React room picker with a booking call

This component loads the available rooms and sends a booking. The mock returns the same rooms and the same search dates whatever dates you request, so the date inputs below only demonstrate the request.

RoomPicker.tsxtsx
import { useEffect, useState } from "react";

const API_BASE_URL = import.meta.env.VITE_API_BASE_URL;

async function apiGet<T>(path: string): Promise<T> {
  const response = await fetch(API_BASE_URL + path);

  if (!response.ok) {
    throw new Error("GET " + path + " failed with status " + response.status);
  }

  return response.json() as Promise<T>;
}

async function apiPost<T>(path: string, body: unknown): Promise<T> {
  const response = await fetch(API_BASE_URL + path, {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify(body),
  });

  if (!response.ok) {
    throw new Error("POST " + path + " failed with status " + response.status);
  }

  return response.json() as Promise<T>;
}

type Room = {
  id: string;
  name: string;
  price_per_night: number;
  currency: string;
  available: boolean;
};

export function RoomPicker() {
  const [rooms, setRooms] = useState<Room[]>([]);
  const [confirmation, setConfirmation] = useState("");
  const [error, setError] = useState("");

  useEffect(() => {
    apiGet<{ data: Room[] }>("/rooms/available")
      .then((json) => setRooms(json.data))
      .catch(() => setError("Could not load rooms."));
  }, []);

  async function book(room: Room) {
    try {
      const json = await apiPost<{ data: { confirmation_number: string } }>(
        "/bookings",
        {
          hotel_id: "hotel_001",
          room_id: room.id,
          check_in: "2026-10-03",
          check_out: "2026-10-05",
          guests: 3,
        },
      );

      setConfirmation(json.data.confirmation_number);
    } catch {
      setError("Could not complete the booking.");
    }
  }

  if (error) return <p>{error}</p>;
  if (confirmation) return <p>Booking confirmed: {confirmation}</p>;

  return (
    <ul>
      {rooms.map((room) => (
        <li key={room.id}>
          {room.name} - {room.currency} {room.price_per_night} per night
          <button onClick={() => book(room)}>Book</button>
        </li>
      ))}
    </ul>
  );
}

Keep the base URL in an environment variable such as VITE_API_BASE_URL or NEXT_PUBLIC_API_BASE_URL. When your real backend is ready, change that value; if it keeps the same paths and response shapes, your components do not need to change. The Create a REST API Online tutorial walks through that handover.

Accurate expectations

What this mock does and does not do

Every Starter Kit

  • Responses are static. Each endpoint returns the JSON configured for it, so the same request always gets the same response.
  • Paths match exactly. Only the paths listed in the endpoint reference exist, and there are no automatic dynamic route parameters.
  • There is no automatic filtering, sorting or pagination. Query strings are not used to choose a response, so adding ?page=2 returns the same response.
  • Nothing is saved. POST, PUT, PATCH and DELETE endpoints return the response configured for them, and request bodies are not stored.
  • Response delays and required request headers are available on paid plans. You can edit an endpoint's JSON and status code after launching the kit.

The Hotel Booking kit

  • GET /rooms/available returns the same rooms and the same search dates whatever dates you request, so there is no date filtering.
  • Detail endpoints exist for one hotel (hotel_001) and one booking (booking_001). Other ids are not recognised.
  • POST /bookings returns a confirmation but does not reserve anything, so GET /bookings is unchanged afterwards.

Project and endpoint limits depend on your plan. See API limits for the current allowances.

Related Starter Kits and guides

Looking for a different kit? Browse all ready-made mock APIs.

Frequently asked questions

Hotel Booking Starter Kit questions

Which plan includes the Hotel Booking kit?

The Free plan and every paid plan include it. It is not part of the no-account demo, so create a free account to launch it.

Does the availability endpoint filter by date?

No. GET /rooms/available always returns the same rooms and the same check-in, check-out and guest values in its search object. To show different availability, edit the JSON of the endpoint in your project.

Does POST /bookings reserve a room?

No. It returns the confirmed booking configured for it with a 201 status. Nothing is stored, so GET /bookings does not change.

Can I add more hotels or rooms?

Edit the JSON of the list endpoints to include more. Each hotel or room detail page needs its own endpoint, and the Free plan allows 10 endpoints per project, which the kit already uses, so edit existing endpoints rather than adding new ones.

Build against Hotel Booking today

Included with the Free plan and every paid plan. Launch the kit, call its hosted URLs and edit the responses to match your frontend.