Retrieve Booking Details
The retrieve endpoint returns complete details for a specific booking, including hotel information, guest details, pricing, and cancellation policies.
Endpoint
GET /hotels/v1/bookings/{bookingId}
Request
Path Parameters
| Parameter | Type | Description |
|---|---|---|
bookingId | string | Bundleport booking ID |
Query Parameters
| Parameter | Type | Description |
|---|---|---|
includeAudit | boolean | Include audit trail (default: false) |
Response
Success Response
{
"booking": {
"id": "BK-987654321",
"status": "CONFIRMED",
"reference": {
"bookingID": "BK-987654321",
"clientReference": "BOOKING-2025-001",
"providerReference": "SUPPLIER-12345",
"confirmationNumber": "HTL-67890"
},
"hotel": {
"code": "12345",
"name": "Example Hotel Barcelona",
"location": {
"city": "Barcelona",
"country": "ES"
}
},
"stay": {
"checkIn": "2025-06-15",
"checkOut": "2025-06-17"
},
"rooms": [
{
"description": "Standard Double Room",
"boardCode": "BB",
"confirmationReference": "ROOM-001",
"paxes": [
{
"name": "John",
"surname": "Doe",
"age": 35
}
],
"price": {
"currency": "EUR",
"net": 150.00
}
}
],
"holder": {
"name": "John",
"surname": "Doe",
"email": "john.doe@example.com",
"phone": "+34600123456"
},
"price": {
"currency": "EUR",
"net": 150.00,
"suggested": 180.00
},
"cancelPolicy": {
"refundable": true,
"cancelPenalties": [
{
"penaltyType": "PERCENT",
"value": 50,
"deadline": "2025-06-10T00:00:00Z"
}
]
},
"remarks": ["Late check-in requested"],
"createdAt": "2025-06-01T10:30:00Z",
"updatedAt": "2025-06-01T10:30:00Z"
}
}
Booking Not Found
{
"error": {
"code": "INVALID_BOOKING_REFERENCE",
"message": "Booking with ID 'BK-XXX' not found"
}
}
Use Cases
1. Display Booking Confirmation
const booking = await getBooking(bookingId);
// Display confirmation details
displayConfirmation({
bookingId: booking.booking.id,
hotel: booking.booking.hotel.name,
checkIn: booking.booking.stay.checkIn,
checkOut: booking.booking.stay.checkOut,
confirmationNumber: booking.booking.reference.confirmationNumber,
price: booking.booking.price,
});
2. Check Booking Status
const booking = await getBooking(bookingId);
switch (booking.booking.status) {
case 'CONFIRMED':
// Booking confirmed
break;
case 'PENDING':
case 'ON_REQUEST':
// Still waiting for confirmation
break;
case 'CANCELLED':
// Booking cancelled
break;
}
3. Retrieve Cancellation Policy
const booking = await getBooking(bookingId);
const cancelPolicy = booking.booking.cancelPolicy;
if (cancelPolicy.refundable) {
const freeCancelDeadline = getFreeCancelDeadline(cancelPolicy.cancelPenalties);
console.log(`Free cancellation until: ${freeCancelDeadline}`);
} else {
console.log('Non-refundable booking');
}
Code Examples
- cURL
- JavaScript
- Python
curl -X GET https://api.bundleport.com/hotels/v1/bookings/BK-987654321 \
-H "Authorization: ApiKey YOUR_API_KEY"
async function getBooking(bookingId) {
const response = await fetch(
`https://api.bundleport.com/hotels/v1/bookings/${bookingId}`,
{
headers: {
'Authorization': 'ApiKey YOUR_API_KEY',
},
}
);
if (!response.ok) {
const error = await response.json();
throw new Error(error.error?.message || 'Failed to retrieve booking');
}
return await response.json();
}
import requests
def get_booking(booking_id):
url = f"https://api.bundleport.com/hotels/v1/bookings/{booking_id}"
headers = {"Authorization": "ApiKey YOUR_API_KEY"}
response = requests.get(url, headers=headers)
if not response.ok:
error = response.json()
raise Exception(error.get("error", {}).get("message", "Failed to retrieve booking"))
return response.json()
Next Steps
- List Bookings - Query multiple bookings
- Cancel Booking - Cancel a reservation
- Webhooks - Receive real-time booking updates