# Creating the addon

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

Sign in to your partner account (you get it after signing the cooperation agreement) and you can create your own addon. If you only see a page with boxes for your contact information and no **Addons** tab, fill in the information and submit it for approval first. Only then can you create an addon.

When you create the addon, fill in its name on the **Settings** tab, and your URL to receive the OAuth code (required once the addon can be ordered and uses endpoints). You can also enter the URL used to authorize the user. Then save all the changes. The OAuth and authorization URLs can be added or edited later, when editing the addon.

After you save the addon, additional tabs appear in its detail, including the **Endpoints** tab. There you choose which data you want to receive from the e-shop, or change and upload – including the webhooks endpoints, if you want to register webhooks. The URLs for the uninstall, suspend, approve and terminate notifications are on the **Settings** tab.

Do not request all the endpoints at once – set only those you really need. The e-shop owner can see which endpoints your addon requests.

If you are testing the addon only within your own interface, you do not need any approval when changing the endpoints. When you decide to test your addon publicly, you must submit it for approval. Once Shoptet approves it, the addon can be installed: it is not visible in the addon list, only accessible via the URL shown in its detail. From then on, any change to the endpoints (extension of rights) needs to be approved.

## Extension of rights

The partner – developer – gets practically unlimited access to the e-shop data. This is a key fact, and we inform e-shop owners about it on the addon page before they install it. We also check that the addon requires only the rights it truly needs. Both we and the e-shop owners place great trust in you.

If you find that a new version of your addon needs an additional endpoint (access to additional data), we must approve it first. Then the e-shop owner is informed about the extension of rights and must approve it, because it extends the "data contract" agreed at the time of installation. In practice, the e-shop administration tells the e-shop owner that the addon asks for more rights and encourages them to accept.

A change of rights includes:

- Adding a new endpoint
- Changing a read-only endpoint to a write endpoint
- Removing an endpoint, or changing it from write to read-only
Take into account that the e-shop owner may not have confirmed the new rights yet. Until then, the API rejects calls to the new endpoint with `403 Forbidden` (error code `invalid-token-no-rights` ), or with `405` ( `http-method-not-allowed` ) if the e-shop owner has so far confirmed only read access. Describe the change properly in the addon description and in the release notes, so that the e-shop owner does not see the request for more rights as an attack on their privacy, but understands that it brings extended functionality. The e-shop owner always accepts all the rights at once (when installing or when the rights are extended); they cannot choose between them.

If you detect missing rights (not yet confirmed by the e-shop owner), you can send your users directly to the addon's rights confirmation screen using the link

```text
{domain}/admin/{addonsManager}/#modal-rights-{serviceId}
```

where

- `{domain}` is the e-shop's URL
- `{addonsManager}` depends on the language of the e-shop administration: `add-ons-manager` (English), `spravce-doplnku` (Czech), `spravca-doplnkov` (Slovak), `alkamazaskezelo` (Hungarian). A path in another language than the administration's leads to a 404 page.
- `{serviceId}` is the internal Shoptet ID of your addon. You can find it in the **API Partner** section of your administration ( `/admin/api-partner/?action=addons` ): click the addon line and check the value of the `?id=` parameter in the URL of the addon detail.
The link opens the confirmation only while the addon has rights waiting for confirmation.

On your own e-shop, the installation counts as a test installation: changes to the endpoints take effect without the e-shop owner's confirmation, even before Shoptet approves them. If they do not show up, reinstall the addon on your e-shop.

A newly installed addon immediately acquires all the currently approved rights.
