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

Update booking component

Change some details of a particular booking component (tour/option/fee)

Notes

Designed to be used by tour operators only, Marketplace Agents cannot update booking components.

REST info

Endpoint/c/booking/component/update
FormatsXML
ExampleURL: /c/booking/component/update.xml
 
POST data:
<?xml version="1.0"?>
<booking>
	<booking_id>12345</booking_id>
	<component>
		<component_id>1</component_id>
		<sale_quantity>50</sale_quantity>
	</component>
</booking>
VerbPOST


 Code samples

PHP examples use the PHP Client Library with SimpleXML

Description

object booking_update_component ( SimpleXmlElement $component_data, int $channel )


Parameters

$component_data
SimpleXmlElement containing the tour data
$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 the tour is on
$component_data->addChild('booking_id', 'BOOKING_ID_HERE');

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

// Set the ID for the tour to update, obtained from the Show booking API
$component->addChild('component_id', 'COMPONENT_ID_HERE');

// Set the quantity for the tour to update
$component->addChild('sale_quantity','QUANTITY_HERE');

// Query the TourCMS API, updating a tour, option or fee from a regular (i.e. non-temporary, non-archived) booking
$result = $tourcms->booking_update_component($component_data, 3930);

// Check the result, will be "OK" if the tour was updated
switch ($result->error) {
     case "OK":
     // Print a success message
     print "Thanks, your booking component (tour/option/fee) has been updated.";
     break;
     default:
     // Some other problem (could check error to see what)
     print "Sorry, unable to update the tour at this time.";
     print $result->error;
     break;
   }
			

Thanks, your booking component (tour/option/fee) has been updated.
			

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

// Update a component to a booking
TourCMS.updateBookingComponent({
    channelId: 3930,
    booking: {
      booking_id: 12920,
      component: {
          component_id: 8286216,
          sale_quantity: 3
      }
    },
    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 Update 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

The root XML element

XML NodeNotes
component_idThe ID for the component to update, obtained from the Show booking API
date_idQuick change the component from one departure to another. Does not sanity check availability (you can do that first with Check Availability), prices, costs, validity of any Options etc - so use with caution.
noteFreetext note related to this component. For example if this is a hotel transfer, this could be the customers flight details
pickup_keySelect a pickup point. Pickup keys can be obtained via Check Availability, if setting to a freetext pickup, that key can also be obtained via Tour Show.
 
To update an existing hotel pickup from the component set the value of this node to UPDATE
pickup_noteGenerally used to supply freetext pickup info (when combined with the pickup on request key)
pickup_timeOverride the configured route code for the selected pickup
pickup_route_codeOverride the configured time for the pickup, e.g. 20:00
supplier_refSupplier reference for this component, often a booking id for a third party downstream system
sale_quantityQuantity of the component booked
sale_quantity_ruleEither PERSON if the sale_price is multiplied by the quantity, or GROUP if the sale_price is the total
sale_priceThe price, either per person or per group (depending on the above)
net_quantity_ruleEither PERSON if the net_price is multiplied by the quantity, or GROUP if the net_price is the total
net_priceThe net price, either per person or per group (depending on the above)
customer_paymentOn bookings where the agent is set to pay the balance, specific items can be added as customer payable by setting this field to 1
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

 
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