V2 Prebook
The V2 prebook endpoint validates a rate from the V2 Rates response. It re-checks availability with the vendor and returns confirmed pricing. This is a required step before calling V2 Book.
The prebook request model
- Name
rate_id- Type
- string
- Description
The rate ID from a V2 rates search. This is the
idfield from any rate in the V2 Rates response.
The prebook response model
- Name
search- Type
- PrebookSearch
- Description
Original search parameters (check-in, check-out, rooms).
- Name
hotel- Type
- HotelDetails
- Description
Hotel details for the selected property.
- Name
nights- Type
- integer
- Description
Number of nights for the stay.
- Name
rooms- Type
- array of Room
- Description
Room configuration with adults, children, and children_ages.
- Name
rate- Type
- HotelRate
- Description
The validated rate with current pricing from the vendor.
- Name
remarks- Type
- string
- Description
Important booking remarks (check-in time, requirements, etc.).
- Name
rate_id- Type
- string
- Description
The rate ID to use for the V2 Book call.
PrebookSearch object
- Name
destination_id- Type
- string
- Description
Internal destination identifier (if used).
- Name
place_id- Type
- string
- Description
Google Places ID (if used).
- Name
coordinates- Type
- Coordinates
- Description
Search coordinates (if used).
- Name
radius- Type
- integer
- Description
Search radius in meters (if used).
- Name
check_in- Type
- string
- Description
Check-in date (YYYY-MM-DD).
- Name
check_out- Type
- string
- Description
Check-out date (YYYY-MM-DD).
- Name
rooms- Type
- array of RoomRequest
- Description
Room configuration from original search.
- Name
nationality- Type
- string
- Description
Guest nationality ISO 3166-1 alpha-2 country code, if provided in the original rates search.
RoomRequest object
- Name
adults- Type
- integer
- Description
Number of adults.
- Name
children- Type
- integer
- Description
Number of children.
- Name
children_ages- Type
- array of integers
- Description
Ages of children.
Room object
- Name
adults- Type
- integer
- Description
Number of adults (1-14).
- Name
children- Type
- integer
- Description
Number of children (0-6).
- Name
children_ages- Type
- array of integers
- Description
Array of child ages (0-17 each).
HotelDetails object
- Name
id- Type
- integer
- Description
Unique hotel identifier.
- Name
name- Type
- string
- Description
Hotel name.
- Name
stars- Type
- number
- Description
Star rating (1.0-5.0).
- Name
rating- Type
- number
- Description
Guest rating score.
- Name
review_count- Type
- integer
- Description
Number of guest reviews.
- Name
lowest_rate- Type
- HotelRate
- Description
The lowest priced rate for quick display.
- Name
lowest_brand_loyalty_rate- Type
- HotelRate
- Description
Lowest rate eligible for loyalty points.
- Name
minimum_age- Type
- integer
- Description
Minimum guest age requirement.
- Name
amenities- Type
- array of strings
- Description
List of hotel amenities.
- Name
check_in_begin_time- Type
- string
- Description
Earliest check-in time (HH:MM format).
- Name
check_in_end_time- Type
- string
- Description
Latest check-in time (HH:MM format).
- Name
check_out_before_time- Type
- string
- Description
Check-out deadline (HH:MM format).
- Name
description- Type
- string
- Description
Hotel description text.
- Name
images- Type
- array of strings
- Description
Array of image URLs.
- Name
coordinates- Type
- Coordinates
- Description
Geographic coordinates with lat and lng.
- Name
address- Type
- HotelAddress
- Description
Hotel address details.
- Name
type- Type
- string
- Description
Property type (e.g., "hotel", "resort").
- Name
exclusive- Type
- boolean
- Description
Whether this is an exclusive/premium property.
HotelAddress object
- Name
address- Type
- string
- Description
Street address.
- Name
city- Type
- string
- Description
City name.
- Name
country- Type
- string
- Description
Country code or name.
- Name
postal_code- Type
- string
- Description
Postal/ZIP code.
- Name
region- Type
- string
- Description
State/province/region.
HotelRate object
- Name
id- Type
- string
- Description
Unique rate identifier.
- Name
hotel_id- Type
- integer
- Description
Associated hotel ID.
- Name
rooms- Type
- array of HotelRateRoom
- Description
Room details for this rate.
- Name
price_per_night_avg- Type
- number
- Description
Average price per night.
- Name
price_per_night- Type
- array of numbers
- Description
Price for each night of the stay.
- Name
price_chargeable- Type
- number
- Description
Total amount to charge the customer.
- Name
price_per_room- Type
- array of numbers
- Description
Total price per room.
- Name
price_per_night_per_room- Type
- array of array of numbers
- Description
Price breakdown per night per room.
- Name
price_before_fees- Type
- number
- Description
Price before taxes and fees.
- Name
price_fees- Type
- number
- Description
Taxes and fees amount.
- Name
price_due_at_hotel- Type
- number
- Description
Amount payable at hotel (e.g., resort fees).
- Name
price_inclusive- Type
- number
- Description
Total inclusive price.
- Name
price_currency- Type
- string
- Description
Currency code (e.g., "USD").
- Name
price_retail- Type
- number
- Description
Retail/comparison price if available.
- Name
cancellation_policy- Type
- string
- Description
Either "Refundable" or "NonRefundable".
- Name
cancellation_policy_datetime- Type
- string
- Description
Free cancellation deadline (ISO 8601).
- Name
cancellation_policy_data- Type
- array of CancellationPolicyData
- Description
Detailed cancellation penalty schedule.
- Name
brand_loyalty_eligible- Type
- boolean
- Description
Whether loyalty points can be earned.
- Name
brand_loyalty_required- Type
- boolean
- Description
Whether loyalty number is required to book.
- Name
brand_loyalty_name- Type
- string
- Description
Loyalty program name (e.g., "Marriott Bonvoy").
- Name
elite- Type
- HotelRateElite
- Description
Elite/premium rate benefits if applicable.
- Name
price_commission- Type
- number
- Description
Commission amount.
- Name
price_commission_currency- Type
- string
- Description
Commission currency code.
- Name
payment_type- Type
- string
- Description
Payment type ("account" or "credit_card").
HotelRateRoom object
- Name
name- Type
- string
- Description
Room name/type.
- Name
board- Type
- string
- Description
Board type: RO (Room Only), BB (Bed & Breakfast), HB (Half Board), FB (Full Board), AI (All Inclusive).
- Name
room_data- Type
- HotelRateRoomData
- Description
Detailed room information.
- Name
price_per_night_avg- Type
- number
- Description
Average price per night for this room.
- Name
price_per_night- Type
- array of numbers
- Description
Price for each night.
- Name
price_chargeable- Type
- number
- Description
Total chargeable amount for this room.
- Name
price_per_room- Type
- number
- Description
Total price for this room.
- Name
price_before_fees- Type
- number
- Description
Price before fees.
- Name
price_fees- Type
- number
- Description
Fees amount.
- Name
price_due_at_hotel- Type
- number
- Description
Amount due at hotel.
- Name
price_inclusive- Type
- number
- Description
Inclusive price.
- Name
price_currency- Type
- string
- Description
Currency code.
- Name
fees- Type
- array of HotelRateFee
- Description
Itemized fees.
- Name
deposit_per_accomodation_per_night- Type
- number
- Description
Deposit amount per accommodation per night.
- Name
deposit_currency- Type
- string
- Description
Deposit currency.
- Name
adults- Type
- integer
- Description
Number of adults this room accommodates.
- Name
children- Type
- integer
- Description
Number of children this room accommodates.
- Name
children_ages- Type
- array of integers
- Description
Ages of children.
HotelRateRoomData object
- Name
images- Type
- array of strings
- Description
Room image URLs.
- Name
size_sqft- Type
- integer
- Description
Room size in square feet.
- Name
size_sqm- Type
- integer
- Description
Room size in square meters.
- Name
max_occupancy- Type
- integer
- Description
Maximum total occupancy.
- Name
max_adults- Type
- integer
- Description
Maximum adults allowed.
- Name
max_children- Type
- integer
- Description
Maximum children allowed.
- Name
beds- Type
- array of HotelRateRoomBedType
- Description
Bed configuration.
- Name
amenities- Type
- array of strings
- Description
Room amenities.
- Name
room_id- Type
- integer
- Description
Internal room type identifier.
HotelRateRoomBedType object
- Name
name- Type
- string
- Description
Bed type name (e.g., "King", "Queen", "Twin").
- Name
size- Type
- string
- Description
Bed size description.
- Name
quantity- Type
- integer
- Description
Number of beds of this type.
HotelRateFee object
- Name
name- Type
- string
- Description
Fee name/description.
- Name
price- Type
- number
- Description
Fee amount.
- Name
due_at_hotel- Type
- boolean
- Description
Whether this fee is paid at the hotel.
- Name
price_currency- Type
- string
- Description
Fee currency.
CancellationPolicyData object
- Name
from_datetime- Type
- string
- Description
Start datetime for this penalty period (ISO 8601).
- Name
price_cancellation_penalty- Type
- number
- Description
Penalty amount if cancelled during this period.
- Name
price_currency- Type
- string
- Description
Penalty currency.
HotelRateElite object
- Name
room_upgrade_guaranteed- Type
- boolean
- Description
Guaranteed room upgrade.
- Name
room_upgrade_subject_availability- Type
- boolean
- Description
Room upgrade subject to availability.
- Name
late_checkout_guaranteed- Type
- boolean
- Description
Guaranteed late checkout.
- Name
late_checkout_subject_availability- Type
- boolean
- Description
Late checkout subject to availability.
- Name
welcome_amenity- Type
- boolean
- Description
Welcome amenity included.
- Name
description- Type
- array of strings
- Description
Elite benefit descriptions.
- Name
price_property_credit- Type
- number
- Description
Property credit amount.
- Name
price_property_credit_currency- Type
- string
- Description
Property credit currency.
- Name
property_credit_description- Type
- string
- Description
Property credit description.
- Name
breakfast_included- Type
- boolean
- Description
Breakfast included.
- Name
breakfast_description- Type
- string
- Description
Breakfast details.
- Name
breakfast_pax- Type
- integer
- Description
Number of guests breakfast covers.
- Name
travel_agent- Type
- boolean
- Description
Travel agent rate.
Coordinates object
- Name
lat- Type
- number
- Description
Latitude.
- Name
lng- Type
- number
- Description
Longitude.
Create prebook
Validates a rate by re-checking with the vendor. Returns confirmed pricing and hotel details. Use the rate_id from the response for the subsequent V2 Book call.
Required attributes
- Name
rate_id- Type
- string
- Description
The rate ID from a V2 rates search.
Error responses
400 Bad Request— Invalid or expired rate400 Bad Request— Rate no longer available from vendor
Request
curl -X POST https://api.tripedge.com/v2/prebook \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{
"rate_id": "eyJhbGciOiJDaGFDaGEyMC1Qb2x5MTMwNSIs..."
}'
Response
{
"success": true,
"data": {
"search": {
"destination_id": null,
"place_id": "ChIJOwg_06VPwokRYv534QaPC8g",
"coordinates": null,
"radius": null,
"check_in": "2024-03-15",
"check_out": "2024-03-18",
"nationality": "US",
"rooms": [
{
"adults": 2,
"children": 1,
"children_ages": [5]
}
]
},
"hotel": {
"id": 1234,
"name": "Grand Hotel New York",
"stars": 5.0,
"rating": 4.5,
"review_count": 1200,
"lowest_rate": null,
"lowest_brand_loyalty_rate": null,
"minimum_age": 18,
"amenities": ["pool", "spa", "wifi", "gym", "restaurant"],
"check_in_begin_time": "15:00",
"check_in_end_time": "23:00",
"check_out_before_time": "11:00",
"description": "Luxury hotel in the heart of Manhattan...",
"images": ["https://images.tripedge.com/hotels/1234/main.jpg"],
"coordinates": { "lat": 40.7128, "lng": -74.0060 },
"address": {
"address": "123 Main Street",
"city": "New York",
"country": "US",
"postal_code": "10001",
"region": "NY"
},
"type": "hotel",
"exclusive": false
},
"nights": 3,
"rooms": [
{
"adults": 2,
"children": 1,
"children_ages": [5]
}
],
"rate": {
"id": "eyJhbGciOiJDaGFDaGEyMC1Qb2x5MTMwNSIs...",
"hotel_id": 1234,
"rooms": [
{
"name": "Deluxe King Room",
"board": "BB",
"room_data": {
"images": ["https://images.tripedge.com/rooms/deluxe-king.jpg"],
"size_sqft": 450,
"size_sqm": 42,
"max_occupancy": 3,
"beds": [{ "name": "King", "size": "king", "quantity": 1 }],
"amenities": ["minibar", "safe", "balcony"],
"room_id": 101
},
"price_per_night_avg": 250.00,
"price_per_night": [250.00, 250.00, 250.00],
"price_chargeable": 750.00,
"price_per_room": 750.00,
"price_before_fees": 700.00,
"price_fees": 50.00,
"price_due_at_hotel": 0.00,
"price_inclusive": 750.00,
"price_currency": "USD",
"fees": [
{ "name": "City Tax", "price": 30.00, "due_at_hotel": false, "price_currency": "USD" },
{ "name": "Service Fee", "price": 20.00, "due_at_hotel": false, "price_currency": "USD" }
],
"adults": 2,
"children": 1,
"children_ages": [5]
}
],
"price_per_night_avg": 250.00,
"price_per_night": [250.00, 250.00, 250.00],
"price_chargeable": 750.00,
"price_per_room": [750.00],
"price_per_night_per_room": [[250.00, 250.00, 250.00]],
"price_before_fees": 700.00,
"price_fees": 50.00,
"price_due_at_hotel": 0.00,
"price_inclusive": 750.00,
"price_currency": "USD",
"price_retail": 850.00,
"cancellation_policy": "Refundable",
"cancellation_policy_datetime": "2024-03-14T23:59:00Z",
"cancellation_policy_data": [
{
"from_datetime": "2024-03-14T23:59:00Z",
"price_cancellation_penalty": 250.00,
"price_currency": "USD"
}
],
"brand_loyalty_eligible": true,
"brand_loyalty_required": false,
"brand_loyalty_name": "Marriott Bonvoy",
"elite": null,
"price_commission": 75.00,
"price_commission_currency": "USD",
"payment_type": "account"
},
"remarks": "Check-in time: 3:00 PM. Photo ID required at check-in.",
"rate_id": "eyJhbGciOiJDaGFDaGEyMC1Qb2x5MTMwNSIs..."
},
"message": null
}