# 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 %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.portos.sk/api-reference/license.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
