AddCustomer

Description

This method adds a customer to your stored customer database so that their information can be recalled at a later date.

The customer will be assigned a unique customer number by the gateway (CustomerInternalId), which you can then use to establish recurring billing cycles, recall customer data, and manually charge the customer for later products or services without needing to reenter their information.

Syntax

CustomerResponse AddCustomer(SecurityToken securityToken,Customer customer);

Arguments

Type

Name

Description

SecurityToken

securityToken

Merchant security token: used to identify merchant and validate transaction. (required)

Customer

customer

Includes customer information, such as customer number, merchant-assigned customer ID, billing address, receipt settings, recurring billing settings, and other pertinent information. (required)

Return Value

Type

Description

CustomerResponse

Returns result of AddCustomer request.

Examples

var client = new IeBizServiceClient();
SecurityToken securityToken = new SecurityToken();
Customer customer = new Customer();
securityToken.UserId = "userid";
securityToken.SecurityId = "2dc496d1-90b4-4a38-ad78-28a795af78e7";
securityToken.Password = "userPassword";
customer.FirstName = "Mark";
customer.LastName = "Wilson";
customer.CompanyName = "CBS";
customer.CustomerId = "C-E&000002";
customer.CellPhone = "714-555-5014";
customer.Fax = "714-555-5010";
customer.Phone = "714-555-5015";
customer.BillingAddress = new eBizChargeConnectSOAP.Address();
customer.BillingAddress.Address1 = "20 Pacifica";
customer.BillingAddress.Address2 = "Suite 1450";
customer.BillingAddress.City = "Irvine";
customer.BillingAddress.ZipCode = "92618";
customer.BillingAddress.State = "CA";
CustomerResponse Response = client.AddCustomer(securityToken, customer);

Console.WriteLine(Response.CustomerInternalId);
Console.WriteLine(Response.Status);
Console.WriteLine(Response.StatusCode);
Console.WriteLine(Response.Error);
Console.WriteLine(Response.ErrorCode);
Request:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ebiz="http://eBizCharge.ServiceModel.SOAP">
   <soapenv:Header/>
   <soapenv:Body>
      <ebiz:AddCustomer>
         <ebiz:securityToken>
            <ebiz:SecurityId>2bc496d1-90b4-4a38-ad78-28a795af78e9</ebiz:SecurityId>
            <ebiz:UserId>userid</ebiz:UserId>
            <ebiz:Password>userpassword</ebiz:Password>
         </ebiz:securityToken>
         <ebiz:customer>
            <ebiz:MerchantId/>
            <ebiz:CustomerInternalId/>
            <ebiz:CustomerId>mm-0011-03</ebiz:CustomerId>
            <ebiz:FirstName>Dan</ebiz:FirstName>
            <ebiz:LastName>Tran</ebiz:LastName>
            <ebiz:CompanyName>CBS</ebiz:CompanyName>
            <ebiz:Phone>1-888-500-7798</ebiz:Phone>
            <ebiz:CellPhone>1-714-555-2834</ebiz:CellPhone>
            <ebiz:Fax>1-888-500-7797</ebiz:Fax>
            <ebiz:Email>[email protected]</ebiz:Email>
            <ebiz:WebSite>https://ebizcharge.com</ebiz:WebSite>
            <ebiz:RecurringBillingData>
               <ebiz:RecurringBilling>
                  <ebiz:Amount>1000.00</ebiz:Amount>
                  <ebiz:Enabled>true</ebiz:Enabled>
                  <ebiz:Expire>2005-09-12T01:55:02-07:00</ebiz:Expire>
                  <ebiz:Next>2006-11-29T09:20:00</ebiz:Next>
                  <ebiz:NumLeft></ebiz:NumLeft>
                  <ebiz:Schedule></ebiz:Schedule>
               </ebiz:RecurringBilling>
            </ebiz:RecurringBillingData>
            <ebiz:BillingAddress>
               <ebiz:FirstName>m</ebiz:FirstName>
               <ebiz:LastName>e</ebiz:LastName>
               <ebiz:CompanyName></ebiz:CompanyName>
               <ebiz:Address1></ebiz:Address1>
               <ebiz:Address2>r</ebiz:Address2>
               <ebiz:City></ebiz:City>
               <ebiz:State></ebiz:State>
               <ebiz:ZipCode></ebiz:ZipCode>
            </ebiz:BillingAddress>
            <ebiz:ShippingAddress>
               <ebiz:FirstName></ebiz:FirstName>
               <ebiz:LastName></ebiz:LastName>
               <ebiz:CompanyName></ebiz:CompanyName>
               <ebiz:Address1></ebiz:Address1>
               <ebiz:Address2></ebiz:Address2>
               <ebiz:City></ebiz:City>
               <ebiz:State></ebiz:State>
               <ebiz:ZipCode></ebiz:ZipCode>
            </ebiz:ShippingAddress>
         </ebiz:customer>
      </ebiz:AddCustomer>
   </soapenv:Body>
</soapenv:Envelope>



Response:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
   <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <AddCustomerResponse xmlns="http://eBizCharge.ServiceModel.SOAP">
         <AddCustomerResult>
            <CustomerId>mm-0011-03</CustomerId>
            <CustomerInternalId>412ed96f-9e4a-4e77-a55b-328a826d43db</CustomerInternalId>
            <Status>Success</Status>
            <StatusCode>1</StatusCode>
            <Error/>
            <ErrorCode>0</ErrorCode>
         </AddCustomerResult>
      </AddCustomerResponse>
   </s:Body>
</s:Envelope>