Quote an Option
The quote endpoint (recheck) validates that a specific option is still available at the advertised price. Always quote immediately before booking to ensure accurate pricing and avoid booking failures.
Endpoint
POST /hotels/v1/recheck
Why Quote Before Booking?
- Price Validation - Prices can change between search and booking
- Availability Confirmation - Inventory may have been sold
- Policy Updates - Cancellation policies may have changed
- Required for Booking - Some suppliers require a fresh quote
Request
Required Parameters
| Parameter | Type | Description |
|---|---|---|
optionRefId | string | Option reference ID from search |
Optional Parameters
| Parameter | Type | Description |
|---|---|---|
settings | object | Request settings (accessIds, timeout) |
Example Request
{
"optionRefId": "OPT-123456789",
"settings": {
"accessIds": ["ACCESS_1"],
"requestId": "quote-001"
}
}
Response
Success Response
{
"optionQuote": {
"optionRefId": "OPT-123456789",
"hotel": {
"code": "12345",
"name": "Example Hotel Barcelona"
},
"rooms": [
{
"description": "Standard Double Room",
"boardCode": "BB",
"price": {
"currency": "EUR",
"net": 150.00,
"suggested": 180.00,
"binding": true
}
}
],
"price": {
"currency": "EUR",
"net": 150.00,
"suggested": 180.00,
"binding": true
},
"cancelPolicy": {
"refundable": true,
"cancelPenalties": []
},
"warnings": []
},
"errors": []
}
Price Changed Response
If the price has changed:
{
"optionQuote": {
"optionRefId": "OPT-123456789",
"price": {
"currency": "EUR",
"net": 165.00, // Price increased from 150.00
"suggested": 198.00,
"binding": true
}
},
"warnings": [
{
"code": "PRICE_CHANGED",
"description": "Price has changed since search"
}
]
}
Option No Longer Available
If the option is no longer available:
{
"errors": [
{
"code": "OPTION_EXPIRED",
"message": "Option is no longer available",
"type": "CLIENT"
}
]
}
Key Fields
binding Price
When price.binding is true, the price is guaranteed and will not change before booking. When false, the price may still change.
Price Changes
If the price changes:
- Check
warningsforPRICE_CHANGED - Compare
price.netwith your stored value - Present updated price to user
- Book with new price if acceptable
Option Expiration
If optionRefId has expired:
- Perform a new search
- Select a new option
- Quote the new option
- Book immediately
Best Practices
1. Always Quote Before Booking
// ✅ Good - Quote then book
const search = await searchHotels(criteria);
const option = search.options[0];
// Quote immediately
const quote = await quoteOption(option.optionRefId);
// Check for price changes
if (quote.warnings.some(w => w.code === 'PRICE_CHANGED')) {
// Show updated price to user
showPriceUpdate(quote.price);
}
// Book with quoted option
const booking = await bookOption(option.optionRefId, travellerData);
// ❌ Bad - Book without quoting
const search = await searchHotels(criteria);
const option = search.options[0];
// Price may have changed or option may be sold out
const booking = await bookOption(option.optionRefId, travellerData);
2. Handle Price Changes
const quote = await quoteOption(optionRefId);
// Check for price changes
const priceChanged = quote.warnings.some(w => w.code === 'PRICE_CHANGED');
if (priceChanged) {
const oldPrice = storedOption.price.net;
const newPrice = quote.price.net;
if (newPrice > oldPrice) {
// Ask user to confirm new price
const confirmed = await confirmPriceChange(newPrice);
if (!confirmed) {
// User declined, search again
return searchHotels(criteria);
}
}
}
// Proceed with booking
const booking = await bookOption(optionRefId, travellerData);
3. Check Option Availability
const quote = await quoteOption(optionRefId);
if (quote.errors.length > 0) {
const error = quote.errors[0];
if (error.code === 'OPTION_EXPIRED' || error.code === 'NO_AVAILABILITY') {
// Option no longer available
// Search again for alternatives
return searchHotels(criteria);
}
// Other error - handle appropriately
throw new Error(error.message);
}
Code Examples
- cURL
- JavaScript
- Python
curl -X POST https://api.bundleport.com/hotels/v1/recheck \
-H "Authorization: ApiKey YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"optionRefId": "OPT-123456789",
"settings": {
"accessIds": ["ACCESS_1"]
}
}'
async function quoteAndBook(optionRefId, travellerData) {
// Quote first
const quote = await fetch('https://api.bundleport.com/hotels/v1/recheck', {
method: 'POST',
headers: {
'Authorization': 'ApiKey YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({ optionRefId }),
}).then(r => r.json());
// Check for errors
if (quote.errors?.length > 0) {
throw new Error(quote.errors[0].message);
}
// Check for price changes
if (quote.warnings?.some(w => w.code === 'PRICE_CHANGED')) {
console.log('Price changed:', quote.price);
}
// Book with quoted option
return await bookOption(optionRefId, travellerData);
}
import requests
def quote_and_book(option_ref_id, traveller_data):
# Quote first
url = "https://api.bundleport.com/hotels/v1/recheck"
headers = {
"Authorization": "ApiKey YOUR_API_KEY",
"Content-Type": "application/json"
}
payload = {"optionRefId": option_ref_id}
quote = requests.post(url, json=payload, headers=headers).json()
# Check for errors
if quote.get("errors"):
raise Exception(quote["errors"][0]["message"])
# Check for price changes
warnings = quote.get("warnings", [])
if any(w.get("code") == "PRICE_CHANGED" for w in warnings):
print(f"Price changed: {quote['price']}")
# Book with quoted option
return book_option(option_ref_id, traveller_data)
Next Steps
- Create a Booking - Book the quoted option
- Search for Hotels - Find available options
- Best Practices - Recommended patterns