UpdateSubCustomer

Description

This method is used to update an existing sub-customer.

Syntax

SubCustomerResponse UpdateSubCustomer(SecurityToken securityToken,SubCustomer subCustomer, string customerId, string subCustomerId, string subCustomerInternalId);

Arguments

TypeNameDescription
SecurityToken securityTokenMerchant security token: used to identify merchant and validate transaction. (required)
SubCustomer subCustomerIncludes NEW sub-customer information, such as sub-customer number, merchant-assigned customer ID, billing address, receipt settings, recurring billing settings, and other pertinent information. (required)
StringcustomerIdCustomer ID for existing sub-customer. (required)
StringsubCustomerIdSub-customer ID for existing sub-customer. (required)
StringsubCustomerInternalIdThe existing unique sub-customer ID number assigned by the internal system. (required)

Return Value

TypeDescription
SubCustomerResponseReturns result of UpdateSubCustomer request.
public function UpdateSubCustomer()
{
	$client = new SoapClient('End point URL');
    $securityToken = array(
        'SecurityId' => '******-454757-4567457-777',
        'UserId' => 'merchant1',
        'Password' => 'merchant1'
    );
		
	$response = $client->UpdateSubCustomer(
		array(
			'securityToken' => $securityToken,
			'customerId' => '123',
			'subCustomerId' => '1234',
			'subCustomerInternalId' => '1234-43343-3433-34',
			'subcustomer' => array(
				'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->UpdateSubCustomerResult;
}
Request:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ebiz="http://eBizCharge.ServiceModel.SOAP">
   <soapenv:Header/>
   <soapenv:Body>
      <ebiz:UpdateSubCustomer>
         <ebiz:securityToken>
            <ebiz:SecurityId>********-90b4-4a38-ad78-28a795af78e9</ebiz:SecurityId>
            <ebiz:UserId/>
            <ebiz:Password/>
         </ebiz:securityToken>
         <ebiz:subCustomer>
            <ebiz:CustomerId>newcustomerID</ebiz:CustomerId>
            <ebiz:SubCustomerId>newSubCustomerID</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>Irvine</ebiz:City>
               <ebiz:State>CA</ebiz:State>
               <ebiz:ZipCode>92618</ebiz:ZipCode>
            </ebiz:BillingAddress>
            <ebiz:FirstName>Anthony</ebiz:FirstName>
            <ebiz:LastName>Kim</ebiz:LastName>
            <ebiz:CompanyName>CBS</ebiz:CompanyName>
            <ebiz:Phone/>
            <ebiz:CellPhone/>
            <ebiz:Fax/>
            <ebiz:Email>[email protected]</ebiz:Email>
            <ebiz:WebSite/>
         </ebiz:subCustomer>
         <ebiz:customerId>mm-0011-03</ebiz:customerId>
         <ebiz:subCustomerId>mm-0011-03[4]</ebiz:subCustomerId>
         <ebiz:subCustomerInternalId/>
      </ebiz:UpdateSubCustomer>
   </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">
      <UpdateSubCustomerResponse xmlns="http://eBizCharge.ServiceModel.SOAP">
         <UpdateSubCustomerResult>
            <CustomerId>newcustomerID</CustomerId>
            <SubCustomerId>newSubCustomerID</SubCustomerId>
            <SubCustomerInternalId/>
            <Status>Success</Status>
            <StatusCode>1</StatusCode>
            <Error/>
            <ErrorCode>0</ErrorCode>
         </UpdateSubCustomerResult>
      </UpdateSubCustomerResponse>
   </s:Body>
</s:Envelope>
public void UpdateSubCustomer()
        {
            eBizService apiClient = new eBizService();
            SecurityToken securityToken = new SecurityToken
            {
                SecurityId = "*******-c870-41b8-aa5c-205e55b7a049",
                UserId = "",
                Password = ""
            };
            var subCustomer = apiClient.GetSubCustomer(securityToken, "","", "1f862cd9-c6a7-41b3-a2e7-226988095b41");
            subCustomer.FirstName = "Mark update";
            subCustomer.LastName = "Wilson update";
            subCustomer.CompanyName = "CBS";
            subCustomer.CellPhone = "714-555-1111";
            subCustomer.Fax = "714-555-1235";
            subCustomer.Phone = "714-555-2525";
            var response = apiClient.UpdateSubCustomer(securityToken, subCustomer, "", "","1f862cd9-c6a7-41b3-a2e7-226988095b41");
            Console.WriteLine(response.SubCustomerInternalId);
            Console.WriteLine(response.CustomerId);
            Console.ReadLine();
        }