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

# CustomerAnalyticsServiceImpl

> Calling public service methods through the REST API: customerAnalyticsServiceImpl

<ResponseField name="beanId" type="string">
  The Spring bean identifier containing the service being called.

  customerAnalyticsServiceImpl
</ResponseField>

<ResponseField name="scope" type="string" default="PROTOTYPE">
  Bean scope. Use PROTOTYPE for service calls.
</ResponseField>

<ResponseField name="functionName" type="string">
  The public service method name shown in the signature below.
</ResponseField>

<ResponseField name="args" type="object[]">
  The method argument array. Each argument is passed as an object with index 0, 1, and so on; the value must match the Java parameter type.
</ResponseField>

## Headers

```http theme={null}
POST /api/v1/bean/request
Content-Type: application/json
Lang-Context: en
Site-Context: my-site
Authorization: Bearer <token>
```

Send `Lang-Context` and `Site-Context` with every request. For protected methods, send the JWT in the `Authorization` header as `Bearer <token>`.

**Access:** ADMIN. **Bearer Token:** required.

* GUEST — unauthenticated users; only whitelist services are available.
* USER — authentication is required; methods with USER checks are available.
* ADMIN — full access to public methods of all services.
* If a method checks a role internally, GUEST may receive null.

## Methods

<ResponseField name="getCustomerActivity" type="Page<CustomerActivity>">
  | Argument  | Type                            | Description                 |
  | --------- | ------------------------------- | --------------------------- |
  | `request` | `LinkedHashMap<String, Object>` | Passed through `args[0].0`. |

  ### getCustomerActivity

  Example JSON request object:

  ```json theme={null}
  {
      "type":  "SellerSKU",
      "searchTerm":  "",
      "query":  {
                    "isPublishedForSale":  true
                },
      "ignoreRegexWrap":  [
                              "id",
                              "name",
                              "embeddedSku",
                              "productsRef",
                              "isPublishedForSale"
                          ],
      "offset":  0,
      "limit":  10,
      "visiblePages":  10,
      "page":  1,
      "sortName":  "createdDate",
      "sortDirection":  "DESC"
  }
  ```

  Request:

  ```json theme={null}
  {
    "beanId": "customerAnalyticsServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "getCustomerActivity",
    "args": [
      {
        "0": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="getRegisteredCustomersChart" type="ChartData">
  | Argument | Type | Description                            |
  | -------- | ---- | -------------------------------------- |
  | —        | —    | This method does not accept arguments. |

  ### getRegisteredCustomersChart

  ```json theme={null}
  {
    "beanId": "customerAnalyticsServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "getRegisteredCustomersChart",
    "args": []
  }
  ```
</ResponseField>

<ResponseField name="getRegisteredCompaniesByCountry" type="Map<String, Integer>">
  | Argument | Type | Description                            |
  | -------- | ---- | -------------------------------------- |
  | —        | —    | This method does not accept arguments. |

  ### getRegisteredCompaniesByCountry

  ```json theme={null}
  {
    "beanId": "customerAnalyticsServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "getRegisteredCompaniesByCountry",
    "args": []
  }
  ```
</ResponseField>

<ResponseField name="getRegisteredCompaniesByType" type="Map<String, Integer>">
  | Argument | Type | Description                            |
  | -------- | ---- | -------------------------------------- |
  | —        | —    | This method does not accept arguments. |

  ### getRegisteredCompaniesByType

  ```json theme={null}
  {
    "beanId": "customerAnalyticsServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "getRegisteredCompaniesByType",
    "args": []
  }
  ```
</ResponseField>
