home > support > API > Marketplace API > API: show booking

Show Booking

PurposeView booking information
NotesTour Operators can view all booking data, Marketplace Partners can view a subset based on their permission level. Learn more.
REST info Call/c/booking/show
FormatsXML
Example/c/booking/show.xml?booking_id=12345
VerbGET
Code

PHP examples use the PHP Client Library with SimpleXML

Description

object show_booking ( int $booking, int $channel )

Parameters

$booking
ID for the booking we want to show
$channel
ID for the channel the booking is made with

Example

// Booking ID number
$booking = 12345

// ID for the channel (supplier) the booking was made with
$channel = 3;

// Query the TourCMS API
$result = $tourcms->show_booking($booking, $channel);

// Get the booking node
$booking = $result->booking;

// Print the booking ID
print $booking->booking_id . "<br />";

// Print the Booking name
print $booking->booking_name . "<br />";

// Format and print the booking start and end dates
$start_date = strtotime($booking->start_date);
$start_date_display = date("jS F Y (l)", $start_date);
print "Start: ".$start_date_display. "<br />";

$end_date = strtotime($booking->end_date);
$end_date_display = date("jS F Y (l)", $end_date);
print "End: " . date("jS F Y (l)", $end_date) . "<br />";
12345
7 Day Hiking Tour
Start: 7th June 2011 (Tuesday)
End: 14th June 2011 (Tuesday)

C# examples use the .Net Client Library

Overload list

XmlDocument ShowBooking (int bookingId, int channelId)

Parameters

bookingId
Booking ID
channelId
ID for the channel that the booking belongs to

Example

// Reference System.Globalization for date formatting
using System.Globalization;


...


// Set the ID of the booking we want to view
int bookingId = 12345;

// Set the ID for the channel this booking is made with
int channelID = 3;

// Query the TourCMS API 
XmlDocument doc = myTourCMS.ShowBooking(bookingId, channelId);

// Check the status
string status = doc.SelectSingleNode("//error").InnerText;

if(status == "OK")
{
 // Get the Booking ID
 string bkgId = doc.SelectSingleNode("//booking/booking_id").InnerText;
 Console.WriteLine(bkgId);

 // Get the Booking Name
 string bkgName = doc.SelectSingleNode("//booking/booking_name").InnerText;
 Console.WriteLine(bkgName);

 DateTime temp = new DateTime();
 
 // Get and format the Start date
 string bkgStart = doc.SelectSingleNode("//booking/start_date").InnerText;
 temp = DateTime.Parse(bkgStart);
 bkgStart = temp.ToString("D", CultureInfo.CreateSpecificCulture("en-US"));
 Console.WriteLine(bkgStart);

 // Get and format the End date
 string bkgEnd = doc.SelectSingleNode("//booking/end_date").InnerText;
 temp = DateTime.Parse(bkgEnd);
 bkgEnd = temp.ToString("D", CultureInfo.CreateSpecificCulture("en-US"));
 Console.WriteLine(bkgEnd);

} else {
 Console.WriteLine("Error: " + status);
}
12345
7 Day Hiking Tour
Tuesday, June 07, 2011
Tuesday, June 14, 2011

VB examples use the .Net Client Library

Overload list

XmlDocument ShowBooking (int bookingId, int channelId)

Parameters

bookingId
Booking ID
channelId
ID for the channel that the booking belongs to

Example

' Reference System.Globalization for date formatting
Imports System.Globalization


...


' Set the ID of the booking we want to view
Dim bookingId As Integer = 12345

' Set the ID for the channel this booking is made with
Dim channelID As Integer = 3

' Query the TourCMS API 
Dim doc As XmlDocument = myTourCMS.ShowBooking(bookingId, channelId)

' Check the status
Dim status As String = doc.SelectSingleNode("//error").InnerText

