Booking Hold and Resume
Rapid's Hold and Resume functionality gives you the ability to support a 2-step booking model.
Please see here for more information on Hold and Resume.
1. Shop
Get availability
List<Property> propertyList = rapidClient.getAvailability(
"YYYY-MM-DD",
"YYYY-MM-DD",
"USD",
"LANGUAGE",
"US",
List.of("OCCUPANCY"),
List.of("PROPERTY ID"),
BigDecimal.ONE,
"SALES-CHANNEL",
"SALES-ENV",
"CUSTOMER-IP"
);
Check room prices
Property property = propertyList.get(0);
if (property instanceof PropertyAvailability) {
PropertyAvailability propertyAvailability = (PropertyAvailability) property;
RoomPriceCheck roomPriceCheck = rapidClient.priceCheck(
"PROPERTY ID",
propertyAvailability.getRooms().get(0).getId(),
propertyAvailability.getRooms().get(0).getRates().get(0).getId(),
getPriceCheckToken(propertyAvailability)
);
}
2. Book
Create itinerary
ItineraryCreation itineraryCreation = rapidClient.postItinerary(
"CUSTOMER IP",
getPostItineraryToken(roomPriceCheck),
createItineraryRequest(true)
);
Resume on-hold booking
rapidClient.putResumeBooking(
"CUSTOMER IP",
itineraryCreation.getItineraryId(),
getResumeBookingToken(itineraryCreation)
);