[Yandex Cloud documentation](../../index.md) > [Yandex Cloud Marketplace](../index.md) > Partners > Step-by-step guides > Integration with the License Manager API

# Integration with the License Manager API

If you created a [subscription](../concepts/subscription.md) within one of these service plans:
* `Subscription`: Set up integration with the [License Manager API](../license-manager/api-ref/quickstart.md) 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](../license-manager/api-ref/quickstart.md) if required.

To set up integration with the License Manager SaaS API, see [this guide](../license-manager/saas/api-ref/quickstart.md).

{% list tabs group=service %}

- Compute Cloud {#compute}

    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.

    1. 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](../license-manager/api-ref/Instance/list.md) REST API method for the [Instance](../license-manager/api-ref/Instance/index.md) resource or the [InstanceService/List](../license-manager/api-ref/grpc/Instance/list.md) gRPC API call.
           
           {% note info %}
           
           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.
           
           {% endnote %}

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

- Managed Service for Kubernetes {#managed-k8s}

    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.

    1. 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](https://github.com/yandex-cloud-examples/yc-marketplace-k8s-check-licenses/tree/main).

        1. Regularly checking if your subscription is active.
           
           You can get the up-to-date subscription information using the [list](../license-manager/api-ref/Instance/list.md) REST API method for the [Instance](../license-manager/api-ref/Instance/index.md) resource or the [InstanceService/List](../license-manager/api-ref/grpc/Instance/list.md) gRPC API call.
           
           {% note info %}
           
           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.
           
           {% endnote %}

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

- Cloud Apps {#cloud-apps}

    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.

    1. 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](../license-manager/api-ref/Instance/list.md) REST API method for the [Instance](../license-manager/api-ref/Instance/index.md) resource or the [InstanceService/List](../license-manager/api-ref/grpc/Instance/list.md) gRPC API call.
           
           {% note info %}
           
           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.
           
           {% endnote %}

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

{% endlist %}

## Integration testing {#test}

For code examples and a test server you can use to check the License Manager API integration, see [this GitHub repository](https://github.com/yandex-cloud-examples/yc-marketplace-api-usage-examples/blob/main/licensemanager/README.md).