If status = "OK" Then

 ' Get the Booking ID
 Dim bkgId As String = doc.SelectSingleNode("//booking/booking_id").InnerText
 Console.WriteLine(bkgId)

 ' Get the Booking Name
 Dim bkgName As String = doc.SelectSingleNode("//booking/booking_name").InnerText
 Console.WriteLine(bkgName)

 Dim temp As DateTime = new DateTime()
 
 ' Get and format the Start date
 Dim bkgStart As String = doc.SelectSingleNode("//booking/start_date").InnerText
 temp = DateTime.Parse(bkgStart)
 bkgStart = temp.ToString("D", CultureInfo.CreateSpecificCulture("en-US"))
 Console.WriteLine(bkgStart)

 ' Get and format the End date
 Dim bkgEnd As String = doc.SelectSingleNode("//booking/end_date").InnerText
 temp = DateTime.Parse(bkgEnd)
 bkgEnd = temp.ToString("D", CultureInfo.CreateSpecificCulture("en-US"))
 Console.WriteLine(bkgEnd)

Else If

 Console.WriteLine("Error: " & status)

End If
12345
7 Day Hiking Tour
Tuesday, June 07, 2011
Tuesday, June 14, 2011

Querystring parameters

Querystring parameters
XML NodeNotes
booking_id Internal ID number for a booking (perhaps retrieved via Search Bookings)

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
booking

The booking node contains the following child nodes.

XML NodeNotes
(Basic information)
booking_idBooking ID
channel_idChannel ID
account_idAccount ID
channel_nameCompany brand name, e.g. "Example Tours"
made_date_timeDate and time the booking was made, in the local time of the channel account. Format is YYYY-MM-DD HH:MM:SS (24 hr)
start_dateDate the booking starts, generally based on the local time of the item being booked. Format is YYYY-MM-DD
end_dateDate the booking ends, generally based on the local time of the item being booked. Format is YYYY-MM-DD
booking_nameName for the booking (not the customer). Often this is the same as the main item being booked however it can be changed (for example on Tailor made / personalised bookings)
(Customer information)
lead_customer_idID number for the lead customer
lead_customer_nameLead customer full name. Built from other name components
lead_customer_travelling1 if the lead customer is travelling on the booking, 0 if they aren't
customer_countNumber of customers on the booking. E.g. 2
customers

There will be a customers node containing...

XML NodeNotes
customer

... a customer node for each customer, contaiing:

XML NodeNotes
customer_idInternal ID
customer_nameE.g. "Mr Joe Bloggs"
If Permission Level 3 or above ?
gender"m" if male, "f" if female, blank if unknown
dobDate of birth YYYY-MM-DD
agecatAge category - 1 digit code (i-Infant, c-Child, a-Adult, s-Senior). Based on age at end of booking
insurance_numberTravel insurance number
insurance_supplier_nameTravel insurance supplier
insurance_noteTravel insurance note
If API called by Tour Operator ?
insurance_supplier_idInternal supplier ID number for the travel insurance
(Revenue and deposit information)
sale_currency3 digit sale currency, e.g. "USD"
sales_revenueAmount of revenue (in the sale_currency but excluding any currenct information)
sales_revenue_displayDisplay version of the revenue, includes currency symbol where applicable (e.g. US$100.00)
depositDeposit amount for the booking, regardless of whether it has been paid e.g. 100
deposit_displayDisplay version of the deposit, includes currency symbol where applicable e.g. US$100.00
(Booking status information)
statusStatus of the booking
 
0 - Quote
1 - Provisional
2 - Confirmed
3 - Confirmed & archived
 
NB: If cancel_reason reason is set then the booking may be cancelled, for example it's possible to have a "Provisional" booking that is cancelled.
status_textTextual representation of the booking status.
E.g. "Confirmed (A)"
cancel_reasonIf a booking is cancelled this field will indicate the reason, if a booking is not cancelled this will be 0.
 

