CreateCustomer
Creates a new Customer. Can optionally be put in one or more trees.Input Properties
CreateCustomerRequest
Output Properties
CreateCustomerResponse
Http Request
POST https://yourcompany-api.exigo.com/3.0/customers HTTP/1.1 Content-Type: application/json Authorization: Basic base64Encoded(yourlogin@yourcompany:yourpassword){ "firstName": "John", "lastName": "Doe", "company": "ACME, Inc.", "customerType": 1, "customerStatus": 1, "email": "joecool@me.com", "phone": "555-555-5555", "mainAddress1": "123 Some Street", "mainCity": "Dallas", "mainState": "TX", "mainZip": "75207", "mailState": "1", "mailCountry": "1", "otherState": "1", "otherCountry": "1", "taxIDType": "SSN", "middleName": "1", "nameSuffix": "1", "binaryPlacementPreference": 1, "useBinaryHoldingTank": true, "mainAddressVerified": true, "mailAddressVerified": true, "otherAddressVerified": true, "payableTy": "Check" }
Http Response
HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 Content-Length: length{ "customerID": 1, "customerKey": "", "result": null }
Soap Request
The following is a sample SOAP 1.1 request and response. The placeholders shown need to be replaced with actual values.
POST /3.0/ExigoApi.asmx HTTP/1.1 Host: totallife-api.exigo.com Content-Type: text/xml; charset=utf-8 Content-Length: length SOAPAction: "https://api.exigo.com/CreateCustomer" <?xml version="1.0" encoding="utf-8"?> <soap:Envelope
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Header> <ApiAuthentication xmlns="http://api.exigo.com/"> <LoginName>string</LoginName> <Password>string</Password> <Company>string</Company> <Identity>string</Identity> <RequestTimeUtc>dateTime</RequestTimeUtc> <Signature>string</Signature> </ApiAuthentication> </soap:Header> <soap:Body> <CreateCustomerRequest xmlns="http://api.exigo.com/"> <FirstName>string</FirstName> <LastName>string</LastName> <Company>string</Company> <CustomerType>int</CustomerType> <CustomerStatus>int</CustomerStatus> <Email>string</Email> <Phone>string</Phone> <Phone2>string</Phone2> <MobilePhone>string</MobilePhone> <Fax>string</Fax> <Notes>string</Notes> <MainAddress1>string</MainAddress1> <MainAddress2>string</MainAddress2> <MainAddress3>string</MainAddress3> <MainCity>string</MainCity> <MainState>string</MainState> <MainZip>string</MainZip> <MainCountry>string</MainCountry> <MainCounty>string</MainCounty> <MailAddress1>string</MailAddress1> <MailAddress2>string</MailAddress2> <MailAddress3>string</MailAddress3> <MailCity>string</MailCity> <MailState>string</MailState> <MailZip>string</MailZip> <MailCountry>string</MailCountry> <MailCounty>string</MailCounty> <OtherAddress1>string</OtherAddress1> <OtherAddress2>string</OtherAddress2> <OtherAddress3>string</OtherAddress3> <OtherCity>string</OtherCity> <OtherState>string</OtherState> <OtherZip>string</OtherZip> <OtherCountry>string</OtherCountry> <OtherCounty>string</OtherCounty> <CanLogin>boolean</CanLogin> <LoginName>string</LoginName> <LoginPassword>string</LoginPassword> <InsertEnrollerTree>boolean</InsertEnrollerTree> <EnrollerID>int</EnrollerID> <InsertUnilevelTree>boolean</InsertUnilevelTree> <SponsorID>int</SponsorID> <UseManualCustomerID>boolean</UseManualCustomerID> <ManualCustomerID>int</ManualCustomerID> <TaxID>string</TaxID> <SalesTaxID>string</SalesTaxID> <SalesTaxExemptExpireDate>dateTime</SalesTaxExemptExpireDate> <IsSalesTaxExempt>boolean</IsSalesTaxExempt> <BirthDate>dateTime</BirthDate> <Field1>string</Field1> <Field2>string</Field2> <Field3>string</Field3> <Field4>string</Field4> <Field5>string</Field5> <Field6>string</Field6> <Field7>string</Field7> <Field8>string</Field8> <Field9>string</Field9> <Field10>string</Field10> <Field11>string</Field11> <Field12>string</Field12> <Field13>string</Field13> <Field14>string</Field14> <Field15>string</Field15> <SubscribeToBroadcasts>boolean</SubscribeToBroadcasts> <SubscribeFromIPAddress>string</SubscribeFromIPAddress> <CurrencyCode>string</CurrencyCode> <PayableToName>string</PayableToName> <EntryDate>dateTime</EntryDate> <DefaultWarehouseID>int</DefaultWarehouseID> <PayableType>Check or WireTransfer or PaymentCard or DirectDeposit or OnHold or BankWire or DebitCardHold or Other100</PayableType> <CheckThreshold>decimal</CheckThreshold> <TaxIDType>string</TaxIDType> <LanguageID>int</LanguageID> <Gender>Unknown or Male or Female</Gender> <VatRegistration>string</VatRegistration> <Date1>dateTime</Date1> <Date2>dateTime</Date2> <Date3>dateTime</Date3> <Date4>dateTime</Date4> <Date5>dateTime</Date5> <MiddleName>string</MiddleName> <NameSuffix>string</NameSuffix> <BinaryPlacementPreference>int</BinaryPlacementPreference> <UseBinaryHoldingTank>boolean</UseBinaryHoldingTank> <MainAddressVerified>boolean</MainAddressVerified> <MailAddressVerified>boolean</MailAddressVerified> <OtherAddressVerified>boolean</OtherAddressVerified> <SponsorKey>string</SponsorKey> <EnrollerKey>string</EnrollerKey> <ManualCustomerKey>string</ManualCustomerKey> <PayableTy>string</PayableTy> </CreateCustomerRequest> </soap:Body> </soap:Envelope>
Soap Response
HTTP/1.1 200 OK Content-Type: text/xml; charset=utf-8 Content-Length: length <?xml version="1.0" encoding="utf-8"?> <soap:Envelope
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <CreateCustomerResult xmlns="http://api.exigo.com/"> <CustomerID>int</CustomerID> <CustomerKey>string</CustomerKey> </CreateCustomerResult> </soap:Body> </soap:Envelope>
C# Rest Client
Install Nuget package Exigo.Api.Client
try
{
//Create Api Client
var api = new ExigoApiClient("yourcmpany", "yourlogin", "yourpassword");
//Create Request
var req = new CreateCustomerRequest();
req.FirstName = "John"; //The customer's first name
req.LastName = "Doe"; //The customer's last name
req.Company = "ACME, Inc."; //The customer's company name
req.CustomerType = 1; //The customer's type as defined by the company
req.CustomerStatus = 1; //The customer's status as defined by the company. Defaults to 1.
req.Email = "joecool@me.com";
req.Phone = "555-555-5555";
req.MainAddress1 = "123 Some Street";
req.MainCity = "Dallas";
req.MainState = "TX"; //The state of the customer's primary address. This field is required if MainAddress1 is provided.
req.MainZip = "75207";
req.MailState = "1"; //The state of the customer's mailing address. This field is required if MailAddress1 is provided.
req.MailCountry = "1"; //The country of the customer's mailing address. This field is required if MailAddress1 is provided.
req.OtherState = "1"; //The state of the customer's other address. This field is required if OtherAddress1 is provided.
req.OtherCountry = "1"; //The country of the customer's other address. This field is required if OtherAddress1 is provided.
req.TaxIDType = "SSN";
req.MiddleName = "1"; //The customer's middle name
req.NameSuffix = "1"; //The customer's name suffix
req.BinaryPlacementPreference = 1;
req.UseBinaryHoldingTank = true;
req.MainAddressVerified = true;
req.MailAddressVerified = true;
req.OtherAddressVerified = true;
req.PayableTy = "Check";
//Send Request to Server and Get Response
var res = await api.CreateCustomerAsync(req);
//Now examine the results:
Console.WriteLine("CustomerID: {0}", res.CustomerID);
Console.WriteLine("CustomerKey: {0}", res.CustomerKey);
}
catch (Exception ex)
{
Console.WriteLine("Error: " + ex.Message);
}
C# Soap Client
try
{
//Create Main API Context Object
ExigoApi api = new ExigoApi();
//Create Authentication Header
ApiAuthentication auth = new ApiAuthentication();
auth.LoginName = "yourLoginName";
auth.Password = "yourPassword";
auth.Company = "yourCompany";
api.ApiAuthenticationValue = auth;
//Create Request
CreateCustomerRequest req = new CreateCustomerRequest();
req.FirstName = "John"; //The customer's first name
req.LastName = "Doe"; //The customer's last name
req.Company = "ACME, Inc."; //The customer's company name
req.CustomerType = 1; //The customer's type as defined by the company
req.CustomerStatus = 1; //The customer's status as defined by the company. Defaults to 1.
req.Email = "joecool@me.com";
req.Phone = "555-555-5555";
req.MainAddress1 = "123 Some Street";
req.MainCity = "Dallas";
req.MainState = "TX"; //The state of the customer's primary address. This field is required if MainAddress1 is provided.
req.MainZip = "75207";
req.MailState = "1"; //The state of the customer's mailing address. This field is required if MailAddress1 is provided.
req.MailCountry = "1"; //The country of the customer's mailing address. This field is required if MailAddress1 is provided.
req.OtherState = "1"; //The state of the customer's other address. This field is required if OtherAddress1 is provided.
req.OtherCountry = "1"; //The country of the customer's other address. This field is required if OtherAddress1 is provided.
req.TaxIDType = "SSN";
req.MiddleName = "1"; //The customer's middle name
req.NameSuffix = "1"; //The customer's name suffix
req.BinaryPlacementPreference = 1;
req.UseBinaryHoldingTank = true;
req.MainAddressVerified = true;
req.MailAddressVerified = true;
req.OtherAddressVerified = true;
req.PayableTy = "Check";
//Send Request to Server and Get Response
CreateCustomerResponse res = api.CreateCustomer(req);
//Now examine the results:
Console.WriteLine("CustomerID: {0}", res.CustomerID);
Console.WriteLine("CustomerKey: {0}", res.CustomerKey);
}
catch (Exception ex)
{
Console.WriteLine("Error: " + ex.Message);
}
VB.Net
Try
'Create Main API Context Object
Dim api as new ExigoApi()
'Create Authentication Header
Dim auth as new ApiAuthentication()
auth.LoginName = "yourLoginName"
auth.Password = "yourPassword"
auth.Company = "yourCompany"
api.ApiAuthenticationValue = auth
'Create Request
Dim req as new CreateCustomerRequest()
req.FirstName = "John"
req.LastName = "Doe"
req.Company = "ACME, Inc."
req.CustomerType = 1
req.CustomerStatus = 1
req.Email = "joecool@me.com"
req.Phone = "555-555-5555"
req.MainAddress1 = "123 Some Street"
req.MainCity = "Dallas"
req.MainState = "TX"
req.MainZip = "75207"
req.MailState = "1"
req.MailCountry = "1"
req.OtherState = "1"
req.OtherCountry = "1"
req.TaxIDType = "SSN"
req.MiddleName = "1"
req.NameSuffix = "1"
req.BinaryPlacementPreference = 1
req.UseBinaryHoldingTank = true
req.MainAddressVerified = true
req.MailAddressVerified = true
req.OtherAddressVerified = true
req.PayableTy = "Check"
'Send Request to Server and Get Response
Dim res As CreateCustomerResponse = api.CreateCustomer(req)
'Now examine the results:
Console.WriteLine("CustomerID: {0}", res.CustomerID)
Console.WriteLine("CustomerKey: {0}", res.CustomerKey)
Catch ex As Exception
Console.WriteLine("Error: " & ex.Message)
End Try
PHP
Note: PHP is not officially supported.<?php
try
{
//Setup the SoapClient and Authentication
$api = new SoapClient("http://api.exigo.com/3.0/ExigoApi.asmx?WSDL");
$ns = "http://api.exigo.com/";
$auth = array()
$auth["LoginName"] = new SoapVar("yourLoginName",XSD_STRING,null,null,null,$ns);
$auth["Password"] = new SoapVar("yourPassword",XSD_STRING,null,null,null,$ns);
$auth["Company"] = new SoapVar("yourCompany",XSD_STRING,null,null,null,$ns);
$headerBody = new SoapVar($auth, SOAP_ENC_OBJECT);
$header = new SoapHeader($ns, 'ApiAuthentication', $headerBody);
$api->__setSoapHeaders(array($header));
//Create Request
$req->FirstName = "John";
$req->LastName = "Doe";
$req->Company = "ACME, Inc.";
$req->CustomerType = 1;
$req->CustomerStatus = 1;
$req->Email = "joecool@me.com";
$req->Phone = "555-555-5555";
$req->MainAddress1 = "123 Some Street";
$req->MainCity = "Dallas";
$req->MainState = "TX";
$req->MainZip = "75207";
$req->MailState = "1";
$req->MailCountry = "1";
$req->OtherState = "1";
$req->OtherCountry = "1";
$req->TaxIDType = "SSN";
$req->MiddleName = "1";
$req->NameSuffix = "1";
$req->BinaryPlacementPreference = 1;
$req->UseBinaryHoldingTank = 1;
$req->MainAddressVerified = 1;
$req->MailAddressVerified = 1;
$req->OtherAddressVerified = 1;
$req->PayableTy = "Check";
//Send Request to Server and Get Response
$res = $api.CreateCustomer($req);
//Now examine the results:
}
catch (SoapFault $ex)
{
echo "Error: ", $ex->getMessage();
}
?>
Java
Note: Java is not officially supported.try
{
//Create Main API Context Object
ExigoApi api = new ExigoApi();
//Create Authentication Header
ApiAuthentication auth = new ApiAuthentication();
auth.setLoginName("yourLoginName");
auth.setPassword("yourPassword");
auth.setCompany("yourCompany");
api.setApiAuthenticationValue(auth);
//Create Request
CreateCustomerRequest req = new CreateCustomerRequest();
req.setFirstName("John");
req.setLastName("Doe");
req.setCompany("ACME, Inc.");
req.setCustomerType(1);
req.setCustomerStatus(1);
req.setEmail("joecool@me.com");
req.setPhone("555-555-5555");
req.setMainAddress1("123 Some Street");
req.setMainCity("Dallas");
req.setMainState("TX");
req.setMainZip("75207");
req.setMailState("1");
req.setMailCountry("1");
req.setOtherState("1");
req.setOtherCountry("1");
req.setTaxIDType("SSN");
req.setMiddleName("1");
req.setNameSuffix("1");
req.setBinaryPlacementPreference(1);
req.setUseBinaryHoldingTank(1);
req.setMainAddressVerified(1);
req.setMailAddressVerified(1);
req.setOtherAddressVerified(1);
req.setPayableTy("Check");
//Send Request to Server and Get Response
CreateCustomerResponse res = api.getExigoApiSoap().createCustomer(req, auth);
//Now examine the results:
}
catch (Exception ex)
{
System.out.println("Error: " + ex.getMessage());
}