home > support > API > Marketplace API > API: list bookings
Allows searching by several criteria, returns booking component details, payment details etc.
For more detail on a particular booking see Show booking.
An alternative, older endpoint Search Bookings remains available, however it is less performant and returns less detail.
Endpoint | /p/bookings/list /c/bookings/list |
Formats | XML |
Example | /p/bookings/list.xml?page=2&per_page=20 |
Verb | GET |
PHP examples use the PHP Client Library with SimpleXML
object list_bookings ( [ string $params = "" [, int $channel = 0 ]] )
// Tour Operators set their channel here
// Marketplace Partners can optionally set the Channel ID
// Here we set to 0 for all connected channels
$channel_id = 0;
// Optionally define search parameters
// Here we are searching for bookings made during a date range
$params = "made_date_start=2020-01-01&made_date_end=2020-04-30";
// Query the TourCMS API
$result = $tourcms->list_bookings($params, $channel_id);
// Loop through each booking
foreach($results->booking as $booking) {
// Print out the booking ID and channel name
print $booking->booking_id." - ".$booking->channel_name." > ";
// Print out the booking name and revenue
print $booking->booking_name." (".$booking->sales_revenue_display.")";
print "<br />";
}
12345 - Example Tours > Highland Walk (£599.00)
99281 - Adventure Co > Half day rafting (£99.00)
C# examples use the .Net Client Library
Not currently supported
VB examples use the .Net Client Library
Not currently supported
NodeJS examples use the NodeJS Wrapper
Not currently supported
Looking for sample code in a different language? TourCMS and community provided API libraries
Implementing yourself? Check the REST info for this endpoint.
Enter your TourCMS API credentials below to call the List Bookings endpoint.
Parameter | Notes |
---|---|
made_date_start made_date_end | Use these two parameters to specify a range of booking dates to search, so for example you could search for just the bookings made in the last 24 hours. Note this is the date the booking was created and not the date of travel. YYYY-MM-DD |
start_date_start start_date_end | Use these two parameters to specify a range of booking dates to search, so for example you could search for just the bookings arriving today. NOTE that if the booking has tours for today AND tours for tomorrow on the same booking, the start date (for the booking) will be TODAY. YYYY-MM-DD |
end_date_start end_date_end | Use these two parameters to specify a range of booking dates to search, so for example you could search for just the bookings ending today. NOTE that if the booking has tours for today AND tours for tomorrow on the same booking, the end date (for the booking) will be TOMORROW. YYYY-MM-DD |
cancel_date_start cancel_date_end | Find bookings cancelled during a date range. YYYY-MM-DD |
channel_id_booking_id | Limit the results to a set list of bookings by passing in a list of IDs.
channel_id_booking_id=10_8 (Booking ID 8, from Channel ID 10 only) channel_id_booking_id=10_8,10_100,10_101 (Booking IDs 8, 100, 101 only, from Channel ID 10 only) |
per_page | Number of bookings to return per page, default and maximum is 250 |
page | Page of results to return, default is 1 (the first page) |
customer_id | Use to search for bookings by a specific customer, only works if the channel ID is also supplied (channel id is passed in the header if calling the API directly or as the second parameter if using the PHP/.Net API wrappers). Currently searches the lead customer only |
agent_ref | Use to search for bookings with a specific agent reference |
booking_id | Limit results to those matching Booking ID |
pii | Only return bookings that match either lead customer email or surname |
account_id | Limit results to a particular TourCMS account |
channel_ids | Limit results to a comma separated list of channel ids |
XML Node | Notes | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request | Confirmation of the request that you sent | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
error | Any error message returned, if there is no error this will just contain the text OK | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
total_bookings_count | Total number of bookings returned by the search (i.e. not just the number on this page) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
bookings |
If any bookings are found, a bookings node will be returned containing:
|
Tour Operators will be able to view all data. The data visible to Marketplace Partners depends on the permission level granted on that particular channel (set by the channel operator when they connect). Marketplace Partners granted permission level 2 or above will be able to see most of the booking information plus basic customer details. Marketplace Partners granted permission level 3 will be able to see a bit more information on each customer including age/dob information plus a breakdown of payments made on the booking.
Remember, Marketplace Partners will only be able to see bookings that have their agent record set (i.e. either the booking or the customer came to the Operator via the Marketplace Partner).