home > support > API > Marketplace API > delete booking
Delete a booking, releasing availability
Allows the deletion of Temporary bookings only.
Useful if an API booking is started but not completed. Temporary bookings will be automatically deleted after a while anyway, this just speeds up the process :)
Call | /c/booking/delete |
Formats | XML |
Example | URL: /c/booking/delete.xml?booking_id=12345 |
Verb | POST |
PHP examples use the PHP Client Library with SimpleXML
object delete_booking ( int $booking, int $channel )
// Set the channel ID
$channel = 3930;
// Set the booking ID
$booking = 12345;
// Call TourCMS API, updating the booking
$result = $tourcms->delete_booking($booking, $channel);
// Check the result, will be "OK" if a booking was updated
if ($result->error == "OK") {
// Print a success message
print "Booking deleted.";
} else {
// Some problem
print "Unable to delete booking (" . $result->error . ").";
}
Booking deleted.
C# examples use the .Net Client Library
XmlDocument DeleteBooking ( int bookingId, int channelId )
// ID of the temporary booking to delete
int bookingId = 12345;
// Set the ID for the channel this booking is made with
int channelId = 3930;
// Send the data to the TourCMS API, deleting the Booking
XmlDocument doc = myTourCMS.DeleteBooking(bookingId, channelId);
// Check the status
// Will be "OK" if the booking was updated
string status = doc.SelectSingleNode("//error").InnerText;
Console.WriteLine(status);
OK
VB examples use the .Net Client Library
XmlDocument DeleteBooking ( Integer bookingData, Integer channelId )
' ID of the temporary booking to delete
Dim bookingId As Integer = 12345
' Set the ID for the channel this booking is made with
Dim channelId As Integer = 3930
' Send the data to the TourCMS API, deleting the Booking
Dim doc As XmlDocument = myTourCMS.DeleteBooking(bookingId, channelId)
' Check the status
' Will be "OK" if the booking was updated
Dim status As String = doc.SelectSingleNode("//error").InnerText
Console.WriteLine(status)
OK
NodeJS examples use the NodeJS Wrapper
// Delete temporary booking 8452
TourCMS.deleteBooking({
channelId: 3930,
bookingId: 8452,
callback: function(response) {
console.log(response.error);
}
});
OK
Looking for sample code in a different language? TourCMS and community provided API libraries
XML Node | Notes |
---|---|
id | TourCMS Booking ID number for the booking to delete |
The Channel ID is also sent in the header, if you are using one of the API wrappers this will be the second parameter
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 deleting 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 deleting the booking in a supplier subsystem and if the subsystem has provided a textual explanation it will be included here. |