home > support > API > Marketplace API > tour departures
Retrieve Departures (dates/times) for a particular tour
Designed for those importing departures into a database rather than for using directly on a web page as execution time can be slow.
Dates & deals is a better method for most common use cases, including displaying a calendar on a website as it returns results faster and also includes dates created using Freesale Seasons and Hotel rooms/rates.
Endpoint | /c/tour/datesprices/dep/show |
Formats | XML |
Example | /c/tour/datesprices/dep/show.xml?id=123 |
Verb | GET |
PHP examples use the PHP Client Library with SimpleXML
object show_tour_departures( int $tour, int $channel )
// Set ID for the Tour we want departures for
$tour = 12345;
// Set the Channel ID this Tour belongs to
$channel = 3;
// Query the TourCMS API
$result = $tourcms->show_tour_departures($tour, $channel);
foreach($result->tour->dates_and_prices->departure as $departure) {
// Get and format the start date
$start_date = strtotime($departure->start_date);
$start_date_display = date("jS F Y", $start_date);
// Get and format the end date
$end_date = strtotime($departure->end_date);
$end_date_display = date("jS F Y", $end_date);
// Check if the departure is a special offer
$is_offer = (int)$departure->main_price->is_offer;
// If we have a special offer, output was/now pricing
// Otherwise just output the regular price
if($offer_type) {
print $start_date_display." to ".$end_date_display;
print " <del>";
print $departure->main_price->previous_price_display;
print "</del> ";
print $departure->main_price->rate_price_display;
print " ** SPECIAL **<br />";
} else {
print $start_date_display." to ".$end_date_display." ";
print $departure->->main_price->rate_price_display."<br />";
}
}
7th October 2011 to 14th October 2011 £1020
14th October 2011 to 21st October 2011 <del>£1020</del> £820 ** SPECIAL **
21st October 2011 to 28th October 2011 £1020
C# examples use the .Net Client Library
An example will be added here shortly.
VB examples use the .Net Client Library
An example will be added here shortly.
Enter your TourCMS API credentials below to call the Show departures endpoint.
Parameter | Notes |
---|---|
id | Tour ID, this parameter must be supplied. If using one of the API wrappers this will be passed as the first parameter |
start_date_start start_date_end | Optionally request just those departures starting between two dates. Format: YYYY-MM-DD |
show_closed_departures | Optionally send true (as a string) to show unabookable future departures as well as bookable ones |
per_page | Number of results to return per page. Default is 100. Max is 100 |
page | Integer for which page number to return. Default is page 1 |
supplier_note | TourCMS will return just the departures where the supplier note matches, e.g. "EN|01" |
start_time | Receive just the departures with a matching "Start Time", must be 24 hour format, e.g. "09:00" |
code | Return just departures with a specific code |
supplier_note_like |
Part match supplier notes, use "_" to match one character, "%"" to match multiple characters: "E%" (or "E_") will match "ES" or "EN". "E%" will match "English". To match supplier notes that contain a "_" or "%" first escape them, e.g. "EN\_%" will match "EN_1430" but not "EN1430". |
hide_prices |
If you pass hide_prices=1 to Show Tour Departures then TourCMS will not include price information in the response, only availability, this is faster and thus the max per_page raises from 100 to 500. |
The Channel ID is also passed via the request header, this is required as Tour IDs are unique within a particular channel (supplier) rather than being unique system wide.
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 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
tour |
The tour node contains:
|