> ## 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.

# CustomerServiceImpl

> Вызов публичных методов сервиса через REST API: customerServiceImpl

<ResponseField name="beanId" type="string">
  Идентификатор Spring bean, который содержит вызываемый сервис.

  customerServiceImpl
</ResponseField>

<ResponseField name="scope" type="string" default="PROTOTYPE">
  Область действия bean. Для вызовов сервисов используется PROTOTYPE.
</ResponseField>

<ResponseField name="functionName" type="string">
  Имя публичного метода сервиса, указанное в сигнатуре ниже.
</ResponseField>

<ResponseField name="args" type="object[]">
  Массив аргументов метода. Каждый аргумент передаётся объектом с индексом 0, 1 и т. д.; значение должно соответствовать Java-типу параметра.
</ResponseField>

## Headers

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

Заголовки `Lang-Context` и `Site-Context` необходимо передавать в каждом запросе. Для защищённых методов передавайте JWT в заголовке `Authorization` в формате `Bearer <token>`.

**Доступ:** GUEST. **Bearer Token:** не требуется.

* GUEST — без логина; доступен только whitelist.
* USER — требуется авторизация; доступны методы с проверкой USER.
* ADMIN — полный доступ к public-методам всех сервисов.
* Если метод проверяет роль внутри логики, GUEST может получить null.

## Методы

<ResponseField name="getRepository" type="SellerRepository">
  | Аргумент | Тип | Описание                      |
  | -------- | --- | ----------------------------- |
  | —        | —   | Метод не принимает аргументы. |

  ### getRepository

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

<ResponseField name="getPaginationCustomers" type="Deque<Map<String, Object>>">
  | Аргумент      | Тип      | Описание                      |
  | ------------- | -------- | ----------------------------- |
  | `requestJson` | `String` | Передаётся через `args[0].0`. |

  ### getPaginationCustomers

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

<ResponseField name="validateVerificationToken" type="boolean">
  | Аргумент            | Тип      | Описание                      |
  | ------------------- | -------- | ----------------------------- |
  | `verificationToken` | `String` | Передаётся через `args[0].0`. |

  ### validateVerificationToken

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

<ResponseField name="validatePasswordResetToken" type="boolean">
  | Аргумент             | Тип      | Описание                      |
  | -------------------- | -------- | ----------------------------- |
  | `passwordResetToken` | `String` | Передаётся через `args[0].0`. |

  ### validatePasswordResetToken

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

<ResponseField name="sendVerificationEmail" type="void">
  | Аргумент    | Тип                             | Описание                      |
  | ----------- | ------------------------------- | ----------------------------- |
  | `userAsMap` | `LinkedHashMap<String, Object>` | Передаётся через `args[0].0`. |

  ### sendVerificationEmail

  Пример JSON объекта запроса:

  ```json theme={null}
  {
      "id":  null,
      "username":  null,
      "password":  null,
      "savedPassword":  null,
      "fallIntoObjects":  null,
      "active":  false,
      "roles":  null,
      "permissions":  null
  }
  ```

  Request:

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

