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.
Metadata can be applied at four different levels within LicenseSpring, providing flexibility and granularity in managing your licensing data.
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.
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.
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.
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.
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.
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.
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.
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.