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

# CertificateServiceImpl

> Calling public service methods through the REST API: certificateServiceImpl

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

  certificateServiceImpl
</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:** conditional for USER/ADMIN.

* 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="searchResults" type="List<Certificate>">
  | Argument      | Type     | Description                 |
  | ------------- | -------- | --------------------------- |
  | `requestJson` | `String` | Passed through `args[0].0`. |

  ### searchResults

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

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

  ### getRepository

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

<ResponseField name="searchResultsPaged" type="Page<Certificate>">
  | Argument      | Type     | Description                 |
  | ------------- | -------- | --------------------------- |
  | `requestJson` | `String` | Passed through `args[0].0`. |

  ### searchResultsPaged

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

<ResponseField name="getPaginationFilter" type="Deque<Map<String, Object>>">
  | Argument      | Type     | Description                 |
  | ------------- | -------- | --------------------------- |
  | `requestJson` | `String` | Passed through `args[0].0`. |

  ### getPaginationFilter

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

<ResponseField name="isCertificateExists" type="boolean">
  | Argument        | Type     | Description                 |
  | --------------- | -------- | --------------------------- |
  | `certificateId` | `String` | Passed through `args[0].0`. |

  ### isCertificateExists

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

<ResponseField name="isCertificateNotExists" type="boolean">
  | Argument        | Type     | Description                 |
  | --------------- | -------- | --------------------------- |
  | `certificateId` | `String` | Passed through `args[0].0`. |

  ### isCertificateNotExists

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

<ResponseField name="addCertificateToLoggedSeller" type="void">
  | Argument        | Type     | Description                 |
  | --------------- | -------- | --------------------------- |
  | `certificateId` | `String` | Passed through `args[0].0`. |

  ### addCertificateToLoggedSeller

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

<ResponseField name="removeCertificateFromLoggedSeller" type="void">
  | Argument        | Type     | Description                 |
  | --------------- | -------- | --------------------------- |
  | `certificateId` | `String` | Passed through `args[0].0`. |

  ### removeCertificateFromLoggedSeller

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

<ResponseField name="createCertificate" type="Certificate">
  | Argument           | Type                            | Description                 |
  | ------------------ | ------------------------------- | --------------------------- |
  | `certificateAsMap` | `LinkedHashMap<String, Object>` | Passed through `args[0].0`. |

  ### createCertificate

  Example JSON request object:

  ```json theme={null}
  {
      "id":  null,
      "logoUrl":  null,
      "name":  null,
      "fallIntoSellers":  null,
      "searchTerms":  null,
      "translations":  null,
      "imageURLs":  null,
      "expiredAt":  null
  }
  ```

  Request:

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

<ResponseField name="saveCertificate" type="Certificate">
  | Argument           | Type                            | Description                 |
  | ------------------ | ------------------------------- | --------------------------- |
  | `certificateAsMap` | `LinkedHashMap<String, Object>` | Passed through `args[0].0`. |

  ### saveCertificate

  Example JSON request object:

  ```json theme={null}
  {
      "id":  null,
      "logoUrl":  null,
      "name":  null,
      "fallIntoSellers":  null,
      "searchTerms":  null,
      "translations":  null,
      "imageURLs":  null,
      "expiredAt":  null
  }
  ```

  Request:

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

<ResponseField name="addCertificateToSeller" type="void">
  | Argument        | Type     | Description                 |
  | --------------- | -------- | --------------------------- |
  | `certificateId` | `String` | Passed through `args[0].0`. |
  | `sellerId`      | `String` | Passed through `args[1].1`. |

  ### addCertificateToSeller

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

<ResponseField name="removeCertificateFromSeller" type="void">
  | Argument        | Type     | Description                 |
  | --------------- | -------- | --------------------------- |
  | `certificateId` | `String` | Passed through `args[0].0`. |
  | `sellerId`      | `String` | Passed through `args[1].1`. |

  ### removeCertificateFromSeller

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

<ResponseField name="removeCertificateAndClean" type="void">
  | Argument        | Type     | Description                 |
  | --------------- | -------- | --------------------------- |
  | `certificateId` | `String` | Passed through `args[0].0`. |

  ### removeCertificateAndClean

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

<ResponseField name="removeCertificates" type="void">
  | Argument         | Type                | Description                 |
  | ---------------- | ------------------- | --------------------------- |
  | `certificateIds` | `ArrayList<String>` | Passed through `args[0].0`. |

  ### removeCertificates

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

<ResponseField name="addCertificatesByIds" type="void">
  | Argument          | Type                | Description                 |
  | ----------------- | ------------------- | --------------------------- |
  | `certificatesIds` | `ArrayList<String>` | Passed through `args[0].0`. |
  | `sellerId`        | `String`            | Passed through `args[1].1`. |

  ### addCertificatesByIds

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

<ResponseField name="getSellerCertificates" type="List<Certificate>">
  | Argument   | Type     | Description                 |
  | ---------- | -------- | --------------------------- |
  | `sellerId` | `String` | Passed through `args[0].0`. |

  ### getSellerCertificates

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