Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
  • Blog
  • Pricing
  • Documentation
Yandex project
© 2025 Yandex.Cloud LLC
Yandex Cloud Marketplace
    • Getting started
      • Registration
      • Creating a product in the partner dashboard
      • Creating a service plan
      • Creating a new product version
      • Changing product versions
      • Creating a trial period
      • Integration with the License Manager API
    • Access management
    • Access management
    • Audit Trails events
  1. Partners
  2. Step-by-step guides
  3. Integration with the License Manager API

Integration with the License Manager API

Written by
Yandex Cloud
Updated at January 22, 2025

If you created a subscription within one of these service plans:

  • Subscription: Set up integration with the License Manager API or License Manager SaaS API for your subscription to work properly.
  • PAYG: User will automatically switch to this service plan as soon as they unlink the subscription from a resource or as soon as the subscription expires. You can set up integration with the License Manager API if required.
Compute Cloud
Managed Service for Kubernetes
Cloud Apps
SaaS
  1. Get the subscription template ID (license_template_id).

    You can find the subscription template ID in the Cloud Marketplace partner dashboard. Use the ID in the product code to manage the subscription.

  2. Implement the following steps in your product code:

    1. Regularly checking if your subscription is active.

      You can get the up-to-date subscription information using the list REST API method for the Instance resource or the InstanceService/List gRPC API call.

      Note

      Please note that the user can unlink a resource from the subscription and link another one to it. Make sure your code can handle cases like this correctly.

    2. Configuring business logic for subscription processing: consumption records, limitations related to time, number of users, etc.

  1. Get the subscription template ID (license_template_id).

    You can find the subscription template ID in the Cloud Marketplace partner dashboard. Use the ID in the product code to manage the subscription.

  2. Implement the following steps in your product code:

    1. Getting the ID of application installation to the Kubernetes cluster and linking it to the subscription. Sample code.

    2. Regularly checking if your subscription is active.

      You can get the up-to-date subscription information using the list REST API method for the Instance resource or the InstanceService/List gRPC API call.

      Note

      Please note that the user can unlink a resource from the subscription and link another one to it. Make sure your code can handle cases like this correctly.

    3. Configuring business logic for subscription processing: consumption records, limitations related to time, number of users, etc.

  1. Get the subscription template ID (license_template_id).

    You can find the subscription template ID in the Cloud Marketplace partner dashboard. Use the ID in the product code to manage the subscription.

  2. Implement the following steps in your product code:

    1. Regularly checking if your subscription is active.

      You can get the up-to-date subscription information using the list REST API method for the Instance resource or the InstanceService/List gRPC API call.

      Note

      Please note that the user can unlink a resource from the subscription and link another one to it. Make sure your code can handle cases like this correctly.

    2. Configuring business logic for subscription processing: consumption records, limitations related to time, number of users, etc.

  1. Create a service account you will use to verify subscriptions purchased by users and link such subscriptions to the service:

    1. Log in to the Marketplace partner dashboard.
    2. Open the Access management section.
    3. Click Add federated user.
    4. In the window that opens, specify the service account ID and click Add.
    5. Find the service account in the list and click image → Change.
    6. In the window that opens, click + Add role, select the license-manager.saasSubscriptionSupervisor role, and click Save.
  2. Authenticate with the License Manager API as a service account. For authentication, use an IAM token.

  3. Create a page to redirect the user to when linking their purchased subscription to the service.

    When redirecting the user to such a page, the token parameter in the request string will contain the JWT token (instanceToken) generated by Yandex Cloud. The JWT token is valid for 15 minutes. It contains:

    • ID of the subscription the user purchased (license_instance_id).
    • ID of the subscription template you created in the partner dashboard (license_template_id).
  4. While the JWT token is valid, use the created page to authenticate the user and assign them a unique ID (resourceId). You must generate the unique user ID (resourceId) manually in the product code.

  5. Link the unique user ID (resourceId) to the subscription the user purchased (license_instance_id).

    You can link an ID to a subscription using the ensure REST API method for the Lock resource or the LockService/Ensure gRPC API call.

    Provide the JWT token (instanceToken) and the unique user ID (resourceId) in the request. In response, you will get the link ID (lock_id) in the metadata parameter. If the response returns an error, the subscription failed to link to the service and you need to ask the user to complete all the steps again.

  6. Make sure to regularly check your subscription link is active. To do this, use the link ID (lock_id) you got in the previous step.

    To get up-to-date information about a linked subscription, use the get REST API method for the Lock resource or the LockService/Get gRPC API call.

    The response must return an active Lock resource with state = LOCKED and the subscription expiry time (end_time) set to a value in future.

    Note

    Note that the user can unlink a subscription from the service and link a different one. Make sure your code can handle cases like this correctly.

  7. Implement business logic to process subscriptions: consumption records, limitations related to time, number of users, etc.

Integration testingIntegration testing

For code examples and a test server you can use to check the License Manager API integration, see this GitHub repository.

Was the article helpful?

Previous
Creating a trial period
Next
Partner profile
Yandex project
© 2025 Yandex.Cloud LLC