# Update License Product Features

**URL** : `/api/v1/licenses/{id}/update_features/`

**Method** : `POST`

* License product features provided in `product_features` list will be created if not on License or updated if already on License.
* License product features already on license but not provided in `product_features` list will be deleted from License.

#### Parameters for each License product feature

* `product_feature` - String
* `max_consumption` - Integer
* `total_consumptions` - Integer
* `expiry_date` - Date
  * Format: `yyyy-mm-dd` (2020-09-30)
* `allow_overages` - Boolean
* `max_overages` - Integer
* `reset_consumption` - Boolean
* `consumption_period` - String
  * Choices: `daily`, `weekly`, `monthly`, `annualy`

#### Data example

```json
{
    "product_features": [
        {
            "product_feature": "f5"
        },
        {
            "product_feature": "f2",
            "max_consumption": 88,
            "total_consumptions": 0
        }
    ]
}
```

#### Success Response

**Code** : `200 OK`

**Content examples** :

```json
{
    "id": 1593781720493289,
    "status": "Inactive",
    "floating_in_use_devices": 0,
    "customer": {
        "id": 620,
        "total_orders": 14,
        "total_licenses": 45,
        "labels": [
            {
                "id": 3,
                "label_id": 8,
                "label": "Customer",
                "color": "#ff9f43"
            },
            {
                "id": 53,
                "label_id": 34,
                "label": "Loyal",
                "color": "#3a0cd4"
            }
        ],
        "email": "tc@tc.com",
        "first_name": "",
        "last_name": "",
        "company_name": "",
        "phone": "",
        "reference": "",
        "address": "",
        "postcode": "",
        "city": "",
        "country": "",
        "state": "",
        "clabels_all": "customerloyal",
        "cognito_user_pool_id": "",
        "metadata": {},
        "company": 277,
        "license_user": null,
        "clabels": [
            8,
            34
        ]
    },
    "product_features": [
        {
            "id": 1605023917125630,
            "product_feature": {
                "id": 189,
                "created_at": "2020-11-13T07:40:53Z",
                "updated_at": "2020-11-13T07:40:53Z",
                "name": "Feature 5",
                "code": "f5",
                "is_deleted": false,
                "feature_type": "activation",
                "max_consumption": 0,
                "allow_overages": false,
                "max_overages": 0,
                "reset_consumption": false,
                "consumption_period": null,,
                "metadata": {}
            },
            "max_consumption": 0,
            "total_consumptions": 0,
            "expiry_date": null,
            "allow_overages": false,
            "max_overages": 99,
            "reset_consumption": false,
            "consumption_period": null,
            "metadata": {}
        },
        {
            "id": 1605023917125631,
            "product_feature": {
                "id": 172,
                "created_at": "2020-08-26T05:37:14Z",
                "updated_at": "2020-08-26T05:37:14Z",
                "name": "Feature 2",
                "code": "f2",
                "is_deleted": false,
                "feature_type": "consumption",
                "max_consumption": 20,
                "allow_overages": false,
                "max_overages": 0,
                "reset_consumption": false,
                "consumption_period": null,
                "metadata": {}
            },
            "max_consumption": 88,
            "total_consumptions": 0,
            "expiry_date": null,
            "allow_overages": false,
            "max_overages": 99,
            "reset_consumption": false,
            "consumption_period": null,
            "metadata": {}
        }
    ],
    "product_custom_fields": [],
    "license_users": [
        {
            "id": 1240,
            "last_login": null,
            "email": "example@email.com|uss1",
            "true_email": "example@email.com",
            "created_at": "2020-08-12T08:52:32Z",
            "updated_at": "2020-08-12T09:01:24Z",
            "is_admin": {},
            "is_active": true,
            "is_staff": false,
            "first_name": "John",
            "last_name": "Doe",
            "phone_number": "00385913109161",
            "subscribed_to_email": false,
            "acquired_consent": null,
            "is_manager": false,
            "initial_password": "4q3dg7!_",
            "is_initial_password": true
        }
    ],
    "order_store_id": "d2d2dce02c844d4492c9d48758aa143a",
    "active_up_to_date_devices": 0,
    "total_active_devices": 0,
    "product": {
        "id": 1584723961091234,
        "product_name": "mch"
    },
    "created_at": "2020-07-03T13:08:40Z",
    "updated_at": "2020-11-13T07:41:01.671067Z",
    "license_key": null,
    "active": false,
    "enabled": true,
    "time_activated": "2020-10-10T14:42:16Z",
    "time_disabled": "2020-08-14T07:26:27Z",
    "max_activations": 5,
    "times_activated": 0,
    "valid_duration": null,
    "validity_period": "2020-09-30",
    "license_type": "perpetual",
    "enable_maintenance_period": true,
    "maintenance_duration": "3m",
    "maintenance_period": "2021-01-10",
    "is_trial": true,
    "max_consumptions": 0,
    "total_consumptions": 0,
    "subscription_id": null,
    "last_check": null,
    "prevent_vm": true,
    "allow_overages": false,
    "max_overages": 0,
    "reset_consumption": false,
    "consumption_period": null,
    "trial_days": 0,
    "is_floating": false,
    "is_floating_cloud": true,
    "floating_users": 1,
    "note": null,
    "max_license_users": 0,
    "transfer_count": 0,
    "floating_timeout": null,
    "max_transfers": 0,
    "is_air_gapped": false,
    "can_borrow": false,
    "max_borrow_time": 0,
    "is_bundle": false,
    "metadata": {},
    "order": 1593781720493279,
    "order_item": 1593781720493299,
    "disabled_user": null,
    "last_activation_device": null
}
```


---

# 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://docs.licensespring.com/management-api/license/update-license-product-features.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.
