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

# ProductServiceImpl

> Aufruf öffentlicher Servicemethoden über die REST API: productServiceImpl

<ResponseField name="beanId" type="string">
  Die Spring-Bean-ID des aufzurufenden Services.

  productServiceImpl
</ResponseField>

<ResponseField name="scope" type="string" default="PROTOTYPE">
  Bean-Scope. Für Serviceaufrufe wird PROTOTYPE verwendet.
</ResponseField>

<ResponseField name="functionName" type="string">
  Der öffentliche Methodenname des Services, der in der Signatur angegeben ist.
</ResponseField>

<ResponseField name="args" type="object[]">
  Das Argument-Array der Methode. Jedes Argument wird mit dem Index 0, 1 usw. übergeben; der Wert muss dem Java-Parametertyp entsprechen.
</ResponseField>

## Headers

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

Senden Sie `Lang-Context` und `Site-Context` mit jeder Anfrage. Für geschützte Methoden senden Sie das JWT im Header `Authorization` im Format `Bearer <token>`.

**Zugriff:** ADMIN. **Bearer Token:** bedingt für USER/ADMIN.

* GUEST — nicht angemeldete Benutzer; nur Whitelist-Services sind verfügbar.
* USER — Authentifizierung erforderlich; Methoden mit USER-Prüfung sind verfügbar.
* ADMIN — vollständiger Zugriff auf öffentliche Methoden aller Services.
* Wenn eine Methode intern eine Rolle prüft, kann GUEST null erhalten.

## Methoden

<ResponseField name="getRepository" type="ProductRepository">
  | Argument | Typ | Beschreibung                              |
  | -------- | --- | ----------------------------------------- |
  | —        | —   | Diese Methode akzeptiert keine Argumente. |

  ### getRepository

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

<ResponseField name="getPaginationFilter" type="Deque<Map<String, Object>>">
  | Argument      | Typ      | Beschreibung                |
  | ------------- | -------- | --------------------------- |
  | `requestJson` | `String` | Übergeben über `args[0].0`. |

  ### getPaginationFilter

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

<ResponseField name="searchProducts" type="SearchResponse">
  | Argument      | Typ                             | Beschreibung                |
  | ------------- | ------------------------------- | --------------------------- |
  | `requestJson` | `LinkedHashMap<String, Object>` | Übergeben über `args[0].0`. |

  ### searchProducts

  Beispiel für das JSON-Anfrageobjekt:

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

<ResponseField name="searchProductsLightweight" type="SearchResponse">
  | Argument      | Typ                             | Beschreibung                |
  | ------------- | ------------------------------- | --------------------------- |
  | `requestJson` | `LinkedHashMap<String, Object>` | Übergeben über `args[0].0`. |

  ### searchProductsLightweight

  Beispiel für das JSON-Anfrageobjekt:

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

<ResponseField name="searchProducts" type="LinkedHashSet<ProductDTO>">
  | Argument      | Typ      | Beschreibung                |
  | ------------- | -------- | --------------------------- |
  | `requestJson` | `String` | Übergeben über `args[0].0`. |

  ### searchProducts

  Beispiel für das JSON-Anfrageobjekt:

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

<ResponseField name="searchProductsPaged" type="Page<Product>">
  | Argument      | Typ      | Beschreibung                |
  | ------------- | -------- | --------------------------- |
  | `requestJson` | `String` | Übergeben über `args[0].0`. |

  ### searchProductsPaged

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

