home > support > API > Marketplace API > Create Customer
Creates a new customer with the specified data.
For Tour Operator usage only (not accessible by Marketplace Agents).
Endpoint | /c/customer/create |
Formats | XML |
Example | /c/customer/create.xml |
Verb | POST |
PHP examples use the PHP Client Library with the return type set to SimpleXML
object create_customer(SimpleXmlElement $customer, int $channel)
// Create a new SimpleXMLElement with new customer details.
$customer = new SimpleXMLElement('<customer />');
$customer->addChild('email', 'testEmail@testing.com');
$customer->addChild('username', 'testEmail@testing.com');
$customer->addChild('firstname', 'Tester');
$customer->addChild('surname', 'TestTest');
// Define the channel ID the tour belongs to.
$channel = 3930;
// Call TourCMS API, creating the new customer.
$result = $tourcms->create_customer($customer, $channel);
if ($result->error == 'OK') {
print("Customer with the ID:". $result->customer_id. " has been successfully created.");
} else {
print("An error has ocurred: ".$result->error);
}
New customer created
Looking for sample code in a different language? TourCMS and community provided API libraries
Enter your TourCMS API credentials below to call the Create Customer endpoint.
Take care, submitting this form will modify live data!
There are no querystring parameters.
The following fields can be posted as XML when calling the API method. The username is the only non-required field.
XML NODE | Notes | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
customer |
Create Customer node contains:
|
XML Node | Notes | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
response |
Create Customer node contains:
|