# License Change Notification (LCN)

## Overview

License Change Notification (LCN) works as a message service generating automatic subscription notifications for your 2Checkout account. Use the notifications to process subscription data into your own management systems by synchronizing it with 2Checkout account events. 2Checkout generates notifications for subscription update and expiration events (including past-due notifications).

## How can I use LCN?

Use LCN to automate back-end functions for your services, including but not limited to:

* Creating end-user accounts
* Providing access to acquired services
* Manage subscriptions
* Fulfilling purchases
* Engaging subscribers
* Converting trials to paid subscriptions
* Cutting access to a delinquent account

## Webhook asynchronicity

2Checkout’s webhooks (IPN and LCN) operate **asynchronously**.

## How does LCN work?

{% stepper %}
{% step %}

### Create listener pages

Create one or multiple LCN listener pages on your website. 2Checkout sends LCNs to publicly accessible servers.
{% endstep %}

{% step %}

### Configure LCN settings

Configure the [LCN settings](https://secure.2checkout.com/cpanel/lcn_settings.php) of your 2Checkout account to point to the URLs of your default/preferred listener pages. Our system performs a GET request against the URL you fill in and expects an HTTP 200 code as a response. Make sure that your URL can be queried via a GET request from our webserver IPs.
{% endstep %}

{% step %}

### Use multiple URLs for testing

Set up multiple URLs if you require more listener pages, such as in testing scenarios in which you don’t want to use your default LCN listener.
{% endstep %}

{% step %}

### Notifications delivery

2Checkout sends subscription notifications to the endpoints you defined when subscribers change specific subscription details, using secure (HTTPS) POST.
{% endstep %}

{% step %}

### Signature validation

2Checkout uses an HMAC\_SHA signature to validate the HTTPS POST. Calculate the signature using data sent and your 2Checkout account’s secret key, following the instructions included in this article.
{% endstep %}

{% step %}

### Process notifications

Your custom LCN listener scripts consume the notifications and process the info received.
{% endstep %}

{% step %}

### Read receipt confirmation

Configure your LCN listener to output a **read receipt confirmation** on the listener page after receiving a valid LCN message. This article includes guidance on how to generate the confirmation.
{% endstep %}

{% step %}

### Retry on failure

In the absence of a confirmation from one of your LCN listeners, 2Checkout continues to send notifications to that endpoint, according to the failure retry process, until you provide a valid response.
{% endstep %}

{% step %}

### Periodic checks and expirations

The 2Checkout system regularly checks the status of subscriptions to identify expired items and modifications. 2Checkout then sends notifications for expirations as well as for updates that occurred in the last 24 hours prior to the moment when it performs the check. 2Checkout does not re-send notifications for the same event unless the status of the subscription changes or it identifies additional modifications.
{% endstep %}
{% endstepper %}

## Set up the default LCN URL

{% stepper %}
{% step %}
Log in to your [2Checkout account](https://secure.avangate.com/cpanel/index.php).
{% endstep %}

{% step %}
Navigate to *Dashboard → Integrations → Webhooks and API.*
{% endstep %}

{% step %}
Click on the **LCN** **Settings** tab.
{% endstep %}

{% step %}
Click on the **Edit** button to edit an existing URL corresponding to your default LCN listener or click on the **Add LCN URL** button to add a URL corresponding to your default LCN listener in the **LCN URL field**.
{% endstep %}

{% step %}
**Save** your settings by clicking on the **Update** button at the bottom of the page.
{% endstep %}

{% step %}
2Checkout checks the validity of the URLs in terms of access to ensure that notifications reach your LCN listener without any issues.
{% endstep %}
{% endstepper %}

{% hint style="warning" %}
All merchants are strongly advised to migrate to SHA2/SHA3. We will stop supporting the MD5 algorithm in our platform on the 15th of August, 2024.

For more details, check the Migration guide from MD5 to SHA2/SHA3 algorithm documentation.
{% endhint %}

### Set up multiple LCN URLs

You can set up multiple endpoints for your LCN notifications, for scenarios in which you have multiple Internal Systems that require receiving this information. You can set up eight (8) URLs for your notifications.

Navigate to [LCN settings](https://secure.2checkout.com/cpanel/lcn_settings.php) under *Integrations → Webhooks and API*, in your Merchant Control Panel Dashboard. Select the [LCN settings](https://secure.2checkout.com/cpanel/lcn_settings.php) tab and click on the **Add LCN URL** button to create an additional URL configuration for your notifications.

To find out more about the NOTIFICATION\_URL functionality, [read more here](/2checkout-apis/2checkout-apis/webhooks/ipn-and-lcn-url-settings.md).

### Debug LCN

To view or debug LCN notifications during the integration phase, place TEST orders.

Alternatively, search for specific subscriptions in the [Subscriptions](https://secure.avangate.com/cpanel/licenses_management.php) area. On the subscription details page, you have the option to resend notifications. You can also see how many LCN notifications have been sent so far for a subscription. Opt to reissue the LCN for debugging and 2Checkout re-generates and re-sends the LCN, but also displays a copy of the content sent in the control panel.

### Secure your LCN script

For security reasons, 2Checkout recommends that you restrict access to the LCN script.


---

# 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.2checkout.com/2checkout-apis/2checkout-apis/webhooks/license-change-notification-lcn.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.
