Learn how the recent changes to Customers can improve the way you find and manage Customer data in your project.
After completing this page, you should be able to:
- Use the new Customer creation flow.
- Enable Customer Search for your Project.
- Use Customer Search to effectively find Customers in the Merchant Center.
- Formulate search queries to effectively find Customers using the Customer Search API.
Time to complete page: 15 minutes
New Customer creation flow
Many useful Customer fields and settings were already present in Composable Commerce, but only accessible via the API. In 2024 we have significantly improved the Customer creation flow to give Merchant Center users direct access to these fields:
The key
and locale
fields are now accessible:
authenticationMode
can now be set directly in the Merchant Center. Enabling it makes the password
not required:
Customer Search
Discover a faster, smarter way to find customer information with our enhanced Customer Search! The new, flexible search filters let you locate Customers using multiple fields, even if you only have part of a name or detail, thanks to partial search capabilities. This upgrade empowers customer-facing teams to provide quicker, more efficient support and service, ensuring an exceptional customer experience.
Ready to try it out? Just index the Customers in your Project by going to Customers, then Customer List, and clicking Index my customers now
(this can also be done by submitting an update request to the Project endpoint via the API):
Keep in mind that, just like with Product Search, if Customer Search is not used for 30 consecutive days, it is automatically deactivated and needs to be activated again as previously described.
Once indexing is done, you can enjoy the new search capabilities directly in the Merchant Center:
But that’s not all - Customer Search is also available as an API and offers you even more flexibility, such as the use of query expressions, compound expressions and boosting, similar to Product Search that we covered in the previous chapter. Perfect for building your own back-office applications.
Let’s test it out by submitting a query where we are looking for Customers with either “Sebastian” or “Jeff” as their first name and an email address ending with “example.com”:
curl https://api.{region}.commercetools.com/{projectKey}/customers/search \
--header "Authorization: Bearer {bearerToken}" \
--header "Content-Type: application/json" \
--data-binary '{
"query": {
"and": [
{
"or": [
{
"exact": {
"field": "firstName",
"value": "Sebastian"
}
},
{
"exact": {
"field": "firstName",
"value": "Jeff"
}
}
]
},
{
"wildcard": {
"field": "email",
"value": "*example.com"
}
}
]
}
}' | jq
{
"results": [
{
"id": "da444dfa-0dfe-4c31-8fbe-fccca1ac6442",
"relevance": 2.6739764
},
{
"id": "fd680b92-0627-4e88-b2f8-a17bcf469e22",
"relevance": 1.8266785
}
],
"limit": 100,
"offset": 0,
"total": 2
}
As you can see in the response, the Customer Search API is ID-first, which means that in the result we only get the IDs of Customers. This is done mainly for performance reasons. To fetch a Customer, use local caches or use the Get a Customer by ID
endpoint.
The results also show us the relevance of each result which indicates how close this Customer matches the search query.