home > support > API > Marketplace API > show customer
Show the details of an individual customer
Tour Operators can view all customer data, Marketplace Agents can view a subset based on their permission level.
Additional methods can be used to retrieve lists of bookings or enquiries the customer has made.
Endpoint | /c/customer/show |
Formats | XML |
Example | /c/customer/show.xml?customer_id=12345 |
Verb | GET |
PHP examples use the PHP Client Library with SimpleXML
object show_customer ( int $customer, int $channel )
// Set the channel ID
// For tour operators this can be found in their API settings page
// For Marketplace Partners set this to the channel the Customer is in
$channel = 3;
// Set the customer ID
$customer = 12345
// Query the TourCMS API
$result = $tourcms->show_customer($customer, $channel);
// Print out the customers name
print $result->customer->customer_name;
Mr Joe Bloggs
C# examples use the .Net Client Library
XmlDocument ShowCustomer (int customerId, int channelId)
// ID for the customer
int customerId = 12345;
// ID for the channel (supplier) the customer belongs to
int channelId = 3;
// Call the TourCMS API
XmlDocument doc = myTourCMS.ShowCustomer(customerId, channelId);
// Check the status of the response
string status = doc.SelectSingleNode("//error").InnerText;
// If the status is "OK" TourCMS will have returned our Customer
if ( status == "OK" )
{
// Success! Print out the customers name
string cust = doc.SelectSingleNode("//customer/customer_name").InnerText;
Console.WriteLine(cName);
} else {
// Failure! Print out the error text to debug
Console.WriteLine("Error: " + status);
}
Mr Joe Bloggs
VB examples use the .Net Client Library
XmlDocument ShowCustomer (Integer customerId, Integer channelId)
' ID for the customer
Dim customerId As Integer = 12345
' ID for the channel (supplier) the enquiry belongs to
Dim channelId As Integer = 3;
' Call the TourCMS API
Dim doc As XmlDocument = myTourCMS.ShowCustomer(customerId, channelId)
' Check the status of the response
Dim status As String = doc.SelectSingleNode("//error").InnerText
' If the status is "OK" TourCMS will have returned our Customer
If status = "OK" Then
' Success! Print out the Customer name
Dim cust As String =
doc.SelectSingleNode("//customer/customer_name").InnerText;
Console.WriteLine(cName
Else
' Failure! Print out the error text to debug
Console.WriteLine("Error: " & status)
End If
Mr Joe Bloggs
NodeJS examples use the NodeJS Wrapper
TourCMS.showCustomer({
channelId: 3930,
customerId: 3766892,
callback: function(response) {
console.log(response.customer.firstname + " " + response.customer.surname);
}
});
Joe Bloggs
Looking for sample code in a different language? TourCMS and community provided API libraries
Enter your TourCMS API credentials below to call the Show Customer endpoint.
Parameter | Notes |
---|---|
customer_id | ID number for the customer, for those using the API wrapper libraries this is passed as the first parameter (the second being the corresponding channel ID) |
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 | customer |
If a customer is found there will be a customer node containing the following child nodes.
|
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 3 can see everything except the customer username and password (and agent details - however they would merely point to the Partners own details), those granted permission level 2 can only see basic customer name details, those granted permission level 1 cannot view any customer information.
Remember, Marketplace Partners will only be able to see customers who have their agent record set (i.e. they came to the Operator via a click/enquiry/booking from the Marketplace Partner).