POST /api/Bookings

Sample request:

POST /booking { "roomsId": ["31d26773-2eb9-4695-bc61-0b717bd97e0b", "54a26773-2eb9-4695-bc61-0b717bd97e0b"], "hotelId": "46c26773-2eb9-4695-bc61-0b717bd97e0b", "checkInDate": "2024-01-10", "checkOutDate": "2024-01-15", "numberOfAdults": 1, "numberOfChildren": 1, "userRemarks": "I need a baby cot.", "paymentMethod": "CreditCard" }

Body

The data for the new booking

  • roomIds array[string(uuid)] | null

    List of Id's of the desired Rooms

  • hotelId string(uuid)

    the desired Hotel Id

  • numberOfAdults integer(int32)

    Number of adults staying in the room

  • numberOfChildren integer(int32)

    Number of children staying in the room

  • checkInDate string(date-time)

    Check-in date in UTC

  • checkOutDate string(date-time)

    Check-out date in UTC

  • userRemarks string | null

    User special requests or remarks

  • paymentMethod string | null

    Payment method (Cash, Credit Card, Bank Transfer)

  • Additional properties are NOT allowed

Body

The data for the new booking

  • roomIds array[string(uuid)] | null

    List of Id's of the desired Rooms

  • hotelId string(uuid)

    the desired Hotel Id

  • numberOfAdults integer(int32)

    Number of adults staying in the room

  • numberOfChildren integer(int32)

    Number of children staying in the room

  • checkInDate string(date-time)

    Check-in date in UTC

  • checkOutDate string(date-time)

    Check-out date in UTC

  • userRemarks string | null

    User special requests or remarks

  • paymentMethod string | null

    Payment method (Cash, Credit Card, Bank Transfer)

  • Additional properties are NOT allowed

Body

The data for the new booking

  • roomIds array[string(uuid)] | null

    List of Id's of the desired Rooms

  • hotelId string(uuid)

    the desired Hotel Id

  • numberOfAdults integer(int32)

    Number of adults staying in the room

  • numberOfChildren integer(int32)

    Number of children staying in the room

  • checkInDate string(date-time)

    Check-in date in UTC

  • checkOutDate string(date-time)

    Check-out date in UTC

  • userRemarks string | null

    User special requests or remarks

  • paymentMethod string | null

    Payment method (Cash, Credit Card, Bank Transfer)

  • Additional properties are NOT allowed

Responses

  • Success

    Hide response attributes Show response attributes object
    • confirmationId string(uuid)
    • checkInDate string(date)
    • checkOutDate string(date)
    • price number(double)
    • numberOfAdults integer(int32)
    • numberOfChildren integer(int32)
    • roomNumbers array[integer(int32)] | null
    • guestFullName string | null
    • guestId string(uuid)
    • hotelName string | null
    • hotelId string(uuid)
    • Additional properties are NOT allowed
    Hide response attributes Show response attributes object
    • confirmationId string(uuid)
    • checkInDate string(date)
    • checkOutDate string(date)
    • price number(double)
    • numberOfAdults integer(int32)
    • numberOfChildren integer(int32)
    • roomNumbers array[integer(int32)] | null
    • guestFullName string | null
    • guestId string(uuid)
    • hotelName string | null
    • hotelId string(uuid)
    • Additional properties are NOT allowed
    Hide response attributes Show response attributes object
    • confirmationId string(uuid)
    • checkInDate string(date)
    • checkOutDate string(date)
    • price number(double)
    • numberOfAdults integer(int32)
    • numberOfChildren integer(int32)
    • roomNumbers array[integer(int32)] | null
    • guestFullName string | null
    • guestId string(uuid)
    • hotelName string | null
    • hotelId string(uuid)
    • Additional properties are NOT allowed
  • 201

    Returns the newly created booking

  • 400

    If the request data is invalid

  • 401

    If the user is not authenticated

  • 403

    If the user is not authorized

  • 404

    If the hotel/room or guest is not found

POST /api/Bookings
curl \
 -X POST http://api.example.com/api/Bookings \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: application/json" \
 -d '{"roomIds":["string"],"hotelId":"string","numberOfAdults":42,"numberOfChildren":42,"checkInDate":"2024-05-04T09:42:00+00:00","checkOutDate":"2024-05-04T09:42:00+00:00","userRemarks":"string","paymentMethod":"string"}'
curl \
 -X POST http://api.example.com/api/Bookings \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: text/json"
curl \
 -X POST http://api.example.com/api/Bookings \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: application/*+json"
Request example
{
  "roomIds": [
    "string"
  ],
  "hotelId": "string",
  "numberOfAdults": 42,
  "numberOfChildren": 42,
  "checkInDate": "2024-05-04T09:42:00+00:00",
  "checkOutDate": "2024-05-04T09:42:00+00:00",
  "userRemarks": "string",
  "paymentMethod": "string"
}
Request examples
{
  "roomIds": [
    "string"
  ],
  "hotelId": "string",
  "numberOfAdults": 42,
  "numberOfChildren": 42,
  "checkInDate": "2025-05-04T09:42:00Z",
  "checkOutDate": "2025-05-04T09:42:00Z",
  "userRemarks": "string",
  "paymentMethod": "string"
}
Request examples
{
  "roomIds": [
    "string"
  ],
  "hotelId": "string",
  "numberOfAdults": 42,
  "numberOfChildren": 42,
  "checkInDate": "2025-05-04T09:42:00Z",
  "checkOutDate": "2025-05-04T09:42:00Z",
  "userRemarks": "string",
  "paymentMethod": "string"
}
Response examples (200)
{
  "confirmationId": "string",
  "checkInDate": "2024-05-04",
  "checkOutDate": "2024-05-04",
  "price": 42.0,
  "numberOfAdults": 42,
  "numberOfChildren": 42,
  "roomNumbers": [
    42
  ],
  "guestFullName": "string",
  "guestId": "string",
  "hotelName": "string",
  "hotelId": "string"
}
Response examples (200)
{
  "confirmationId": "string",
  "checkInDate": "2025-05-04",
  "checkOutDate": "2025-05-04",
  "price": 42.0,
  "numberOfAdults": 42,
  "numberOfChildren": 42,
  "roomNumbers": [
    42
  ],
  "guestFullName": "string",
  "guestId": "string",
  "hotelName": "string",
  "hotelId": "string"
}