<ResponseField name="searchCustomers" type="SearchResponse">
  | Аргумент       | Тип                             | Описание                      |
  | -------------- | ------------------------------- | ----------------------------- |
  | `requestAsMap` | `LinkedHashMap<String, Object>` | Передаётся через `args[0].0`. |

  ### searchCustomers

  Пример JSON объекта запроса:

  ```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": "customerServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "searchCustomers",
    "args": [
      {
        "0": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="searchCustomersLightweight" type="SearchResponse">
  | Аргумент       | Тип                             | Описание                      |
  | -------------- | ------------------------------- | ----------------------------- |
  | `requestAsMap` | `LinkedHashMap<String, Object>` | Передаётся через `args[0].0`. |

  ### searchCustomersLightweight

  Пример JSON объекта запроса:

  ```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": "customerServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "searchCustomersLightweight",
    "args": [
      {
        "0": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="getCustomersPaged" type="Page<Seller>">
  | Аргумент      | Тип      | Описание                      |
  | ------------- | -------- | ----------------------------- |
  | `requestJson` | `String` | Передаётся через `args[0].0`. |

  ### getCustomersPaged

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

<ResponseField name="registerCustomerFull" type="Seller">
  | Аргумент        | Тип                             | Описание                      |
  | --------------- | ------------------------------- | ----------------------------- |
  | `customerAsMap` | `LinkedHashMap<String, Object>` | Передаётся через `args[0].0`. |

  ### registerCustomerFull

  Пример JSON объекта запроса:

  ```json theme={null}
  {
      "id":  null,
      "stripeCustomerId":  null,
      "stripeConnectId":  null,
      "address":  null,
      "shippingAddresses":  null,
      "companyName":  null,
      "vatNumber":  null,
      "numberOfEmployees":  null,
      "sellerType":  null,
      "sellerTariff":  null,
      "subscription":  null,
      "companyEmailAddress":  null,
      "companyPhone":  null,
      "companyWebSite":  null,
      "imageURLs":  null,
      "documentURLs":  null,
      "description":  null,
      "profiles":  null,
      "certificates":  null,
      "sellerSKUs":  null,
      "ordersBuyer":  null,
      "ordersVendor":  null,
      "favoriteSellersIds":  null,
      "favoriteSellerSkuIds":  null,
      "sellerCategoriesIds":  null,
      "sellerProductsIds":  null,
      "emailNotifications":  false,
      "onlineActive":  false
  }
  ```

  Request:

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

<ResponseField name="searchEmployees" type="LinkedHashSet<Profile>">
  | Аргумент      | Тип      | Описание                      |
  | ------------- | -------- | ----------------------------- |
  | `requestJson` | `String` | Передаётся через `args[0].0`. |

  ### searchEmployees

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

<ResponseField name="searchEmployeesPaged" type="Page<Profile>">
  | Аргумент      | Тип      | Описание                      |
  | ------------- | -------- | ----------------------------- |
  | `requestJson` | `String` | Передаётся через `args[0].0`. |

  ### searchEmployeesPaged

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

<ResponseField name="registerCustomerSimplified" type="Profile">
  | Аргумент           | Тип                             | Описание                      |
  | ------------------ | ------------------------------- | ----------------------------- |
  | `userProfileAsMap` | `LinkedHashMap<String, Object>` | Передаётся через `args[0].0`. |

  ### registerCustomerSimplified

  Пример JSON объекта запроса:

  ```json theme={null}
  {
      "id":  null,
      "user":  null,
      "firstName":  null,
      "lastName":  null,
      "website":  null,
      "phone":  null,
      "mobilePhone":  null,
      "birthday":  null,
      "emailAddress":  null,
      "gender":  null,
      "salutation":  null,
      "embeddedParent":  null,
      "emailNotifications":  false,
      "imageURLs":  null
  }
  ```

  Request:

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

<ResponseField name="updateCustomer" type="Seller">
  | Аргумент      | Тип                             | Описание                      |
  | ------------- | ------------------------------- | ----------------------------- |
  | `sellerAsMap` | `LinkedHashMap<String, Object>` | Передаётся через `args[0].0`. |

  ### updateCustomer

  Пример JSON объекта запроса:

  ```json theme={null}
  {
      "id":  null,
      "stripeCustomerId":  null,
      "stripeConnectId":  null,
      "address":  null,
      "companyName":  null,
      "vatNumber":  null,
      "numberOfEmployees":  null,
      "sellerType":  null,
      "sellerTariff":  null,
      "subscription":  null,
      "companyEmailAddress":  null,
      "companyPhone":  null,
      "companyWebSite":  null,
      "description":  null,
      "imageURLs":  null,
      "shippingAddresses":  null,
      "documentURLs":  null,
      "profileIds":  null,
      "certificateIds":  null,
      "sellerSkuIds":  null,
      "ordersAsBuyerIds":  null,
      "ordersAsVendorIds":  null,
      "favoriteSellersIds":  null,
      "favoriteSellerSkuIds":  null,
      "sellerCategoriesIds":  null,
      "sellerProductsIds":  null,
      "emailNotifications":  false,
      "onlineActive":  false,
      "imageUrlRemove":  false,
      "metaInfo":  null,
      "createdBy":  null,
      "createdDate":  null,
      "lastModifiedBy":  null,
      "lastModifiedDate":  null,
      "alias":  null
  }
  ```

  Request:

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

<ResponseField name="updateCustomerProfile" type="Profile">
  | Аргумент           | Тип                             | Описание                      |
  | ------------------ | ------------------------------- | ----------------------------- |
  | `userProfileAsMap` | `LinkedHashMap<String, Object>` | Передаётся через `args[0].0`. |

  ### updateCustomerProfile

  Пример JSON объекта запроса:

  ```json theme={null}
  {
      "id":  null,
      "user":  null,
      "firstName":  null,
      "lastName":  null,
      "website":  null,
      "phone":  null,
      "mobilePhone":  null,
      "birthday":  null,
      "emailAddress":  null,
      "gender":  null,
      "salutation":  null,
      "embeddedParent":  null,
      "emailNotifications":  false,
      "imageURLs":  null
  }
  ```

  Request:

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

<ResponseField name="mapSellerToDto" type="SellerDTO">
  | Аргумент        | Тип                             | Описание                      |
  | --------------- | ------------------------------- | ----------------------------- |
  | `customerAsMap` | `LinkedHashMap<String, Object>` | Передаётся через `args[0].0`. |

  ### mapSellerToDto

  Пример JSON объекта запроса:

  ```json theme={null}
  {
      "id":  null,
      "stripeCustomerId":  null,
      "stripeConnectId":  null,
      "address":  null,
      "shippingAddresses":  null,
      "companyName":  null,
      "vatNumber":  null,
      "numberOfEmployees":  null,
      "sellerType":  null,
      "sellerTariff":  null,
      "subscription":  null,
      "companyEmailAddress":  null,
      "companyPhone":  null,
      "companyWebSite":  null,
      "imageURLs":  null,
      "documentURLs":  null,
      "description":  null,
      "profiles":  null,
      "certificates":  null,
      "sellerSKUs":  null,
      "ordersBuyer":  null,
      "ordersVendor":  null,
      "favoriteSellersIds":  null,
      "favoriteSellerSkuIds":  null,
      "sellerCategoriesIds":  null,
      "sellerProductsIds":  null,
      "emailNotifications":  false,
      "onlineActive":  false
  }
  ```

  Request:

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