Search Customers

Lets you fetch customers based on partial or complete keywords passed. You can fetch customers by name, customer identifier, registered store id, registered date, loyalty points, lifetime points, lifetime purchases amount, current tier, transaction amount, and custom field values.

❗️

This API is deprecated and is no longer supported.

📘

  • If customer details are not found, then customer data is not retrieved. However, currently, customer not found error is not shown in V1.1. As there are no integrations built on V1.1 customer/search, it is recommended to use V2.0 customer/Search API to see proper response status.
  • Error Code: 461
    This represents timeout error when you try to fetch customers with all the three identifiers - mobile, email, and external id - and Solr DB times out.
    This is because, when you make an API call, Solr DB is queried firstly. If Solr times out, MySQL is searched, but MySQL does not support search on multiple identifiers.

Query Parameter Names

You need to understand Query Grammar to learn how to use input parameters for customer/search API. For more details, see the Query Grammar section.

Example: ?q=(slab:EQUALS:CLASSIC)

ParameterDatatypeDescription
firstnamestringRetrieves the list of customers whose first name matches with the string passed.
Query: firstname:EXACT:{first name}
lastnamestringRetrieves the list of customers whose last name matches with the string passed.
Query: lastname:EXACT:{last Name}
org_idlongRetrieves the list of entire customers of the respective organization.
Query: org_id:EQUALS:{org_id}
mobilestringRetrieves customers whose registered mobile numbers matches with the string passed.
Query: mobile:EQUALS:{mobile_number}
emailstringRetrieves the list of registered customers whose email id matches with the string passed.
Query: email:EQUALS:{email_id}
external_idstringRetrieves customers whose external id matches with the string passed.
Query: external_id:EQUALS:{external_id}
registered_datedateRetrieves customers by registered date.
Query: registered_date:ON:{date in YYYY-MM-DD}.
loyalty_pointsintRetrieves the list of customers whose active loyalty points matches the specified query.
Query: loyalty_points:GREATER:{loyalty_points}
lifetime_pointsintRetrieves the list of customers whose lifetime points matches the specified query.
Query: lifetime_points:GREATER:{lifetime_points}
lifetime_purchasesintRetrieves the list of customers whose lifetime purchases amount matches the specified query. Query: lifetime_purchases:GREATER:{lifetime_purchases}
slabstringRetrieves the list of customers whose current loyalty tier matches the specified value.
Query: slab:EQUALS:{tier_name}
registered_storestringRetrieves customers by registered store.
Query: registered_store:EQUALS:{store_id}
last_trans_valuedoubleRetrieves the list of customers whose transaction amount matches the specified query.
Query: transaction_value:GREATER:{transaction_amount}
OperatorenumPredefined conditions based on which you want to fetch results. Values: STARTS, ENDS, EXACT, RANGE, LESS, GREATER, EQUALS, IN. For more details, see the following section, Search Query Grammar.

Search Query Grammar

The following is a formal definition of the Query Grammar

QUERY: (CONDITION) | (CONDITION & (CONDITION)*)

CONDITION: ATTRIBUTE:OPERATOR:VALUES

ATTRIBUTE: Set of inventory/customer attributes that are searchable.

Dynamic List

  • OPERATOR: STARTS, ENDS, EXACT, RANGE, LESS, GREATER, EQUALS, IN, ON
  • VALUES: ALPHANUMERIC | ALPHANUMERIC;ALPHANUMERIC(for RANGE, IN OPERATOR, separator is ';' )

Response Parameters

ParameterDatatypeDescription
countintNumber of customer results retrieved.
itemobjDetails of each customer.
user_idlongUnique ID of the customer generated by the system.
lifetime_pointsintTotal loyalty points earned by the customer to date.
lifetime_purchasesintTotal purchases amount (loyalty or non-loyalty transactions) of the customer across all stores of the org.
loyalty_pointsintCurrent active loyalty points (neither redeemed nor expired) of the customers.
current_slabstringCurrent loyalty tier of the customer.
registered_ondate-timeDate on which the customer is enrolled in the org's loyalty.
registered_bystringTILL or store code from which the customer is enrolled in the loyalty program.
last_trans_valuedoubleBill amount of the recent transaction of the customer.
attributesobjCustomer attribute details in name and value
Language
URL
Click Try It! to start a request and see the response here!