# Consumption List

### Consumptions

The floating server provides support for managing license and feature consumptions associated with the licenses stored within its database. Requests to add consumptions are handled through the `/add_consumption` and `/add_feature_consumption` endpoints. Upon receipt of these requests, provided there are sufficient consumptions available for the specific license or feature, the floating server immediately updates the local consumption value. This updated value is reflected in the server's response as well as displayed on the UI's registration page.

![](/files/28619e72832c665c567c46940c415d1ce8673a04)

Additionally, at hourly intervals, local consumption values of the platform-sourced licenses undergo synchronization with the cloud LicenseSpring server. Detailed insights into both license and feature consumptions, including maximum allowed consumption and overages, can be found on the license details page, accessible from the configuration page.

It's essential to note that any alteration to a consumption value requires the license or feature to be of consumption type and that sufficient consumption is available, taking into account maximum consumption limits, overages allowance, and the possibility of unlimited consumption.

{% hint style="info" %}
Local consumption values are updated immediately on successful add-consumption requests and are synchronized with the cloud LicenseSpring server on an hourly schedule.
{% endhint %}

### Add Consumption (API)

Endpoint: POST /api/v4/add\_consumption

Request body parameters:

| Name             | Kind     | Type   | Description                |
| ---------------- | -------- | ------ | -------------------------- |
| Product          | required | string | Product Short Code         |
| Consumptions     | required | string | Number of Consumptions     |
| Max\_overages    | optional | string | Maximum Number of Overages |
| Allowe\_overages | optional | string | True or False              |

Example request (Go):

{% code title="example.go" %}

```go
url := sourceURL + "add_consumption"

data := Consumption{
	Product:        product,
	Consumptions:   consumptions,
	Max_overages:   max_overages,
	Allow_overages: allow_overages,
}

updatedJSON, err := json.Marshal(data)

req, err := http.NewRequest("POST", url, bytes.NewBuffer(updatedJSON))
```

{% endcode %}

Example success response (200):

```json
{
    "max_consumptions":100,
    "total_consumptions":1,
    "allow_overages":false,
    "max_overages":0,
    "reset_consumption":true,
    "consumption_period":"daily",
    "allow_unlimited_consumptions":false
}
```

Example error response (400):

```json
{
    "code":"license_activated_max_times",
    "message":"No free slots for product p1",
    "status":400
}
```

### Consumption Reset

For licenses or features designated for consumption reset with defined consumption periods, consumption values are automatically reset to zero by the end of this period. This reset occurs during one of the hourly synchronization events. Consequently, it may take up to an hour following the reset period for this adjustment to reflect on the server. Consumption reset periods can be chosen between daily, weekly, monthly, or annually.


---

# 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/floating-server/floating-server-v1/user-interface/registrations/consumption-list.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.
