home > support > API > booking creation > commit new booking
Convert a temporary booking created with Start new booking into a live booking
Only returns basic booking information, use the booking_id and Show Booking to get full detail.
Once committed a booking can no longer be deleted, it can however be cancelled which returns the availability but leaves a cancelled booking in the operator account. Cancelled bookings can be deleted by staff via the TourCMS system web interface.
Endpoint | /c/booking/new/commit |
Formats | XML |
Example | URL: /c/booking/new/commit.xml POST data:
|
Verb | POST |
PHP examples use the PHP Client Library with SimpleXML
object commit_new_booking ( SimpleXmlElement $booking_data, int $channel )
// Temporary booking ID (obtained via "Start booking")
$booking_id = 123456;
// Channel the booking is made with
$channel = 3039;
// Build the XML to post to TourCMS
$booking = new SimpleXMLElement('<booking />');
$booking->addChild('booking_id', $booking_id);
// Query the TourCMS API, upgrading the booking from temporary to live
$result = $tourcms->commit_new_booking($booking, $channel);
// Check whether everything was ok
if($result->error == "OK")
print "Thanks, your booking ID is " . $result->booking->booking_id;
else
print "Sorry, there was a problem: " . $result->error;
Thanks, your booking ID is 123456
C# examples use the .Net Client Library
XmlDocument CommitNewBooking (XmlDocument bookingData, int channelId)
VB examples use the .Net Client Library
XmlDocument CommitNewBooking (XmlDocument bookingData, Integer channelId)
NodeJS examples use the NodeJS Wrapper
// This example commits (converts from temporary) booking 1234 on Channel 3930
// It also suppresses any email that would usually send (suppress_email: 1)
// This suppression is common for tour operators who let a subsequent payment
// move the booking to "Confirmed", only sending an email at that point
TourCMS.commitBooking({
channelId: 3930,
booking: {
booking_id: 1234,
suppress_email: 1
},
callback: function(response) {
console.log(response.error);
}
});
OK
Looking for sample code in a different language? TourCMS and community provided API libraries
Enter your TourCMS API credentials below to call the Commit booking endpoint.
You will need the booking_id of a temporary booking, create one using Start New Booking.
Take care, submitting this form will modify live data!
There are no querystring parameters.
XML Node | Notes | ||||||||
---|---|---|---|---|---|---|---|---|---|
booking |
The root XML element
|
XML Node | Notes | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
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. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
supplier_subsystem_error | If the <error> is "SUPPLIER_SUBSYSTEM_ERROR", indicating an issue committing the booking in a supplier subsystem then TourCMS will provide more information on the error that was experienced. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
supplier_subsystem_message | If the <error> is "SUPPLIER_SUBSYSTEM_ERROR", indicating an issue committing the booking in a supplier subsystem and if the subsystem has provided a textual explanation it will be included here. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
booking |
If the temporary booking was converted to live there will be a booking node containing:
|