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&component_id=6789
VerbGET

Code samples

PHP examples use the PHP Client Library with SimpleXML

Code sample here soon

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