0 - Not cancelled
1 - Cancelled by customer request, see notes
2 - Cancelled by customer request, booked another tour
3 - Cancelled by staff, see notes
4 - Cancelled by staff, boook another tour
5 - Cancelled by staff, payment not received
6 - Cancelled by staff, tour not reached min. numbers
7 - Cancelled by staff, booking made in error
8 - Cancelled by staff, capacity exceeded
9 - Cancelled by staff, operational reasons
10 - Cancelled by staff, booking reopened for editing
11 - Cancelled by staff, bad weather
20 - Cancelled by system, expired quotation
21 - Cancelled by system, expired provisional booking
22 - Cancelled by customer (via website)
23 - Cancelled by agent (via website)

cancel_textTextual representation of the cancellation status.
E.g. "Not cancelled"
(Agent information)
commissionAmount of commission
commission_taxAmount of commission tax
commission_currency3 digit commission currency, e.g. "USD"
commission_displayDisplay version of the commission, includes currency symbol where applicable (e.g. US$20.00)
commission_tax_displayDisplay version of the commission tax, includes currency symbol where applicable (e.g. US$2.50)
tracking_miscidA numeric value that can be set on the tracked links to divide up online tracking into sections (e.g. specific online marketing campaigns)
agent_refCould be a booking reference for the booking in the agent's own system
(Payment summary)
payment_statusNumeric representation of the booking payment status.
 
0 - No payment
1 - Deposit paid
2 - Deposit paid #2
3 - Full balance paid
4 - Refunded
payment_status_textTextual representation of the payment status.
E.g. "Full balance paid"
balance_owed_byEither C if the balance is owed by the customer (e.g. affiliate type booking), or A if the balance is owed by the Agent
balanceAmount remaining to be paid on the booking (in the sale_currency)
balance_displayDisplay version of the amount remaining to be paid on the booking, includes currency symbol where applicable (e.g. US$200.00)
balance_dueWhen the remaining balance is due. YYYY-MM-DD
If Permission Level 3 or above ?
customer_special_requestText containing any special requests the customer has made
customers_agecat_breakdownE.g. "2 Adults"
payments

If any payments have been made there will be a payments node containing the following child nodes.

XML NodeNotes
payment

There will be a payment node for each

XML NodeNotes
payment_date_timeDate and Time for payment in the channel accounts local time. YYYY-MM-DD HH:MM:SS (24 Hr)
payment_valueValue of the payment, e.g. 100.00
payment_currencyCurrency of the payment, e.g. EUR
payment_value_displayDisplay version including currency symbol/code
payment_typeFree text
e.g. "Credit card"
payment_referencePayment reference
payment_notePayment note
paid_byC if customer, A if agent
paid_by_idEither a customer or agent ID
If API called by Tour Operator (not Marketplace Partner) ?
important_noteThe staff entered "pinned note" on the booking
workflow_noteThe staff entered note form the "workflow" tab on the booking
custom_fields

If any custom fields are configured then a custom_fields node will be returned containing the following:.

XML NodeNotes
field

If any custom fields are configured then a custom_fields node will be returned containing the following:.

XML NodeNotes
nameCustom field name E.g. PickupPoint
valueValue for the custom field E.g. Hilton Hotel

? Permission levels

Tour Operators will be able to view all data. The data visible to Marketplace Partners depends on the permission level granted on that particular channel (set by the channel operator when they connect). Marketplace Partners granted permission level 2 or above will be able to see most of the booking information plus basic customer details. Marketplace Partners granted permission level 3 will be able to see a bit more information on each customer including age/dob information plus a breakdown of payments made on the booking.

Remember, Marketplace Partners will only be able to see bookings that have their agent record set (i.e. either the booking or the customer came to the Operator via the Marketplace Partner).

More information

© 2003-2012 Travel UCD Limited. All rights reserved. TourCMS® is a registered trademark of Travel UCD Limited, United Kingdom. View Privacy policy.

Free 1 hour webinar - An introduction to TourCMS, 31st May @ 3pm GMT / 4pm BST (UK). Check in your timezone and register »