Hotel API (v2)

Download OpenAPI specification:Download

Hotel

These endpoints provide comprehensive functionality for managing hotel bookings. They enable users to search for hotels, check room rates and availability, create and modify bookings, and handle cancellations and rebooking.

Get hotel search results

Get all available hotels for the requested search parameters.

SecurityBearer
Request
Request Body schema: application/json
required
object (HotelSearchParams)

The parameters required for searching hotels.

object (HotelSearchFilters)

Filters to refine the search result. Based on the user selected filters, the list of matching hotels will be displayed.

Array of objects (Hotel Sort Options)

Sort options for the search results.

required
UserId Search (object) or RegistrarUserId Search (object) (HotelUserId)
PageToken (object) or PageSize (object) (TokenBasedPaginationRequest)
Responses
200

OK

401

Unauthorized

403

Forbidden

404

The specified resource was not found.

post/v2/hotel/search
Request samples
application/json
{
  • "searchParams": {
    },
  • "filters": {
    },
  • "sortOptions": [
    ],
  • "userId": {
    },
  • "paginationParams": {
    }
}
Response samples
application/json
{
  • "hotels": [
    ],
  • "metadata": {
    },
  • "paginationParams": {
    }
}

Get hotel details

Get details for a specific hotel.

SecurityBearer
Request
Request Body schema: application/json
hotelDetailsKey
required
string

A unique identifier for the hotel details.

object (CorporateInfoV2)

Corporate information related to the hotel booking.

object (OccupancyDates)

Occupancy values and dates for the hotel details.

object (HotelDetailsFilters)

Filters to apply when fetching hotel details.

UserId Search (object) or RegistrarUserId Search (object) (HotelUserId)
Responses
200

OK

401

Unauthorized

403

Forbidden

404

The specified resource was not found.

post/v2/hotel/details
Request samples
application/json
{
  • "hotelDetailsKey": "string",
  • "corporateInfo": {
    },
  • "occupancyDates": {
    },
  • "filters": {
    },
  • "userId": {
    }
}
Response samples
application/json
{
  • "hotelSpec": {
    },
  • "rooms": [
    ],
  • "bookedRooms": [
    ],
  • "occupancyDates": {
    },
  • "rateStatistics": {
    },
  • "showOnlyBaseFare": true,
  • "preferences": [
    ],
  • "termsAndConditions": []
}

Verify hotel price

Checks if the previously selected hotel price has been modified. To indicate the change in hotel price, the priceChange field in the response will be set to true and the price object will contain the latest hotel price. If the price remains unchanged, the priceChange field will be set as false and the price object will contain the original price.

SecurityBearer
Request
Request Body schema: application/json
priceValidateKey
required
string

The key used to validate the price.

tripId
string

The trip ID for the booking.

Responses
200

OK

401

Unauthorized

403

Forbidden

404

The specified resource was not found.

post/v2/hotel/price-check
Request samples
application/json
{
  • "priceValidateKey": "string",
  • "tripId": "string"
}
Response samples
application/json
{
  • "bookingKey": "string",
  • "timeout": 0,
  • "priceChange": true,
  • "price": {
    }
}

Validate rebooking for price optimization

Validates if a hotel rebooking can be performed for price optimization purpose. The Source PNR ID provided in the request will be checked if it's eligible for rebooking. In the response, if isValid is true then users can proceed to checkout flow, which cancels the existing Source PNR and creates a new PNR to save booking cost.

SecurityBearer
Request
Request Body schema: application/json
cancelSourcePnrId
required
string

Source PNR ID that needs to be validated.

required
Array of objects (Traveler)

List of travelers

required
object (TripId)

The unique ID created for the respective trip.

Responses
200

OK

401

Unauthorized

403

Forbidden

404

The specified resource was not found.

post/v2/hotel/validate-rebooking
Request samples
application/json
{
  • "cancelSourcePnrId": "1cf76aba18e4015f",
  • "travelers": [
    ],
  • "tripId": {
    }
}
Response samples
application/json
{
  • "isValid": true,
  • "spotnanaPnrId": "1cf76aba18e4015f"
}

Create a new hotel booking

Creates a new hotel booking for the given request parameters.

SecurityBearer
Request
Request Body schema: application/json
bookingKey
required
string

The booking key for the hotel booking.

