> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flowx.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

> Customer management plugin uses a search engine (for example, [elasticSearch](https://www.elastic.co/) engine) to retrieve user details using partial match on big databases.

![](https://s3.eu-west-1.amazonaws.com/docx.flowx.ai/platform-deep-dive/crm-plugin.svg)

The plugin listens for incoming requests on a Kafka topic and sends the reply to the Engine on an outgoing topic.

[Kafka topics for Customer Management](#kafka-topics-for-customer-management)

## Kafka topics for customer management

### Customer Search

<Info>
  The kafka topics used for the Customer Management plugin can be defined/overwritten using the following environment variables (that can be found in the deployment of the service):

  * `KAFKA_TOPIC_CUSTOMER_SEARCH_IN` - used to search customers in the customer management plugin
  * `KAFKA_TOPIC_CUSTOMER_SEARCH_OUT` - used to get the response from the customer management plugin to the Engine.
</Info>

The request sent to the plugin can use any key that was previously configured in the elasticsearch index where the customers are saved.

Example of an elastic search index:

```json theme={"dark"}
{
  "settings": {
    "analysis": {
      "normalizer": {
        "lowercase_normalizer": {
          "type": "custom",
          "filter": ["lowercase"]
        }
      }
    }
  },
  "mappings": {
    "properties": {
      "CIF":{
        "type": "keyword",
        "normalizer": "lowercase_normalizer"
      },
      "ClientUniqueIdentifier": {
        "type": "keyword",
        "normalizer": "lowercase_normalizer"
      },
      "CNPFlex":{
        "type": "text"
      },
      "ClientType":{
        "type": "text"
      },
      "ClientCategory":{
        "type": "text"
      },
      "FirstName":{
        "type": "text",
        "fields": {
          "keyword":{
            "type": "keyword",
            "normalizer": "lowercase_normalizer"
          }
        }
      },
      "LastName":{
        "type": "text",
        "fields": {
          "keyword":{
            "type": "keyword",
            "normalizer": "lowercase_normalizer"
          }
        }
      },
      "CompanyName":{
        "type": "text",
        "fields": {
          "keyword":{
            "type": "keyword",
            "normalizer": "lowercase_normalizer"
          }
        }
      },
      "DateOfBirth":{
        "type": "date",
        "format": "dd.MM.yyyy"
      },
      "IDDocType":{
        "type": "text"
      },
      "IDSeries":{
        "type": "text"
      },
      "IDNumber":{
        "type": "text"
      },
      "IDIssueDate": {
        "type": "date",
        "format": "dd.MM.yyyy"
      },
      "IDExpiryDate":{
        "type": "date",
        "format": "dd.MM.yyyy"
      },
      "LegalForm":{
        "type": "text"
      },
      "CreatedDatePJ":{
        "type": "date",
        "format": "dd.MM.yyyy"
      },
      "ClientClosedDate": {
        "type": "date",
        "format": "dd.MM.yyyy"
      },
      "LastModifiedDate":{
        "type": "date",
        "format": "dd.MM.yyyy"
      },
      "ListID":{
        "type": "text"
      },
      "MobilePhone":{
        "type": "text"
      }
    }
  }
}

```

With this index configuration we can search for customers using any key:

## Key examples

### Example 1 - using only the "ClientUniqueIdentifier" key:

```json theme={"dark"}
{
"ClientUniqueIdentifier": "1900101223344"
}
```

### Example 2 - using "FirstName" and "LastName" keys:

```json theme={"dark"}
{
"FirstName": "TestFirstName",
"LastName": "Test Last Name"
}
```

### Example 3 - using "FirstName", "DateOfBirth" and "LegalForm" keys:

```json theme={"dark"}
{
"FirstName": "TestFirstName",
"DateOfBirth": "01.01.1990",
"LegalForm": "PF"
}
```

## Keys description

* **customers** - list of customers found in the customer management, in the used elasticsearch index, maximum 10 results
* **hasMore** - boolean, true if number of results are bigger than 10, false if the number of results are equal or smaller than 10
* **error** - error description if the request returned an error

Topic name example:

```
ro.flowx.updates.sandbox.customer.management.response
```

Sent body example:

```json theme={"dark"}
"searchResults" : {
    "customers" : [ {
      "id" : "CL12345",
      "firstName" : "John Doe",
      "lastName" : "Doe",
      "birthDate" : "27.02.1982",
      "cui" : "1820227103865_84",
      "companyName" : "",
      "clientCategory" : "PF",
      "clientType" : "PF",
      "idSeries" : "RT",
      "idNumber" : "879948",
      "idDocType" : "CI",
      "idExpiryDate" : "27.02.2023",
      "legalForm" : "",
      "listId" : "4691602",
      "mobilePhone" : "0711111111",
      "attributes" : null,
      "type" : "PF"}],
    "hasMore" : false,
    "error" : null
  }
```


## Related topics

- [Overview](/release-notes/v5.x/v5.0.0-july-2025/migrating-from-v4.7.x-to-5.0/migration-overview.md)
- [FlowX.AI 5.8.0 Release Notes](/release-notes/v5.x/v5.8.0-may-2026/v5.8.0-may-2026.md)
- [FlowX.AI 5.10.0 Release Notes](/release-notes/v5.x/v5.10.0-july-2026/v5.10.0-july-2026.md)
