AddSubCustomer

Description

This method is used to add a sub-customer to EBizCharge.

Syntax

SubCustomerResponse AddSubCustomer(SecurityToken securityToken,SubCustomer subCustomer);

Arguments

TypeNameDescription
SecurityToken securityTokenMerchant security token: used to identify merchant and validate transaction. (required)
SubCustomercustomerIncludes sub-customer information, such as customer number, merchant-assigned sub-customer ID, billing address, receipt settings, recurring billing settings, and other pertinent information. (required)

Return Value

TypeDescription
SubCustomerResponseReturns result of AddSubCustomer request.

Examples

public function AddSubCustomer()
{
	$client = new SoapClient('End point URL');
    $securityToken = array(
        'SecurityId' => '******-454757-4567457-777',
        'UserId' => 'merchant1',
        'Password' => 'merchant1'
    );
		
	$response = $client->AddSubCustomer(
		array(
			'securityToken' => $securityToken,
			'subcustomer' => array(
				'CustomerId' => '123',
				'CustomerInternalId' => '123-343-343-43',
				'SubCustomerId' => '1233',
				'FirstName' => 'Frank',
				'LastName' => 'Patrick',
				'CompanyName' => 'CBS',
				'Phone' => 10000000,
				'CellPhone' => 10000000,
				'Fax' => 10000000,
				'Email' => '[email protected]',
				'WebSite' => '',
				'BillingAddress' => array(),
				'ShippingAddress' => array(),
				'DateTimeCreated' => date('Y-m-d H:i:s'),
				'DateTimeModified' => date('Y-m-d H:i:s'),
			)
		)
	);
	
	$result = $response->AddSubCustomerResult;
}
Request

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ebiz="http://eBizCharge.ServiceModel.SOAP">
   <soapenv:Header/>
   <soapenv:Body>
      <ebiz:AddSubCustomer>
         <ebiz:securityToken>
            <ebiz:SecurityId>********-90b4-4a38-ad78-28a795af78e9</ebiz:SecurityId>
            <ebiz:UserId></ebiz:UserId>
            <ebiz:Password></ebiz:Password>
         </ebiz:securityToken>
         <ebiz:subcustomer>
            <ebiz:MerchantId/>
            <ebiz:CustomerInternalId/>
            <ebiz:CustomerId>mm-0011-03</ebiz:CustomerId>
            <ebiz:SubCustomerId>mm-0011-03[4]</ebiz:SubCustomerId>
            <ebiz:SubCustomerInternalId/>
            <ebiz:BillingAddress>
               <ebiz:FirstName>Anthony</ebiz:FirstName>
               <ebiz:LastName>Kim</ebiz:LastName>
               <ebiz:CompanyName>CBS</ebiz:CompanyName>
               <ebiz:Address1>55 Golden</ebiz:Address1>
               <ebiz:Address2>Suite 7777</ebiz:Address2>
               <ebiz:City>Seattle</ebiz:City>
               <ebiz:State>CA</ebiz:State>
               <ebiz:ZipCode>92618</ebiz:ZipCode>
            </ebiz:BillingAddress>
            <ebiz:ShippingAddress>
               <ebiz:FirstName>Anthony</ebiz:FirstName>
               <ebiz:LastName>Kim</ebiz:LastName>
               <ebiz:CompanyName>CBS</ebiz:CompanyName>
               <ebiz:Address1>55 Golden</ebiz:Address1>
               <ebiz:Address2>Suite 7777</ebiz:Address2>
               <ebiz:City>Irvine</ebiz:City>
               <ebiz:State>CA</ebiz:State>
               <ebiz:ZipCode>92618</ebiz:ZipCode>
            </ebiz:ShippingAddress>
            <ebiz:FirstName>Anthony</ebiz:FirstName>
            <ebiz:LastName>Kim</ebiz:LastName>
            <ebiz:CompanyName>CBS</ebiz:CompanyName>
            <ebiz:Phone>18885007798</ebiz:Phone>
            <ebiz:CellPhone></ebiz:CellPhone>
            <ebiz:Fax>18887007797</ebiz:Fax>
            <ebiz:Email>[email protected]</ebiz:Email>
            <ebiz:WebSite>https://centurybizsolutions.net</ebiz:WebSite>
         </ebiz:subcustomer>
      </ebiz:AddSubCustomer>
   </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">
      <AddSubCustomerResponse xmlns="http://eBizCharge.ServiceModel.SOAP">
         <AddSubCustomerResult>
            <CustomerId>mm-0011-03</CustomerId>
            <SubCustomerInternalId>********-dafe-4529-94f6-7fd458af6958</SubCustomerInternalId>
            <Status>Success</Status>
            <StatusCode>1</StatusCode>
            <Error/>
            <ErrorCode>0</ErrorCode>
         </AddSubCustomerResult>
      </AddSubCustomerResponse>
   </s:Body>
</s:Envelope>
public void AddSubCustomer()
        {
            eBizService apiClient = new eBizService();
            SecurityToken securityToken = new SecurityToken
            {
                SecurityId = "*******-c870-41b8-aa5c-205e55b7a049",
                UserId = "",
                Password = ""
            };
            SubCustomer customer = new SubCustomer();
            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 Address();
            customer.BillingAddress.Address1 = "55 Golden";
            customer.BillingAddress.Address2 = "Suite 5555";
            customer.BillingAddress.City = "Abyss";
            customer.BillingAddress.ZipCode = "56789";
            customer.BillingAddress.State = "CA";
            SubCustomerResponse response = apiClient.AddSubCustomer(securityToken, customer);
            Console.WriteLine(response.SubCustomerInternalId);
            Console.WriteLine(response.Status);
            Console.WriteLine(response.StatusCode);
            Console.WriteLine(response.Error);
            Console.WriteLine(response.ErrorCode);
            Console.ReadLine();
        }