Skip to main content

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

ParameterTypeDescription
bookingIdstringBundleport booking ID

Query Parameters

ParameterTypeDescription
includeAuditbooleanInclude 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 -X GET https://api.bundleport.com/hotels/v1/bookings/BK-987654321 \
-H "Authorization: ApiKey YOUR_API_KEY"

Next Steps