home > support > API > Marketplace API > tour departures

Show Tour Departures

Retrieve Departures for a particular tour


Notes

Designed for those importing departures into a database rather than for using directly on a web page as execution time can be in the region of 15-25 seconds.
 
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.

REST info

Endpoint/c/tour/datesprices/dep/show
FormatsXML
Example/c/tour/datesprices/dep/show.xml?id=123
VerbGET

Code samples

PHP examples use the PHP Client Library with SimpleXML

Description

object show_tour_departures( int $tour, int $channel )


Parameters

$tour
ID for the Tour
$channel
ID for the channel this Tour belongs to

Example

// 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.

Querystring parameters

Querystring parameters
ParameterNotes
idTour 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_departuresOptionally send true (as a string) to show unabookable future departures as well as bookable ones
per_pageNumber of results to return per page. Default is 100. Max is 100
pageInteger for which page number to return. Default is page 1


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.

Response fields

Response fields
XML NodeNotes
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:

XML NodeNotes
channel_idChannel ID
account_idAccount ID
tour_idTour ID
min_booking_sizeMinimum booking size
max_booking_sizeMaximum booking size
sale_currencySale currency
dates_and_prices

The dates_and_prices node contains:

XML NodeNotes
total_departure_count Total number of departures returned by the search (i.e. not just the number on this page)
departure

A departure node for each date, containing:

XML NodeNotes
departure_idInternal departure ID
codeDeparture code. May be in format 09:00-17:00 for day tours with specific time, if so the start_time and end_time fields may be populated.
start_timeStart time for the Tour on this particular departure in 24 hour local time format (e.g. "09:00"). If the start time is not known or is irrelevant for the item type then this field will be blank
end_timeEnd time for the Tour on this particular departure in 24 hour local time format (e.g. "17:00"). If the end time is not known or is irrelevant for the item type then this field will be blank
start_dateStart date (YYYY-MM-DD)
end_dateEnd date (YYYY-MM-DD)
noteProduct note
spaces_remainingSpaces remaining on this date (Integer)
supplier_noteSupplier note (can be used for holding date specific IDs from 3rd party reservation systems)
guide_language

If guide languages have been loaded on this departure (if this node doesn't exist, none have been loaded, asssume all languages from the tour level are supported on this departure) a guide_language node will be returned containing the following:

XML NodeNotes
language Tour guide language, 2 digit, e.g. "fr".
statusASKFIRST, OPEN - whether an agent should just take a booking - or whether should ask first. Normally ask first status appears when very few spaces remain or when the it is a last minute booking.

Can also be status CLOSED if you are showing all closed departures (by default, this API method will only list bookable dates)
book_urlURL to booking engine / live availability display (can be iframed onto your site). These links are not the same as book_url that comes back from the tour API method. This booking engine URL will be a single departure specfic booking engine
 
It is possible to disable the standard booking engine, so on some accounts this may be blank.
main_price

A main_price node containing:

XML NodeNotes
rate_idIdentifier for the rate
rate_nameMain price rate name (e.g. Adult rate)
rate_pricePrice (in sale currency)
rate_price
_display
Price - display version (Includes HTML entity currency code and no decimals)
is_offer1 - Special offer
0 - Not a special offer
date_offer
_created
Date special offer created (YYYY-MM-DD)
offer_noteSpecial offer note (e.g. January promotion)
previous_pricePrice before the special offer
previous_price
_display
Price before the special offer - display version (Includes HTML entity currency code and no decimals)
net_priceNet price (IF a travel agent)
agecat Age category (s-senior, a-adult, y-youth, c-child, i-infant)
agerange_min
agerange_max
Years. If blank, first check agecat, secondly assume is adult
rate_code Tour operators only. Additional field for cross sytem mapping
extra_rates

An extra_rate node for each addition rate containing:

XML NodeNotes
rate_idIdentifier for the rate
rate_nameRate name (e.g. Adult rate)
rate_pricePrice (in sale currency)
rate_price
_display
Price - display version (Includes HTML entity currency code and no decimals)
net_priceNet price (IF a travel agent)
agecat Age category (s-senior, a-adult, y-youth, c-child, i-infant)
agerange_min
agerange_max
Years. If blank, first check agecat, secondly assume is adult
rate_code Tour operators only. Additional field for cross sytem mapping


Back to API list