CopyCustomer

Description

The CopyCustomer method duplicates an existing Customer object to a different security token.

Syntax

CustomerResponse CopyCustomer(string customerInternalId, SecurityToken copyFromSecurityToken, SecurityToken copyToSecurityToken)

Arguments

TypeNameReq.Description
stringcustomerInternalidRIdentifies the Customer object to copy.
SecurityToken copyFromSecurityTokenRSecurity token associated with the Customer being copied.
SecurityToken copyToSecurityTokenRSecurity token that the copied Customer will be assigned to.

Return Value

TypeDescription
CustomerResponse Whether the Customer has been copied to the new security token.

Example Request

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ebiz="http://eBizCharge.ServiceModel.SOAP">
   <soapenv:Header/>
   <soapenv:Body>
      <ebiz:CopyCustomer>
         <ebiz:customerInternalId>************-4b6b-8a98-************</ebiz:customerInternalId>
         <ebiz:copyFromSecurityToken>
            <ebiz:SecurityId>************-4621-b899-************</ebiz:SecurityId>
            <ebiz:UserId/>
            <ebiz:Password/>
         </ebiz:copyFromSecurityToken>
         <ebiz:copyToSecurityToken>
            <ebiz:SecurityId>************-4bf0-91cd-************</ebiz:SecurityId>
            <ebiz:UserId/>
            <ebiz:Password/>
         </ebiz:copyToSecurityToken>
      </ebiz:CopyCustomer>
   </soapenv:Body>
</soapenv:Envelope>
public function CopyCustomer()
{
	$client = new SoapClient('End point URL');
    $fromSecurityToken = array(
        'SecurityId' => '467457-454757-4567457-777',
        'UserId' => 'merchant1',
        'Password' => 'merchant1'
    );
	
	$toSecurityToken = array(
        'SecurityId' => '567457-454757-4567457-888',
        'UserId' => 'merchant2',
        'Password' => 'merchant2'
    );
	
	$response = $client->CopyCustomer(
		array(
			'copyFromSecurityToken' => $fromSecurityToken,
			'copyToSecurityToken' => $toSecurityToken,
			'customerInternalId' => '343-345435-45435-454',
		)
	);
	
	$result = $response->CopyCustomerResult;
}

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">
      <CopyCustomerResponse xmlns="http://eBizCharge.ServiceModel.SOAP">
         <CopyCustomerResult>
            <CustomerId/>
            <CustomerInternalId/>
            <Status>Failed</Status>
            <StatusCode>0</StatusCode>
            <Error>Record already exists</Error>
            <ErrorCode>2</ErrorCode>
         </CopyCustomerResult>
      </CopyCustomerResponse>
   </s:Body>
</s:Envelope>