Adding a plugin to the eshop

During the installation process, an API key is created for the plugin and together with the store code it is forwarded via POST to the specified installation URL.

JSON object structure:

 
    {
        "eshopCode": "...",
        "apiToken": "...", // X-Wa-api-token usable for Webareal API
        "apiUrl": "api.webareal.cz",
        "language": "cs",
        "system": "webareal.cz",
        "tariffId": "id"
        "email": "email@email.com"
        "domain": "www.domain.tld"
    }
 

This data can be stored in a database and the eshopCode can be used to identify the different eshops on which the plugin is installed. At the moment it is possible to make the necessary settings on the API (e.g. webhook registration).

To complete the installation successfully, the plugin must respond with a 200 status code and the response body must contain a JSON object:

 
    {
        "status": "DONE"
    }
 

The status can take one of the following values:

  • DONE - the setup has been completed
  • IN_PROGRESS - the plugin performs settings in the background, which can take a long time
  • USER_SETUP_REQUIRED - eshop user settings required

If the response status is other than DONE, the plugin cannot be fully activated on the store. The status can be changed later via the PUT API method /plugin

 
    {
        "status": "DONE"
    }
 

Removing a plugin from the store

The plugin can be informed about removal from the store via a defined uninstall URL, which is called by the POST method with the following parameters:

 
    {
        "eshopCode": "...",
        "language": "cs",
        "system": "webareal.cz"
    }