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 > add booking component

Add booking component

Add a Tour (with or without Options) to a booking, or add Options to an existing Tour that is already on a booking.

Notes

Bookings should be non-temporary (i.e. should be committed), non-archived.

For use by Tour Operators only. Marketplace Agents cannot add components to an existing booking, instead they should submit a "Modify" booking note, or potentially cancel and re-book.

This API call is intended for adding products to existing bookings. If instead you are building a shopping cart, you should supply all componenents to Start New Booking.

REST info

Endpoint/c/booking/component/new
FormatsXML
ExampleURL: /c/booking/component/new.xml
 
POST data:
<?xml version="1.0"?>
<booking>
	<booking_id>12345</booking_id>
	<component>
		<component_key>AAAAAABBBBBBCCCCCCC</component_key>
	</component>
</booking>
VerbPOST


 Code samples

PHP examples use the PHP Client Library with SimpleXML

Description

object booking_add_component ( SimpleXmlElement $component_data, int $channel )


Parameters

$component_data
SimpleXmlElement containing the tour or options data to add
$channel
ID number for the channel the booking is being made with

Example

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

// Start building the booking XML
$component_data = new SimpleXMLElement('<booking />');

// Set the ID for the booking of the tour or options are on
$component_data->addChild('booking_id', 'BOOKING_ID_HERE');

// Add a component node
$child_component_data = $component_data->addChild('component');

// Either:
// If adding a Tour (with or without Options) a component_key for the component to add,
// obtained via a call to the Check Tour availability API method
// or:
// If adding Options to a Tour component already on the booking,
// rather than a key pass the text "ADD_OPTION_TO_EXISTING_TOUR" (without quotes)
$child_component_data->addChild('component_key', 'COMPONENT_KEY_HERE');

// Query the TourCMS API, adding a tour or options to an existing Tour
$result = $tourcms->booking_add_component($component_data, $channel);

// Check the result, will be "OK" if the tour or options were added
switch ($result->error) {
    case "OK":
		// Print a success message
	    print "Thanks, your tour or options have been added.";
	    break;
	default:
		// Some other problem (could check error to see what)
	    print "Sorry, unable to add the tour or options at this time.";
	    break;
}
			

Thanks, your tour or options to an existing tour have been added.
			

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

// Add a component to a booking
TourCMS.addBookingComponent({
    channelId: 3930,
    booking: {
      booking_id: 12920,
      component: {
        component_key: 'Rjqb+vKn6H5rawI+mt/m56vQ9P6ju1aKv2XO9gZ2OxykgCsUAbrdap/7CTxDKl+p'
      }
    },
    callback: function(response) {
      console.log(response.error);
    }
  });
OK

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

Try it

Enter your TourCMS API credentials below to call the Add Booking Component endpoint.

Take care, submitting this form will modify live data!


            
            


 Post fields

Post fields
XML NodeNotes
booking

The root XML element

XML NodeNotes
booking_idThe ID for the booking the component is on
component
XML NodeNotes
component_keyEither:
 
If adding a Tour (with or without Options) a component_key for the component to add, obtained via a call to the Check Tour availability API method.
 
Or:
 
If adding Options to a Tour component already on the booking, rather than a key pass the text "ADD_OPTION_TO_EXISTING_TOUR" (without quotes)
noteFreetext note for this component. Visible to staff on the booking edit screen and in various reports. Can be multi-line.
 
If the item being booking is an airport transfer (product type 2) you may well be taking details like hotel names, airlines, flight numbers etc and recording them in a human-readable format. The suggested format for this is:
	Airline : ExampleJet
	Flight  : ABC123
	Arrives : 08:15
	Hotel   : Hotel Testville
	
pickup_keyIf the customer has chosen/entered a pickup point provide the key (as obtained from Check Tour Availability) here.
 
If the key is from one of the set list of pickup points then no further pickup information needs to be provided.
 
Alternatively, if the key is the pickup_on_request_key then you MUST also provide a pickup_note node containing the free-text pickup information entered by the customer otherwise TourCMS will silently ignore the pickup_key.
pickup_noteThe free-text pickup information entered by the customer.
 
Required if you have passed in a pickup_key node containing the value of the pickup_on_request_key field (from Check Tour Availability, indicating that free-text pickup information is accepted by the operator) otherwise leave this out/blank.
nocommissionWhether any commission should be blocked on the added component
 
0 - Not flagged as an up-sell (default)
1 - Flagged as an up-sell.
replies

If any Questions are to be answered, add a replies node containing:

XML NodeNotes
reply

A reply node for each question to be answered containing:

XML NodeNotes
question_
key
Question key identifying the question to be answered, obtained from Check Tour Availability.
answers

An answers node containing:

XML NodeNotes
answer

An answer node for each answer to the question:

XML NodeNotes
answer_
value
The answer
options

If any Options are to be booked, add an options node containing:

XML NodeNotes
option

An option node for each option to be added containing:

XML NodeNotes
component_key Either:
 
If adding at the same time as adding the Tour, provide the component key for the option, obtained from Check Tour Availability.
 
Or:
 
If adding Option(s) to a Tour component already on the booking, component keys can be obtained via the special Check Option Availability API

 
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.

More information