AddCustomer

Description

The AddCustomer method adds a new Customer to the EBizCharge platform.

Upon creation, the customer is assigned a unique identifier (CustomerInternalId) by EBizCharge. This ID can be utilized to set up recurring billing cycles, retrieve customer data, and facilitate manual charges for future products or services without the need to re-enter the customer's information.

Syntax

CustomerResponse AddCustomer(SecurityToken securityToken, Customer customer)

Arguments

Type

Name

Req.

Description

SecurityToken

securityToken

R

A unique token that is used to identify a merchant and authenticate the API request.

Customer

customer

R

New Customer object to add to the EBizCharge platform.

Required Fields
  • CustomerId

If using the objects below, the following fields are required. Unused obects must be removed from the request.

RecurringBilling:

  • Amount
  • Tax
  • Enabled
  • Start
  • Expire
  • Schedule
  • SendCustomerReceipt

PaymentMethodProfile:

  • Balance
  • MaxBalance

CustomScheduleObject:

  • Interval

Address:

  • IsDefault

Return Value

TypeDescription
CustomerResponseIndicates whether the Customer was successfully added.

Example 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>*************-4621-b899-************</ebiz:SecurityId>
            <ebiz:UserId/>
            <ebiz:Password/>
         </ebiz:securityToken>
         <ebiz:customer>
            <ebiz:MerchantId/>
            <ebiz:CustomerInternalId/>
            <ebiz:CustomerId>CUST-8374</ebiz:CustomerId>
            <ebiz:FirstName/>
            <ebiz:LastName/>
            <ebiz:CompanyName/>
            <ebiz:Phone/>
            <ebiz:CellPhone/>
            <ebiz:Fax/>
            <ebiz:Email/>
            <ebiz:WebSite/>
            <ebiz:RecurringBillingData>
               <!--Zero or more repetitions:-->
               <ebiz:RecurringBilling>
                  <ebiz:Amount>10</ebiz:Amount>
                  <ebiz:Tax>10</ebiz:Tax>
                  <ebiz:Enabled>true</ebiz:Enabled>
                  <ebiz:Start>2025-12-15</ebiz:Start>
                  <ebiz:Expire>2026-06-15</ebiz:Expire>
                  <ebiz:Schedule>monthly</ebiz:Schedule>
                  <ebiz:CustomScheduleObject>
                     <ebiz:Interval>0</ebiz:Interval>
                     <ebiz:Frequency/>
                  </ebiz:CustomScheduleObject>
                  <ebiz:ScheduleName/>
                  <ebiz:ReceiptNote/>
                  <ebiz:ReceiptTemplateName/>
                  <ebiz:SendCustomerReceipt>false</ebiz:SendCustomerReceipt>
                  <ebiz:CustomerEmailList/>
               </ebiz:RecurringBilling>
            </ebiz:RecurringBillingData>
            <ebiz:BillingAddress>
               <ebiz:FirstName/>
               <ebiz:LastName/>
               <ebiz:CompanyName/>
               <ebiz:Address1/>
               <ebiz:Address2/>
               <ebiz:City/>
               <ebiz:State/>
               <ebiz:ZipCode/>
               <ebiz:Country/>
               <ebiz:AddressId/>
               <ebiz:IsDefault>false</ebiz:IsDefault>
            </ebiz:BillingAddress>
            <ebiz:ShippingAddress>
               <ebiz:FirstName/>
               <ebiz:LastName/>
               <ebiz:CompanyName/>
               <ebiz:Address1/>
               <ebiz:Address2/>
               <ebiz:City/>
               <ebiz:State/>
               <ebiz:ZipCode/>
               <ebiz:Country/>
               <ebiz:AddressId/>
               <ebiz:IsDefault>false</ebiz:IsDefault>
            </ebiz:ShippingAddress>
            <ebiz:PaymentMethodProfiles>
               <!--Zero or more repetitions:-->
               <ebiz:PaymentMethodProfile>
                  <ebiz:MethodType/>
                  <ebiz:MethodID/>
                  <ebiz:MethodName/>
                  <ebiz:SecondarySort/>
                  <ebiz:Account/>
                  <ebiz:AccountType/>
                  <ebiz:AccountHolderName/>
                  <ebiz:DriversLicense/>
                  <ebiz:DriversLicenseState/>
                  <ebiz:RecordType/>
                  <ebiz:Routing/>
                  <ebiz:AvsStreet/>
                  <ebiz:AvsZip/>
                  <ebiz:CardCode/>
                  <ebiz:CardExpiration/>
                  <ebiz:CardNumber/>
                  <ebiz:Balance>0</ebiz:Balance>
                  <ebiz:MaxBalance>100</ebiz:MaxBalance>
                  <ebiz:AutoReload/>
                  <ebiz:ReloadSchedule/>
                  <ebiz:ReloadThreshold/>
                  <ebiz:ReloadAmount/>
                  <ebiz:ReloadMethodID/>
               </ebiz:PaymentMethodProfile>
            </ebiz:PaymentMethodProfiles>
            <ebiz:CustomerNotes/>
            <ebiz:SoftwareId/>
            <ebiz:CustomerCustomFields>
               <!--Zero or more repetitions:-->
               <ebiz:EbizCustomField>
                  <ebiz:FieldId/>
                  <ebiz:FieldCaption/>
                  <ebiz:FieldName/>
                  <ebiz:FieldValue/>
                  <ebiz:FieldType/>
                  <ebiz:FieldDataType/>
                  <ebiz:FieldDescription/>
               </ebiz:EbizCustomField>
            </ebiz:CustomerCustomFields>
            <ebiz:DivisionId/>
         </ebiz:customer>
      </ebiz:AddCustomer>
   </soapenv:Body>
