List Bookings
The list endpoint allows you to query bookings with filters, sorting, and pagination. Useful for reconciliation, reporting, and customer service.
Endpoint
GET /hotels/v1/bookings
Request
Query Parameters
| Parameter | Type | Description |
|---|---|---|
filters | object | Filter criteria (see below) |
pagination | object | Pagination settings |
sort | object | Sort order |
Filters
{
"filters": {
"status": ["CONFIRMED", "PENDING"],
"dateRange": {
"from": "2025-06-01",
"to": "2025-06-30"
},
"checkInRange": {
"from": "2025-06-15",
"to": "2025-06-20"
},
"clientReference": "BOOKING-2025-001",
"providerReference": "SUPPLIER-12345",
"hotelCodes": ["12345", "67890"]
}
}
Pagination
{
"pagination": {
"page": 1,
"pageSize": 20
}
}
Sort
{
"sort": {
"field": "createdAt",
"order": "DESC"
}
}
Response
Success Response
{
"bookings": [
{
"id": "BK-987654321",
"status": "CONFIRMED",
"reference": {
"bookingID": "BK-987654321",
"clientReference": "BOOKING-2025-001"
},
"hotel": {
"code": "12345",
"name": "Example Hotel Barcelona"
},
"stay": {
"checkIn": "2025-06-15",
"checkOut": "2025-06-17"
},
"price": {
"currency": "EUR",
"net": 150.00
},
"createdAt": "2025-06-01T10:30:00Z"
}
],
"pagination": {
"page": 1,
"pageSize": 20,
"total": 150,
"totalPages": 8
}
}
Use Cases
1. Reconciliation
// Get all confirmed bookings for a date range
const bookings = await listBookings({
filters: {
status: ['CONFIRMED'],
dateRange: {
from: '2025-06-01',
to: '2025-06-30',
},
},
pagination: {
page: 1,
pageSize: 100,
},
});
// Reconcile with your internal records
bookings.bookings.forEach(booking => {
reconcileBooking(booking);
});
2. Customer Service
// Find booking by client reference
const bookings = await listBookings({
filters: {
clientReference: customerProvidedReference,
},
});
if (bookings.bookings.length > 0) {
const booking = bookings.bookings[0];
// Display booking details to customer service agent
displayBookingDetails(booking);
}
3. Reporting
// Get bookings for reporting
const allBookings = [];
let page = 1;
let hasMore = true;
while (hasMore) {
const result = await listBookings({
filters: {
dateRange: {
from: startDate,
to: endDate,
},
},
pagination: {
page,
pageSize: 100,
},
});
allBookings.push(...result.bookings);
hasMore = page < result.pagination.totalPages;
page++;
}
// Generate report
generateReport(allBookings);
Code Examples
- cURL
- JavaScript
- Python
curl -X GET "https://api.bundleport.com/hotels/v1/bookings?filters[status][]=CONFIRMED&filters[dateRange][from]=2025-06-01&filters[dateRange][to]=2025-06-30&pagination[page]=1&pagination[pageSize]=20" \
-H "Authorization: ApiKey YOUR_API_KEY"
async function listBookings(filters = {}, pagination = {}) {
const params = new URLSearchParams();
if (filters.status) {
filters.status.forEach(s => params.append('filters[status][]', s));
}
if (filters.dateRange) {
params.append('filters[dateRange][from]', filters.dateRange.from);
params.append('filters[dateRange][to]', filters.dateRange.to);
}
params.append('pagination[page]', pagination.page || 1);
params.append('pagination[pageSize]', pagination.pageSize || 20);
const response = await fetch(
`https://api.bundleport.com/hotels/v1/bookings?${params}`,
{
headers: {
'Authorization': 'ApiKey YOUR_API_KEY',
},
}
);
return await response.json();
}
import requests
def list_bookings(filters=None, pagination=None):
url = "https://api.bundleport.com/hotels/v1/bookings"
headers = {"Authorization": "ApiKey YOUR_API_KEY"}
params = {}
if filters:
if "status" in filters:
params["filters[status][]"] = filters["status"]
if "dateRange" in filters:
params["filters[dateRange][from]"] = filters["dateRange"]["from"]
params["filters[dateRange][to]"] = filters["dateRange"]["to"]
if pagination:
params["pagination[page]"] = pagination.get("page", 1)
params["pagination[pageSize]"] = pagination.get("pageSize", 20)
response = requests.get(url, headers=headers, params=params)
return response.json()
Next Steps
- Retrieve Booking - Get detailed booking information
- Cancel Booking - Cancel a reservation
- Webhooks - Receive real-time booking updates