SearchCustomerList

Search for customers.

Description

This method is used to search the customer by providing filters to the list.

Syntax

CustomerListSearchResult SearchCustomerList(SecurityToken securityToken, SearchFilter[] filters, int start, int limit, string sort, bool includeCustomerToken, bool includePaymentMethodProfiles, bool countOnly)

Arguments

Type

Name

Description

SecurityToken

securityToken

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

SearchFilter

filters

Search filters.

Int

start

Start position, defaults to 0 (first customer found). (required)

Int

limit

Maximum number of customers to return in result. (required)

String

sort

Field name to sort the results by. (optional)

Bool

includeCustomerToken

Include Customer Token

Bool

includePaymentMethodProfiles

Include Payment Method Profiles.

Bool

countOnly

Count Only.

Return Value

Type

Description

[CustomerListSearchResult] (doc:customerlistsearchresult)

This object contains details for customer list search result.

Example

public function SearchCustomerList()
{
	$client = new SoapClient('End point URL');
    $securityToken = array(
        'SecurityId' => '******-454757-4567457-777',
        'UserId' => 'merchant1',
        'Password' => 'merchant1'
    );
	
	$filters = array(
		'FieldName' => 'Email',
		'ComparisonOperator' => 'eq',
		'FieldValue' => 'customer@cbs.com',
	);
	
	$response = $client->SearchCustomerList(
		array(
			'securityToken' => $securityToken,
			'filters' => array('SearchFilter' => $filters),
			'includeCustomerToken' => 1,
			'includePaymentMethodProfiles' => 0,
			'countOnly' => false,
			'start' => 0,
			'limit' => 100,
		)
	);
	
	$result = $response->SearchCustomerListResult;
}
Request:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ebiz="http://eBizCharge.ServiceModel.SOAP">
   <soapenv:Header />
   <soapenv:Body>
      <ebiz:SearchCustomerList>
         <ebiz:securityToken>
            <ebiz:SecurityId>********-23f6-4466-a993-f0008187ab9a</ebiz:SecurityId>
            <ebiz:UserId />
            <ebiz:Password />
         </ebiz:securityToken>
         <ebiz:filters>
            <!--Zero or more repetitions:-->
            <ebiz:SearchFilter>
               <ebiz:FieldName>SoftwareId</ebiz:FieldName>
               <ebiz:ComparisonOperator>eq</ebiz:ComparisonOperator>
               <ebiz:FieldValue>IOSMobileApp</ebiz:FieldValue>
            </ebiz:SearchFilter>
         </ebiz:filters>
         <ebiz:start>1</ebiz:start>
         <ebiz:limit>3</ebiz:limit>
         <ebiz:sort>1</ebiz:sort>
         <ebiz:includeCustomerToken>true</ebiz:includeCustomerToken>
         <ebiz:includePaymentMethodProfiles>true</ebiz:includePaymentMethodProfiles>
         <ebiz:countOnly>0</ebiz:countOnly>
      </ebiz:SearchCustomerList>
   </soapenv:Body>
</soapenv:Envelope>

Response:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
   <s:Body xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <SearchCustomerListResponse xmlns="http://eBizCharge.ServiceModel.SOAP">
         <SearchCustomerListResult>
            <CustomerList>
               <Customer>
                  <CustomerInternalId>*******-0b2a-44ed-90be-ed0bc460aecb</CustomerInternalId>
                  <CustomerId>****-273-282-2833</CustomerId>
                  <FirstName>Rachel</FirstName>
                  <LastName>Bayswater</LastName>
                  <CompanyName>Cbs</CompanyName>
                  <Phone>(555) 555-5556</Phone>
                  <Email>rachel.b@gmail.com</Email>
                  <BillingAddress>
                     <FirstName>Rachel</FirstName>
                     <LastName>Bayswater</LastName>
                     <CompanyName>Cbs</CompanyName>
                     <Address1>55 Golden</Address1>
                     <Address2 />
                     <City>Irvine</City>
                     <State>CA</State>
                     <ZipCode>92618</ZipCode>
                     <IsDefault xsi:nil="true" />
                  </BillingAddress>
                  <ShippingAddress>
                     <FirstName>Rachel</FirstName>
                     <LastName>Bayswater</LastName>
                     <CompanyName>Cbs</CompanyName>
                     <Address1 />
                     <Address2 />
                     <Address3 />
                     <City />
                     <State />
                     <ZipCode />
                     <Country />
                     <IsDefault>true</IsDefault>
                     <AddressId />
                  </ShippingAddress>
                  <PaymentMethodProfiles>
                     <PaymentMethodProfile>
                        <MethodType>cc</MethodType>
                        <MethodID>********-1cea-483e-bac2-d2d8b4b15cc5</MethodID>
                        <MethodName />
                        <Created>0001-01-01T00:00:00</Created>
                        <Modified>0001-01-01T00:00:00</Modified>
                        <AccountHolderName>Waseem Sadiq</AccountHolderName>
                        <AvsStreet>Irvine</AvsStreet>
                        <AvsZip>92620</AvsZip>
                        <CardExpiration>2023-20</CardExpiration>
                        <CardNumber>XXXXXXXXXXXX2224</CardNumber>
                        <CardType>V</CardType>
                        <Balance xsi:nil="true" />
                        <MaxBalance xsi:nil="true" />
                     </PaymentMethodProfile>
                     <PaymentMethodProfile>
                        <Created>0001-01-01T00:00:00</Created>
                        <Modified>0001-01-01T00:00:00</Modified>
                        <Balance xsi:nil="true" />
                        <MaxBalance xsi:nil="true" />
                     </PaymentMethodProfile>
                  </PaymentMethodProfiles>
                  <CustomerToken>11552949</CustomerToken>
                  <SoftwareId>IOSMobileApp</SoftwareId>
                  <CustomerCustomFields />
                  <DivisionId />
                  <DateTimeCreated>2021-04-13 10:09:04</DateTimeCreated>
                  <DateTimeModified>2021-04-27 08:41:28</DateTimeModified>
               </Customer>
            </CustomerList>
            <Start>1</Start>
            <Limit>3</Limit>
            <Count>1</Count>
         </SearchCustomerListResult>
      </SearchCustomerListResponse>
   </s:Body>
</s:Envelope>
public void SearchCustomerList()
        {
            eBizService apiClient = new eBizService();
            SecurityToken securityToken = new SecurityToken
            {
                SecurityId = "*******-c870-41b8-aa5c-205e55b7a049",
                UserId = "",
                Password = ""
            };
            //Declare the Array of searchfilters
            SearchFilter[] searchFilters = new SearchFilter[1];
            //Declare a SearchFilter
            SearchFilter searchFilter = new SearchFilter();
            searchFilter.FieldName = "DateTimeCreated";
            searchFilter.ComparisonOperator = "gt";
            searchFilter.FieldValue = "04/01/2022";
            //Add SearchFilter to Array for SearchFilters
            searchFilters[0] = searchFilter;
            var response = apiClient.SearchCustomerList(securityToken,searchFilters,0, 100, "",true,true,false);
            Console.WriteLine(response.Count);
            Console.ReadLine();
        }