# Metadata

Metadata is a powerful feature introduced in LicenseSpring that allows you to attach custom information to various levels within your licensing infrastructure.

It serves as a flexible and extensible mechanism for storing additional data related to licenses, features, products, and customers.

The metadata JSON is stored as a string, providing a wide range of possibilities for customization.

### Levels of Metadata

Metadata can be applied at four different levels within LicenseSpring, providing flexibility and granularity in managing your licensing data.

#### Order Metadata

Order metadata enables you to store custom information related to your orders. This level of metadata is useful for storing order-specific details.

![](/files/a0b800e066c1c4e6a87210f6dc28979ba57dc7f7)

#### License Metadata

License metadata allows you to attach custom information to individual licenses. This level of metadata is particularly useful for storing license-specific details that are unique to each instance.

For example, you can add metadata to indicate the activation date, license type, or any other relevant information specific to a particular license.

![](/files/83a2fa2e3b8bfec89d67d36f32f62d1856fc43db)

#### Feature Metadata

Feature metadata allows you to associate custom information with specific features within your licensing structure.

This level of metadata can be used to store additional details about individual features, such as version numbers, release dates, or any other feature-specific data that you wish to track.

![](/files/5b8e28ba13e819ccc7c284c62bdedf8047aa69c8)

#### Product Metadata

Product metadata enables you to store custom information related to your products. This level of metadata is useful for storing product-specific details that are applicable to all licenses associate.

Product metadata is returned from license check inside the `product details` object.

![](/files/80266d1d8f5396a2ef060f09d600174b604ec2ac)

#### Customer Metadata

Customer metadata allows you to attach custom information to individual customers. This level of metadata is particularly helpful for storing customer-specific details that may be important for managing your licensing relationships.

For instance, you can add metadata to store customer preferences, contact information, or any other relevant data that pertains to a specific customer.

![](/files/d604ef78a1518eb778b685f6cd07c6baa08b983d)

### Customer Accounts

Customer Accounts metadata allows you to attach custom information to group of customers. This level of metadata is particularly helpful for storing details about group of customer accounts.

For instance, you can add metadata to store customer accounts preferences, contact information, or any other relevant data that pertains to a specific customer accounts.

![](/files/d349626c4c9aaa2db3e6707edb0a7a9afe75ffba)

### Working with Metadata

Managing metadata in LicenseSpring involves the adding and retrieving of metadata at the desired levels. Here's a brief overview of the basic operations for working with metadata.

#### Adding Metadata

To add metadata to a license, feature, product, or customer, you can use the appropriate API method provided by LicenseSpring.

The `metadata` field is initially established on the product feature and, along with other fields, acts as a default value. When a license is created with specific product features, we utilize those features to generate license\_product\_feature items, inheriting default values from the product\_features, and assign them to the license.

Then, the metadata on the license product features can remain unchanged or be modified on a per-license basis, depending on your preferences. If no modifications are made, the metadata will persist in its original state.

#### Retrieving Metadata

To retrieve metadata associated with a license, feature, product, or customer, you can utilize the method `metadata()` on the `License`, `LicenseFeature`, `ProductDetails`, and `Customer` classes. By providing the relevant identifier, the API will return the metadata string associated with the specified entity.

{% hint style="info" %}
Note: It's important to remember that metadata will only affect the specific entity to which it is attached and will not impact other licenses, features, products, or customers.
{% endhint %}


---

# 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/vendor-platform/metadata.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.
