home > support > API > Marketplace API > delete booking

Delete Booking

Delete a booking, releasing availability


Notes

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 :)

REST info

Call/c/booking/delete
FormatsXML
ExampleURL: /c/booking/delete.xml?booking_id=12345
VerbPOST

Code samples

PHP examples use the PHP Client Library with SimpleXML

Description

object delete_booking ( int $booking, int $channel )


Parameters

$booking
ID number for the booking to delete
$channel
ID number for the channel the booking belongs to

Example

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

Overload list

XmlDocument DeleteBooking ( int bookingId, int channelId )


Parameters

bookingId
ID number of the Temporary booking to delete
channelId
ID number for the channel the booking belongs to

Example

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

Overload list

XmlDocument DeleteBooking ( Integer bookingData, Integer channelId )


Parameters

bookingId
ID number of the Temporary booking to delete
channelId
ID number for the channel the booking belongs to

Example

' 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


Example

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

Querystring parameters

Querystring parameters
XML NodeNotes
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

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