<ResponseField name="searchProducts" type="List<Product>">
  | Argument | Typ      | Beschreibung                |
  | -------- | -------- | --------------------------- |
  | `query`  | `String` | Übergeben über `args[0].0`. |
  | `offset` | `String` | Übergeben über `args[1].1`. |
  | `limit`  | `String` | Übergeben über `args[2].2`. |

  ### searchProducts

  ```json theme={null}
  {
    "beanId": "productServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "searchProducts",
    "args": [
      {
        "0": null,
        "1": null,
        "2": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="createProduct" type="Optional<Product>">
  | Argument       | Typ                             | Beschreibung                |
  | -------------- | ------------------------------- | --------------------------- |
  | `productAsMap` | `LinkedHashMap<String, Object>` | Übergeben über `args[0].0`. |

  ### createProduct

  Beispiel für das JSON-Anfrageobjekt:

  ```json theme={null}
  {
      "id":  null,
      "name":  null,
      "description":  null,
      "fallIntoCategories":  null,
      "attributes":  null,
      "keywords":  null,
      "searchTerms":  null,
      "active":  false,
      "SKUs":  null,
      "translations":  null,
      "imageURLs":  null
  }
  ```

  Request:

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

<ResponseField name="addProductToCategory" type="Product">
  | Argument       | Typ                             | Beschreibung                |
  | -------------- | ------------------------------- | --------------------------- |
  | `categoryId`   | `String`                        | Übergeben über `args[0].0`. |
  | `productAsMap` | `LinkedHashMap<String, Object>` | Übergeben über `args[1].1`. |

  ### addProductToCategory

  Beispiel für das JSON-Anfrageobjekt:

  ```json theme={null}
  {
      "id":  null,
      "name":  null,
      "description":  null,
      "fallIntoCategories":  null,
      "attributes":  null,
      "keywords":  null,
      "searchTerms":  null,
      "active":  false,
      "SKUs":  null,
      "translations":  null,
      "imageURLs":  null
  }
  ```

  Request:

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

<ResponseField name="addProductToCategory" type="Product">
  | Argument     | Typ      | Beschreibung                |
  | ------------ | -------- | --------------------------- |
  | `categoryId` | `String` | Übergeben über `args[0].0`. |
  | `productId`  | `String` | Übergeben über `args[1].1`. |

  ### addProductToCategory

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

<ResponseField name="saveProduct" type="Product">
  | Argument       | Typ                             | Beschreibung                |
  | -------------- | ------------------------------- | --------------------------- |
  | `productAsMap` | `LinkedHashMap<String, Object>` | Übergeben über `args[0].0`. |

  ### saveProduct

  Beispiel für das JSON-Anfrageobjekt:

  ```json theme={null}
  {
      "id":  null,
      "name":  null,
      "description":  null,
      "fallIntoCategories":  null,
      "attributes":  null,
      "keywords":  null,
      "searchTerms":  null,
      "active":  false,
      "SKUs":  null,
      "translations":  null,
      "imageURLs":  null
  }
  ```

  Request:

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

<ResponseField name="getSortedProductsByCategory" type="List<Map<String, String>>">
  | Argument     | Typ      | Beschreibung                |
  | ------------ | -------- | --------------------------- |
  | `categoryId` | `String` | Übergeben über `args[0].0`. |

  ### getSortedProductsByCategory

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

<ResponseField name="getProductsByCategoryAndFirstLetter" type="List<Map<String, Object>>">
  | Argument      | Typ      | Beschreibung                |
  | ------------- | -------- | --------------------------- |
  | `categoryId`  | `String` | Übergeben über `args[0].0`. |
  | `firstLetter` | `String` | Übergeben über `args[1].1`. |

  ### getProductsByCategoryAndFirstLetter

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

<ResponseField name="removeProductFromCategory" type="void">
  | Argument     | Typ      | Beschreibung                |
  | ------------ | -------- | --------------------------- |
  | `productId`  | `String` | Übergeben über `args[0].0`. |
  | `categoryId` | `String` | Übergeben über `args[1].1`. |

  ### removeProductFromCategory

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

<ResponseField name="removeProductFromSKU" type="void">
  | Argument    | Typ      | Beschreibung                |
  | ----------- | -------- | --------------------------- |
  | `productId` | `String` | Übergeben über `args[0].0`. |
  | `skuId`     | `String` | Übergeben über `args[1].1`. |

  ### removeProductFromSKU

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

<ResponseField name="removeProductFromAttribute" type="void">
  | Argument    | Typ      | Beschreibung                |
  | ----------- | -------- | --------------------------- |
  | `productId` | `String` | Übergeben über `args[0].0`. |
  | `attrId`    | `String` | Übergeben über `args[1].1`. |

  ### removeProductFromAttribute

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

<ResponseField name="removeProductFromTranslation" type="void">
  | Argument    | Typ      | Beschreibung                |
  | ----------- | -------- | --------------------------- |
  | `productId` | `String` | Übergeben über `args[0].0`. |
  | `tranId`    | `String` | Übergeben über `args[1].1`. |

  ### removeProductFromTranslation

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

<ResponseField name="removeProductFromCategories" type="void">
  | Argument    | Typ      | Beschreibung                |
  | ----------- | -------- | --------------------------- |
  | `productId` | `String` | Übergeben über `args[0].0`. |

  ### removeProductFromCategories

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

<ResponseField name="removeProductFromSKUs" type="void">
  | Argument    | Typ      | Beschreibung                |
  | ----------- | -------- | --------------------------- |
  | `productId` | `String` | Übergeben über `args[0].0`. |

  ### removeProductFromSKUs

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

<ResponseField name="removeProductFromAttributes" type="void">
  | Argument    | Typ      | Beschreibung                |
  | ----------- | -------- | --------------------------- |
  | `productId` | `String` | Übergeben über `args[0].0`. |

  ### removeProductFromAttributes

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

<ResponseField name="removeProductFromTranslations" type="void">
  | Argument    | Typ      | Beschreibung                |
  | ----------- | -------- | --------------------------- |
  | `productId` | `String` | Übergeben über `args[0].0`. |

  ### removeProductFromTranslations

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

<ResponseField name="removeProductAndClean" type="void">
  | Argument    | Typ      | Beschreibung                |
  | ----------- | -------- | --------------------------- |
  | `productId` | `String` | Übergeben über `args[0].0`. |

  ### removeProductAndClean

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

<ResponseField name="removeProductsByIds" type="void">
  | Argument      | Typ                 | Beschreibung                |
  | ------------- | ------------------- | --------------------------- |
  | `productsIds` | `ArrayList<String>` | Übergeben über `args[0].0`. |

  ### removeProductsByIds

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