TourCMS, a leading online booking and channel management solution is operated by Palisis.

Contact Info

Palisis AG
Florastrasse 18A
8610 Uster
support@palisis.com
+41 44 533 40 40

Follow Us

home > support > API > Marketplace API > check option availability

Check Option Availability

Check for Option availability

Notes

Options are ancillary items that are sold on top of a Tour.

Generally Options are added to a booking at the same time as the Tour they are associated with (see Check Tour Availability and then either Start New Booking or Add Booking Component), however this endpoint allows you to obtain a key that can be used to add an Option to an exsting Tour booking (via Add Booking Component).

For use by Tour Operator accounts only, agents cannot add Options to existing bookings via the API

REST info

Endpoint/c/booking/options/checkavail
FormatsXML
Example/c/booking/options/checkavail.xml?booking_id=1234&tour_component_id=6789
VerbGET

Code samples

PHP examples use the PHP Client Library with SimpleXML

Description

object check_option_availability ( int $booking, int $tour_component_id, int $channel )


Parameters

$booking
The ID for the booking the existing Tour component is on
$tour_component_id
The ID for the existing Tour component to check for Options on, found via Show Booking
$channel
ID number for the channel the booking is being made with

Example


// Set the channel this booking will be made with.
$channel = 3930;

// The ID for the booking the component is on
$booking = 1234;

// Set the ID for the existing Tour component (component_id from departure component) to check for Options on, found via Show Booking.
$tour_component_id = 6789;

// Query the TourCMS API, checking for Option availability
$result = $tourcms->check_option_availability($booking, $tour_component_id, $channel);


// See how many available options TourCMS has returned
if(isset($result->available_components->options->option))
	$num_options = count($result->available_components->options->option);
else
	$num_options = 0;

// If there are options display them, otherwise display "no availability"
if($num_options>0) {
	// We have some options, loop through them
	foreach ($result->available_components->options->option as $item)
	{
		print "\xA";
		print "Name: $item->option_name";
		print "\xA";
		print "Short description: $item->short_description";
	}
} else {
	// The options we searched for are not available
	print "Sorry, no availability";
}
Name: Option 1
Short description: This is the short descrition for the option 1

C# examples use the .Net Client Library

Code sample here soon

VB examples use the .Net Client Library

Code sample here soon

NodeJS examples use the NodeJS Wrapper

Example

// Check for Option availability
TourCMS.checkOptionAvailability({
  channelId: 3930,
  qs: {
    booking_id: 12662,
    tour_component_id: 8052295
  },
  callback: function(response) {
    //console.info(response.available_components.options.option);
    var options = [].concat(response.available_components.options.option);
    [].forEach.call(options, function(opt) {
      console.log("Option: "+opt.option_name);
      [].forEach.call(opt.quantities_and_prices.selection, function(sel) {
        console.log("   Quantities possible: "+sel.quantity);
      });
    });
  }
});
Option: Test option
   Quantities possible: 1
   Quantities possible: 2
   Quantities possible: 3
   Quantities possible: 4

Looking for sample code in a different language? TourCMS and community provided API libraries


Querystring parameters

Querystring parameters
ParameterNotes
booking_idThe ID for the booking the existing Tour component is on
tour_component_idThe ID for the existing Tour component to check for Options on, found via Show Booking


The Channel ID is also passed via the request header.

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
channel_id Channel ID
account_id Account ID
component_key_valid_for How long (in seconds) the returned component keys will be valid for. While valid TourCMS will hold the price (but not the availability). If this time period elapses prior to booking, a new component-key should be retrieved.

Currently will always return 3600 seconds (1 hour) however TourCMS may adjust this value in the future
available_
components

An available_components node, it may be empty if there's no availability, otherwise it will contain:

NodeNotes
options

If any options (ancillary items) are available then an options node will be returned containing:

XML NodeNotes
option

There will be an option node for each option configured on the Tour matching the following criteria:
- Set to "Public"
- Don't require any "Answers"
- Not mandatory / must include, options
- Available during the booking period

XML NodeNotes
option_idUnique ID
option_nameOption name
short_
description
Short description (HTML tags removed)
local_
payment
Local payments are payable locally and not taken into account on the main booking total. Possibly charged in a different currency to the channel / booking.
sale_quantity_ruleWhether the price will be multiplied by the quantity:
 
PERSON - price is per person
GROUP - price is per group
duration_ruleWhether the price will be multiplied by the duration:
 
Q - Price will NOT be multiplied by duration (default)
D - Price will be multiplied by duration in days
N - Price will be multiplied by duration in nights
extension Textual representation of the effect the option has on the start/end date of the tour. E.g. "4 nights".
group ID number for the group that the Option belongs to (see below)
group_title Title for the group that the Option belongs to. E.g. "General", "Attractions", "Upgrades"
option_
group_radio
ONE_FROM_GROUP = Options of this group are mutually exclusive, e.g. can only book one of them
 
ANY_FROM_GROUP = Can book any combination of the Options from this group, they are not mutually exclusive.
 
TOUR_QUANTITY_FROM_GROUP = Can book different options, but total quantity of options must not exceed tour quantity.
per_text Label to show next to the price, e.g. per "Person", "Group" etc
quantities_
and_prices

Containing:

XML NodeNotes
selection

A selection node for each possible quantity, containing:

XML NodeNotes
quantity Quantity
price Price
price_
display
Display Price
component_
key
Pass to Add booking component API

More information