Exigo Web Services API v3.4.179

CreateCustomer

Creates a new Customer. Can optionally be put in one or more trees.

Note: This request can participate in a transaction. Learn more about transactions.

Input Properties

CreateCustomerRequest
PropertyData TypeNotes
FirstNameStringOptional. The customer's first name.
LastNameStringOptional. The customer's last name.
CompanyStringOptional. The customer's company name.
CustomerTypeInt32The customer's type as defined by the company.
CustomerStatusInt32Optional. The customer's status as defined by the company. Defaults to 1.
EmailStringOptional.
PhoneStringOptional.
Phone2StringOptional.
MobilePhoneStringOptional.
FaxStringOptional.
NotesStringOptional.
MainAddress1StringOptional.
MainAddress2StringOptional.
MainAddress3StringOptional.
MainCityStringOptional.
MainStateStringOptional. The state of the customer's primary address. This field is required if MainAddress1 is provided.
MainZipStringOptional.
MainCountryStringOptional. The country of the customer's primary address. This field is required if MainAddress1 is provided.
MainCountyStringOptional.
MailAddress1StringOptional.
MailAddress2StringOptional.
MailAddress3StringOptional.
MailCityStringOptional.
MailStateStringOptional. The state of the customer's mailing address. This field is required if MailAddress1 is provided.
MailZipStringOptional.
MailCountryStringOptional. The country of the customer's mailing address. This field is required if MailAddress1 is provided.
MailCountyStringOptional.
OtherAddress1StringOptional.
OtherAddress2StringOptional.
OtherAddress3StringOptional.
OtherCityStringOptional.
OtherStateStringOptional. The state of the customer's other address. This field is required if OtherAddress1 is provided.
OtherZipStringOptional.
OtherCountryStringOptional. The country of the customer's other address. This field is required if OtherAddress1 is provided.
OtherCountyStringOptional.
CanLoginBooleanOptional. If true, the customer will be able to be authenticated using their login name and password. Defaults to False.
LoginNameStringOptional. The customer's desired login name.
LoginPasswordStringOptional. The customer's desired password.
InsertEnrollerTreeBooleanOptional. If true, the customer will be inserted into the Enroller tree using the provided EnrollerID. Defaults to False.
EnrollerIDInt32The customer's enroller's unique identifier. Required only when InsertEnrollerTree is true.
InsertUnilevelTreeBooleanOptional. If true, the customer will be inserted into the UniLevel tree using the provided SponsorID. Defaults to False.
SponsorIDInt32The customer's UniLevel sponsor's unique identifier. Required only when InsertSponsorTree is true.
UseManualCustomerIDBooleanOptional. If true, the customer's ID will be set to the ID provided in the ManualCustomerID field. Defaults to False.
ManualCustomerIDInt32The ID to use when creating this customer. If set, UseManualCustomerID must also be set to true.
TaxIDStringOptional. The customer's tax ID.
SalesTaxIDStringOptional. The customer's sales tax ID.
SalesTaxExemptExpireDateDateTimeOptional.
IsSalesTaxExemptBooleanOptional. If true, the customer will be considered exempt from sales tax.
BirthDateDateTimeOptional. The customer's birth date. The provided date must be greater than 1/1/1900.
Field1 StringOptional.
Field2 StringOptional.
Field3 StringOptional.
Field4 StringOptional.
Field5 StringOptional.
Field6 StringOptional.
Field7 StringOptional.
Field8 StringOptional.
Field9 StringOptional.
Field10 StringOptional.
Field11 StringOptional.
Field12 StringOptional.
Field13 StringOptional.
Field14 StringOptional.
Field15 StringOptional.
SubscribeToBroadcastsBooleanIf true, the customer will be opted in to receive email broadcasts. Note that the SubscribeFromIPAddress field must also be provided.
SubscribeFromIPAddressStringOptional. The IP address the customer is being subscribed from.
CurrencyCodeStringOptional. The default currency code this customer will use in future transactions. Defaults to 'usd'.
PayableToNameStringOptional.
EntryDateDateTimeThe date the customer was created. The provided date must be greater than 1/1/1900.
DefaultWarehouseIDInt32Optional. The default warehouse this customer will use in future transactions.
PayableType PayableTypeOptional.
CheckThresholdDecimalOptional.
TaxIDType TaxIDTypeOptional.
LanguageIDInt32Optional. The customer's preferred language. Defaults to 0.
Gender GenderOptional. The customer's gender.
VatRegistrationStringOptional.
Date1DateTimeOptional.
Date2DateTimeOptional.
Date3DateTimeOptional.
Date4DateTimeOptional.
Date5DateTimeOptional.
MiddleNameStringOptional. The customer's middle name.
NameSuffixStringOptional. The customer's name suffix.

Output Properties

CreateCustomerResponse
PropertyData TypeNotes
CustomerIDInt32Unique identifier for a customer entity.

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: api.exigo.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://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> </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>SSN or EIN or OtherType3 or OtherType4 or OtherType5 or OtherType6 or OtherType7 or OtherType8 or OtherType9 or OtherType10 or OtherType11 or OtherType12 or OtherType13 or OtherType14 or OtherType15 or OtherType16 or OtherType17 or OtherType18 or OtherType19 or OtherType20</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> </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> </CreateCustomerResult> </soap:Body> </soap:Envelope>

C#

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 = "1";            //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.Date1 = DateTime.Today;

    req.Date2 = DateTime.Today;

    req.Date3 = DateTime.Today;

    req.Date4 = DateTime.Today;

    req.Date5 = DateTime.Today;

    req.MiddleName = "1";           //The customer's middle name

    req.NameSuffix = "1";           //The customer's name suffix

 

    //Send Request to Server and Get Response

    CreateCustomerResponse res = api.CreateCustomer(req);

 

    //Now examine the results:

    Console.WriteLine("CustomerID: {0}", res.CustomerID);

}

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 = "1"

    req.MainZip = "75207"

    req.MailState = "1"

    req.MailCountry = "1"

    req.OtherState = "1"

    req.OtherCountry = "1"

    req.Date1 = DateTime.Today

    req.Date2 = DateTime.Today

    req.Date3 = DateTime.Today

    req.Date4 = DateTime.Today

    req.Date5 = DateTime.Today

    req.MiddleName = "1"

    req.NameSuffix = "1"

 

    'Send Request to Server and Get Response

    Dim res As CreateCustomerResponse = api.CreateCustomer(req)

 

    'Now examine the results:

    Console.WriteLine("CustomerID: {0}", res.CustomerID)

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 = "1";

    $req->MainZip = "75207";

    $req->MailState = "1";

    $req->MailCountry = "1";

    $req->OtherState = "1";

    $req->OtherCountry = "1";

    $req->Date1 = 1;

    $req->Date2 = 1;

    $req->Date3 = 1;

    $req->Date4 = 1;

    $req->Date5 = 1;

    $req->MiddleName = "1";

    $req->NameSuffix = "1";

 

    //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("1");

    req.setMainZip("75207");

    req.setMailState("1");

    req.setMailCountry("1");

    req.setOtherState("1");

    req.setOtherCountry("1");

    req.setDate1(1);

    req.setDate2(1);

    req.setDate3(1);

    req.setDate4(1);

    req.setDate5(1);

    req.setMiddleName("1");

    req.setNameSuffix("1");

 

    //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());

}

CSV

This method does not support csv output.