> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lerian.studio/llms.txt
> Use this file to discover all available pages before exploring further.

# Lerian's License

> Licenses authorize access to Lerian paid products and plugins, with organization-scoped and global license types.

A **license** is a key that authorizes access to Lerian features or services under specific contractual conditions, typically aligned with billing cycles (e.g., monthly, annual). This mechanism is similar to how software products like Microsoft Office or GitHub Enterprise manage access through activation keys.

In Lerian's ecosystem, licenses play a critical role in:

* Ensuring customers are in good standing before accessing paid features, such as **products**, **plugins or enterprise features**.
* Managing which features are available per client.
* Enabling Lerian to scale support and sales operations securely and efficiently.

In short, only clients with valid licenses, as defined in their contracts, can access specific software components.

<Danger>
  A valid license must be associated with the organization making the request. Otherwise, access will be denied.
</Danger>

## License types

***

In Lerian’s ecosystem, licenses can have two different scopes, depending on the plugin:

### Organization-specific licenses (non-global)

Applies to a **single organization**.

Example: **Fees Engine**, **CRM**, **Reporter**.

<Tip>
  You can use the license with any number of ledgers inside that organization.
</Tip>

### Global licenses

Valid for **multiple organizations**.

Example: **Access Manager.**

## License usage workflow

***

The steps below apply to both license types:

<Steps>
  <Step title="Submit a license request to Lerian.">
    * **For organization-specific plugins**: provide the `organization_id` that will use the license.
    * **For global plugins**: inform Lerian that you need a global license; no `organization_id` is required.
  </Step>

  <Step title="License generation and activation by Lerian">
    Lerian’s team follows the internal process to create and activate the license using the provided details.
  </Step>

  <Step title="License key delivery">
    Lerian sends the **License Key** (`LICENSE_KEY`) to the client.
  </Step>

  <Step title="Environment configuration">
    Once you receive your license key, you must configure your `.env` file so the system knows **which license to validate** and **which organizations it applies to**.
  </Step>
</Steps>

<Warning>
  Always configure the correct environment variables before using a plugin. Incorrect or missing values will result in license validation errors.
</Warning>

**Organization-specific licenses (non-global)**

These licenses apply to one organization only.

<CodeGroup>
  ```bash Bash theme={null}
  # LICENSE
  LICENSE_KEY=<license key>
  ORGANIZATION_IDS=<organization-id1>,<organization-id2>
  ```
</CodeGroup>

* **LICENSE\_KEY**: The key provided by Lerian.
* **ORGANIZATION\_IDS**: The ID of the organization linked to the license.

**Global licenses**

These licenses have a global scope and must **always** use the value `global` in the `ORGANIZATION_IDS` variable.

<CodeGroup>
  ```bash Bash theme={null}
  # LICENSE
  LICENSE_KEY=<license key>
  ORGANIZATION_IDS=global
  ```
</CodeGroup>

* **LICENSE\_KEY**: The key provided by Lerian.
* **ORGANIZATION\_IDS**: Must be set to `global` for global licenses.

## License-related errors

***

When a license is invalid or expired, API responses or plugin behaviors may return one of the specific error messages:

| Code     | Title                                        | Message                                                                                                                                                                                                                                          |
| :------- | :------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| LCS-0001 | Internal server error                        | An internal server error occurred. Please try again later or contact support if the problem persists.                                                                                                                                            |
| LCS-0002 | No organization IDs configured               | The application is not configured with any organization IDs.                                                                                                                                                                                     |
| LCS-0003 | No valid licenses found for any organization | No valid licenses were found for any of the configured organizations. Please check your license keys and ensure at least one organization has a valid license.                                                                                   |
| LCS-0010 | Organization ID header is missing            | The X-Organization-ID header is missing. Please ensure the header is included in the request.                                                                                                                                                    |
| LCS-0011 | Organization ID header is unknown            | The organization ID '12345' was not found in the list of configured organizations. Please verify you are using a valid organization ID.                                                                                                          |
| LCS-0012 | Failed to validate organization license      | License validation failed for organization ID 12345. This could be due to network issues, invalid license keys, or server-side problems. Please verify your license key is correct and that you have network connectivity to the license server. |
| LCS-0013 | Organization license is invalid              | The license for organization ID '12345' is not valid and has no grace period active. Please renew your license or contact support for assistance.                                                                                                |
| LCS-1001 | Validation error                             | Could not validate license key. Please try again later or contact your system administrator.                                                                                                                                                     |
| LCS-1002 | License not found                            | There is no license for this license key.                                                                                                                                                                                                        |
| LCS-1003 | License expired                              | The license key has expired.                                                                                                                                                                                                                     |
| LCS-1004 | License suspended                            | The license key has been suspended due to payment issues or administrative action.                                                                                                                                                               |
| LCS-1005 | Fingerprint mismatch                         | The license key or organization ID are not valid for this license.                                                                                                                                                                               |
| LCS-1006 | Product mismatch                             | There is no license for this product.                                                                                                                                                                                                            |

<Tip>
  For more information about your license or to request an upgrade, please contact the Lerian commercial team.
</Tip>
