> For the complete documentation index, see [llms.txt](https://developers.portos.sk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.portos.sk/api-reference/license.md).

# License

License API methods are whitelisted during authorization procedure, allowing them to be accessed without requiring authorization.

## API methods

## Get product license

<mark style="color:blue;">`GET`</mark> `http://{server-address}/license`

Result is of type [`License`](/data-models.md#license).

{% tabs %}
{% tab title="200: OK License information" %}

```json
{
    "shopId": 123456,
    "activationTime": "2022-03-29T11:38:06Z",
    "expirationTime": "2030-02-23T23:00:00Z",
    "verificationTime": "2023-07-17T08:53:41.685Z",
    "verificationInterval": "1.00:00:00",
    "features":
    [
        {
            "productSku": "MaxDeviceCount",
            "rawValue": "2",
            "name": "Maximálny počet súčasne pripojiteľných zariadení.",
            "activationTime": "2021-03-12T14:37:55Z",
            "expirationTime": "2022-03-10T23:00:00Z"
        },
        {
            "productSku": "DKPs",
            "rawValue": "88812345678900001,88811223344550000",
            "name": "Zoznam kódov on-line registračných pokladníc",
            "activationTime": "2021-03-12T14:37:55Z",
            "expirationTime": "2022-03-10T23:00:00Z"
        }
    ],
    "remainingDays": 2413,
    "isExpired": false
}
```

{% endtab %}
{% endtabs %}

## Get license request code

<mark style="color:green;">`POST`</mark> `http://{server-address}/license/getrequestcode`

The request code is used to request an activation code from the licensing authority, which is then used to activate a license. This API provides a means to retrieve the request code. Subsequently, the licensing authority generates the corresponding activation code based on the provided request code.

The method accepts [`ProductLicenseRequest`](/data-models.md#productlicenserequest) in request body. Response body contains string representing license request code.

#### Request Body

| Name                               | Type                  | Description |
| ---------------------------------- | --------------------- | ----------- |
| <mark style="color:red;">\*</mark> | ProductLicenseRequest |             |

{% tabs %}
{% tab title="200: OK License request code" %}

```json
"this-is-an-example-request-code"
```

{% endtab %}
{% endtabs %}

## Activate license using activation code

<mark style="color:green;">`POST`</mark> `http://{server-address}/license/activate`

The method accepts [`ProductLicenseActivation`](/data-models.md#productlicenseactivation) in request body. Response body contains [`License`](/data-models.md#license) model.

#### Request Body

| Name                                     | Type                     | Description |
| ---------------------------------------- | ------------------------ | ----------- |
| (body)<mark style="color:red;">\*</mark> | ProductLicenseActivation |             |

{% tabs %}
{% tab title="200: OK Activated license information" %}

```json
{
    "shopId": 123456,
    "activationTime": "2022-03-29T11:38:06Z",
    "expirationTime": "2030-02-23T23:00:00Z",
    "verificationTime": "2023-07-17T08:53:41.685Z",
    "verificationInterval": "1.00:00:00",
    "features":
    [
        {
            "productSku": "MaxDeviceCount",
            "rawValue": "2",
            "name": "Maximálny počet súčasne pripojiteľných zariadení.",
            "activationTime": "2021-03-12T14:37:55Z",
            "expirationTime": "2022-03-10T23:00:00Z"
        },
        {
            "productSku": "DKPs",
            "rawValue": "88812345678900001,88811223344550000",
            "name": "Zoznam kódov on-line registračných pokladníc",
            "activationTime": "2021-03-12T14:37:55Z",
            "expirationTime": "2022-03-10T23:00:00Z"
        }
    ],
    "remainingDays": 2413,
    "isExpired": false
}
```

{% endtab %}
{% endtabs %}
