get deprecatedhttps://{host}/v1.1/customer/search
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.1customer/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)
Parameter | Datatype | Description |
---|---|---|
firstname | string | Retrieves the list of customers whose first name matches with the string passed. Query: firstname:EXACT:{first name} |
lastname | string | Retrieves the list of customers whose last name matches with the string passed. Query: lastname:EXACT:{last Name} |
org_id | long | Retrieves the list of entire customers of the respective organization. Query: org_id:EQUALS:{org_id} |
mobile | string | Retrieves customers whose registered mobile numbers matches with the string passed. Query: mobile:EQUALS:{mobile_number} |
string | Retrieves the list of registered customers whose email id matches with the string passed. Query: email:EQUALS:{email_id} | |
external_id | string | Retrieves customers whose external id matches with the string passed. Query: external_id:EQUALS:{external_id} |
registered_date | date | Retrieves customers by registered date. Query: registered_date:ON:{date in YYYY-MM-DD} . |
loyalty_points | int | Retrieves the list of customers whose active loyalty points matches the specified query. Query: loyalty_points:GREATER:{loyalty_points} |
lifetime_points | int | Retrieves the list of customers whose lifetime points matches the specified query. Query: lifetime_points:GREATER:{lifetime_points} |
lifetime_purchases | int | Retrieves the list of customers whose lifetime purchases amount matches the specified query. Query: lifetime_purchases:GREATER:{lifetime_purchases} |
slab | string | Retrieves the list of customers whose current loyalty tier matches the specified value. Query: slab:EQUALS:{tier_name} |
registered_store | string | Retrieves customers by registered store. Query: registered_store:EQUALS:{store_id} |
last_trans_value | double | Retrieves the list of customers whose transaction amount matches the specified query. Query: transaction_value:GREATER:{transaction_amount} |
Operator | enum | Predefined 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
Parameter | Datatype | Description |
---|---|---|
count | int | Number of customer results retrieved. |
item | obj | Details of each customer. |
user_id | long | Unique ID of the customer generated by the system. |
lifetime_points | int | Total loyalty points earned by the customer to date. |
lifetime_purchases | int | Total purchases amount (loyalty or non-loyalty transactions) of the customer across all stores of the org. |
loyalty_points | int | Current active loyalty points (neither redeemed nor expired) of the customers. |
current_slab | string | Current loyalty tier of the customer. |
registered_on | date-time | Date on which the customer is enrolled in the org's loyalty. |
registered_by | string | TILL or store code from which the customer is enrolled in the loyalty program. |
last_trans_value | double | Bill amount of the recent transaction of the customer. |
attributes | obj | Customer attribute details in name and value |