</soapenv:Envelope>
public void AddCustomer()
{
  // Initialize the EBizCharge service client
  IeBizServiceClient client = new IeBizServiceClient();

  // Set the SecurityToken credentials
  SecurityToken securityToken = new SecurityToken
  {
    SecurityId = "********-0be8-4bf0-91cd-************",
    UserId = "******",
    Password = "******"
    };

  // Build Customer object to send add to the EBizCharge Connect API
  Customer customer = new Customer();
  customer.CustomerId = "Customer-001C";
  customer.FirstName = "John";
  customer.LastName = "Doe";
  customer.CompanyName = "John's Coffee Shop";
  customer.CellPhone = "1234567890";
  customer.Email = "[email protected]";
  customer.SoftwareId = "Integration Name";
  customer.BillingAddress = new Address()
  {
    CompanyName = "John's Coffee Shop",
    FirstName = "John",
    LastName = "Doe",
    Address1 = "20 Pacifica",
    City = "Irvine",
    State = "CA",
    ZipCode = "92618"
    };
  customer.ShippingAddress = new Address()
  {
    CompanyName = "John's Coffee Shop",
    FirstName = "John",
    LastName = "Doe",
    Address1 = "20 Pacifica",
    City = "Irvine",
    State = "CA",
    ZipCode = "92618"
    };

  // Get the AddCustomer response from the API
  CustomerResponse response = client.AddCustomer(securityToken, customer);

  // Read the results and output to console
  Console.WriteLine($"CustomerInternalId: {response?.CustomerInternalId}");
  Console.WriteLine($"Status: {response?.Status}");
  Console.WriteLine($"StatusCode: {response?.StatusCode}");
  Console.WriteLine($"Error: {response?.Error}");
  Console.WriteLine($"ErrorCode: {response?.ErrorCode}");
}
function addCustomer()
{
  $client = new SoapClient('End point URL');
  $securityToken = array(
  'SecurityId' => '******-454757-4567457-********',
  'UserId' => 'merchant1',
  'Password' => 'merchant1'
);
  $customerData = array(
  'CustomerId' => '123',
  'FirstName' => 'Why',
  'LastName' => 'What',
  'CompanyName' => 'CBS',
  'Phone' => '234-343434',
  'CellPhone' => '44-3343434',
  'Fax' => '234-343434',
  'Email' => '[email protected]',
  'WebSite' => 2,
  'ShippingAddress' => array(
  'FirstName' => 'Why',
  'LastName' => 'What',
  'Company' => 'HereNow',
  'Address1' => 'ST # 8 HS 9 London',
  'Address2' => 'ST # 1 HS 11 London',
  'City' => 'London',
  'State' => 'London',
  'ZipCode' => 'E1 6AN',
  'Country' => 'UK',
  'Phone' => '233-23445',
  'Fax' => '233-234432',
  'Email' => '[email protected]'
),
  'BillingAddress' => array(
  'FirstName' => 'Why',
  'LastName' => 'What',
  'Company' => 'Anycompany',
  'Address1' => 'ST # 266 HS 102 London',
  'Address2' => 'ST # 566 HS 21 London',
  'City' => 'London',
  'State' => 'London',
  'ZipCode' => 'E1 6AN',
  'Country' => 'UK',
  'Phone' => '456-23445',
  'Fax' => '456-234432',
  'Email' => '[email protected]'
))
  ;
  $customerResult = $client->AddCustomer(array(
  'securityToken' => $securityToken,
  'customer' => $customerData
));
  $addCustomerResult = $customerResult->AddCustomerResult;
  if ($customerResult->Status == 'Success')
  return 'Customer Added Successfully';
  else
  return 'Customer not Added';
}

Example 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>********-9e4a-4e77-a55b-********</CustomerInternalId>
            <Status>Success</Status>
            <StatusCode>1</StatusCode>
            <Error/>
            <ErrorCode>0</ErrorCode>
         </AddCustomerResult>
      </AddCustomerResponse>
   </s:Body>
</s:Envelope>
<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/>
            <CustomerInternalId/>
            <Status>Failed</Status>
            <StatusCode>0</StatusCode>
            <Error>Record already exists</Error>
            <ErrorCode>2</ErrorCode>
         </AddCustomerResult>
      </AddCustomerResponse>
   </s:Body>
</s:Envelope>