home > support > API > Marketplace API > show customer
Customer Show
| Purpose | Show the details of a specific customer. |
| Notes | Tour Operators can view all customer data, Marketplace Partners can view a subset based on their permission level. Learn more. Don't forget there are methods to retrieve lists of bookings or enquiries the customer has made too. |
| REST info |
Call | /c/customer/show |
| Formats | XML |
| Example | /c/customer/show.xml?customer_id=12345 |
| Verb | GET |
| Code |
PHP examples use the PHP Client Library with SimpleXML
Description
object show_customer ( int $customer, int $channel )
Parameters
$customer
ID number for the customer
$channel
ID number for the channel the customer belongs to
Example
// 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
Overload list
XmlDocument ShowCustomer (int customerId, int channelId)
Parameters
customerId
Internal TourCMS customer ID
channelId
ID for the channel that the enquiry belongs to
Example
// 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
Overload list
XmlDocument ShowCustomer (Integer customerId, Integer channelId)
Parameters
customerId
Internal TourCMS customer ID
channelId
ID for the channel that the enquiry belongs to
Example
' 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
|
Querystring parameters
Querystring parameters
| 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) |
Response fields
Response fields
| 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.
| XML Node | Notes |
| Fields available to Partners with Permission Level 2 or above ? |
| customer_id | ID number for the Customer record |
| channel_id | Channel ID |
| account_id | Account ID |
| title | Title (e.g. Mr, Mrs, Miss etc) |
| firstname | Firstname |
| middlename | Middle name |
| surname | Surname |
| customer_name | Constructed from title, firstname, middle name and surname |
| staff | 1 if customer is a member of staff, otherwise 0 |
| Fields available to Partners with Permission Level 3 or above ? |
| email | Email address |
| tel_home | Tel home / evening (other phone number fields are listed in the "Not so commonly used fields" section below, however if only taking one phone number then use this field) |
| address | Address (can be multi-line) |
| tel_work | Tel work / day |
| tel_mobile | Tel mobile |
| tel_sms | Tel sms |
| fax | Fax number |
| city | City |
| county | County / State |
| postcode | Postcode / Zipcode |
| country | 2 digit country code (uppercase). |
| country_text | English text representation of the customer country code |
| nationality | 2 digit country code (uppercase). |
| nationality_text | English text representation of the customer nationality code |
| gender | The customers gender. Will be blank if gender is unknown, otherwise one of the following digits:
m = Male
f = Female
x = Indeterminate |
| dob | Date of Birth (YYYY-MM-DD) |
| agecat | Age category - 1 digit code (i-Infant, c-Child, a-Adult, s-Senior). |
| agecat_text | English text representation of the age category |
| pass_num | Passport number |
| pass_issue | Passport place of issue |
| pass_issue_date | Passport issue date (YYYY-MM-DD) |
| pass_expiry_date | Passport expiry date (YYYY-MM-DD) |
| wherehear | Where did the customer hear about us |
| contact_note | Contact note (e.g. don't call before 8pm) |
| diet | Dietary requirements |
| medical | Medical conditions |
| nok_name | Emergency contact name |
| nok_relationship | Emergency contact relationship |
| nok_tel | Emergency contact telephone number |
| nok_contact | Emergency contact other note (can be multi-line) |
| Fields available to Tour Operators only ? |
| customer_username | Username and password as used by the customer to log into the online booking engine. Customer entered usernames/passwords can be passed to the customer login search API method to build a customer login area. |
| customer_password |
| agent_name | Agent name (if an agent is set on the booking) |
| agent_code | Agent code (if an agent is set on the booking) |
| agent_id | TourCMS internal ID for agent (if an agent is set on the booking) |
| custom_fields |
If any custom fields are configured then a custom_fields node will be returned containing the following:.
| XML Node | Notes |
| field |
If any custom fields are configured then a custom_fields node will be returned containing the following:.
| XML Node | Notes |
| name | Custom field name E.g. InsideLeg |
| value | Value for the custom field E.g. 32 inches |
|
|
|
? 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 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).
More information