# Uninstalling the addon

URL: https://shoptet.dev/addons/documentation/uninstalling-the-addon

The user may choose to stop using the addon and uninstall it in the e-shop administration. Alternatively, the e-shop may be terminated, and the uninstallation will be completed along with the e-shop termination.

**As a developer, you can recognize this in three ways:**

1. The `OAuth access token` will be marked as invalid, and no new `API access tokens` can be requested. API calls will be rejected.
2. We send you an email about the uninstallation (if **Send email notifications** is enabled in the addon settings).
3. Through an **uninstallation webhook** (see below for details).
You may need to deactivate the user (e-shop) in your system in response to the uninstallation, to avoid making API calls with an invalid token.

Also, be aware that the e-shop operator may change their mind and reinstall the addon. Without proper handling, this could lead to problems with duplicate accounts during the second installation.

When the addon is uninstalled, Shoptet also deletes all webhooks your addon registered for that e-shop through the API. If the e-shop installs the addon again, register them again as part of the new installation.

## Uninstaller webhook

You may have encountered webhooks on a separate page dedicated to the e-shop's [webhooks](/addons/documentation/webhooks/) . The concept of the uninstaller webhook is the same. Its **purpose is to call the URL you registered using the HTTPS protocol when the addon is uninstalled** from a particular e-shop.

If you choose to use the uninstaller webhook, you must first register the URL that will receive notifications about addon uninstallations. In the addon settings (Partner e-shop administration → Connections → API Partner → Addons tab → click the addon name), enter the webhook URL to receive the uninstallation notification, e.g.: [https://myapplication.tld/uninstall.php](https://myapplication.tld/uninstall.php)

![](https://res.cloudinary.com/shoptet/image/upload/q_auto/f_auto/v1/developers/API/bh8jepjnokwz155j7xtb?_a=DAJKG5E/ZAA0)
From that point on, **whenever any e-shop uninstalls your addon or is terminated, Shoptet will invoke the URL [https://myapplication.tld/uninstall.php](https://myapplication.tld/uninstall.php) via a `POST`** request with the following content:

```json
{
    "eshopId": 222651,
    "event": "addon:uninstall",
    "eventCreated": "2019-01-08T15:13:39+0100",
    "eventInstance": "222651"
}
```

The event notification contains the e-shop identification ( `eshopId` ), the event type ( `addon:uninstall` ), the time of creation, and the instance concerned ( `eventInstance` ) – which is the e-shop identifier again (e.g., `222651` ).

The data is sent in the body of the request in JSON format. So, for example, in PHP, you can retrieve and convert it into an associative array as follows:

```php
$body = file_get_contents('php://input');
$webhook = json_decode($body, true);
```

A notification sent to a webhook URL must be acknowledged by the webhook with an HTTP `2xx` status code within 4 seconds. Redirects are not followed — a `3xx` response counts as a failed delivery. Otherwise, we will retry the notification within 15 minutes, up to two more times (for a total of three attempts). If the final attempt is not acknowledged, the notification will be marked as inactive, and Shoptet will no longer make further delivery attempts.

Delivered notifications are logged internally by Shoptet, but the addon author does not have access to these logs: [`GET /api/webhooks/notifications`](/addons/documentation/webhooks/) lists only notifications of webhooks registered through the API, not system webhooks such as the uninstall webhook.

The uninstall webhook supports the same [signing mechanism](/addons/documentation/webhooks/#signing-the-webhooks) as other webhooks. If a signature key has been generated for the e-shop, the webhook request includes the `Shoptet-Webhook-Signature` header.

## Pausing and resuming addons

In rare cases, an `OAuth access token` can be paused: the addon remains installed and billing continues, but API requests are rejected. For more information, see [Pausing and resuming addons](/addons/documentation/pausing-resuming-addons/) .