required
Array of objects (Travelers)

The list of travelers and their details. The traveler at index 0 will be considered as the primary traveler and their details will be passed to the supplier.

required
object (TripData)

Trip data to book a PNR.

object (PreBookAnswers)
required
object (BookingPaymentDetails)

Payment details used for booking.

required
object (BookingContact)
object (HotelSpecialRequests)

Hotel special requests

cancelSourcePnrId
string

The source PNR ID within the booking source that needs to be canceled in favor of the new booking that is being created.

object (HotelRateAssuranceMetadata)

Savings information from the rate assurance rebooking

Responses
200

OK

401

Unauthorized

403

Forbidden

404

The specified resource was not found.

post/v2/hotel/create-pnr
Request samples
application/json
{
  • "bookingKey": "example_booking_key",
  • "travelers": [
    ],
  • "tripData": {
    },
  • "preBookAnswers": {
    },
  • "bookingPaymentDetails": {
    },
  • "bookingContact": {
    },
  • "hotelSpecialRequests": {
    },
  • "cancelSourcePnrId": "ABC123",
  • "hotelRateAssuranceInfo": {
    }
}
Response samples
application/json
{
  • "pnrId": "7373737373",
  • "pnrStatus": "SUCCESS",
  • "externalPnrId": "ABC123"
}

Cancel hotel pnr

This endpoint deletes a pnr by pnrID.

SecurityBearer
Request
path Parameters
pnrId
required
string

Pnr Id of the Pnr to be cancelled.

Example: 4974a66b
Responses
200

OK

401

Unauthorized

403

Forbidden

404

The specified resource was not found.

post/v2/hotel/pnrs/{pnrId}/cancel-pnr
Request samples
Response samples
application/json
{
  • "confirmationId": "231241232"
}

Modify hotel details

Modify the details of an existing hotel booking. This API displays the list of modifications available for the same hotel. Currently, the details such as occupancy date and room type can be modified. To confirm the selected changes, use the Modify hotel booking API.

SecurityBearer
Request
path Parameters
pnrId
required
string

PNR ID of the hotel booking for which the details need to be modified.

Example: 4974a66b
Request Body schema: application/json
required
object (OccupancyDates)

Occupancy values and dates for the hotel details.

object (CorporateInfoV2)

Corporate information related to the hotel booking.

Responses
200

OK

401

Unauthorized

403

Forbidden

404

The specified resource was not found.

post/v2/hotel/pnrs/{pnrId}/modify-details
Request samples
application/json
{
  • "occupancyDates": {
    },
  • "corporateInfo": {
    }
}
Response samples
application/json
{
  • "hotelSpec": {
    },
  • "rooms": [
    ],
  • "bookedRooms": [
    ],
  • "occupancyDates": {
    },
  • "rateStatistics": {
    },
  • "showOnlyBaseFare": true,
  • "preferences": [
    ],
  • "termsAndConditions": []
}

Modify hotel booking

Modify an existing hotel booking based on the request parameters. This API is used to confirm the requested changes for the booking.

SecurityBearer
Request
path Parameters
pnrId
required
string

PNR ID of the hotel booking that needs to be modified.

Example: 4974a66b
Request Body schema: application/json
bookingKey
required
string

The booking key for the hotel booking

required
Array of objects (Travelers)

The list of travelers, the first traveler is considered as primary traveler

required
object (TripData)

Trip data to book a PNR.

object (PreBookAnswers)
object (HotelSpecialRequests)

Hotel special requests

object (BookingPaymentDetails)

Payment details used for booking.

required
object (BookingContact)
Responses
200

OK

401

Unauthorized

403

Forbidden

404

The specified resource was not found.

post/v2/hotel/pnrs/{pnrId}/modify-book
Request samples
application/json
{
  • "bookingKey": "example_booking_key",
  • "travelers": [
    ],
  • "tripData": {
    },
  • "preBookAnswers": {
    },
  • "hotelSpecialRequests": {
    },
  • "bookingPaymentDetails": {
    },
  • "bookingContact": {
    }
}
Response samples
application/json
{
  • "pnrId": "7373737373",
  • "pnrStatus": "CONFIRMED",
  • "externalPnrId": "ABC123"
}
Copyright © 2020-2024 Spotnana Technology, Inc.