---
title: "Creating a plugin for processing amoCRM webhooks in Joomla - WebTolk websites development, Joomla Extensions"
description: "How to process amoCRM webhook data in Joomla? Creating a Joomla plugin for processing notifications and data from amoCRM."
url: "https://web-tolk.ru/en/dev/biblioteki/wt-amo-crm-library/documentation/creating-a-plugin-for-processing-amocrm-webhooks-in-joomla"
date: "2026-06-19T04:28:21+00:00"
language: "en-GB"
---

# Creating a plugin for processing amoCRM webhooks in Joomla

WT Amo CRM library - Documentation

**Category:** [Libraries](https://web-tolk.ru/en/dev/biblioteki)

[Project](https://web-tolk.ru/en/dev/biblioteki/wt-amo-crm-library)[Versions](https://web-tolk.ru/en/dev/biblioteki/wt-amo-crm-library/versions)[Documentation](https://web-tolk.ru/en/dev/biblioteki/wt-amo-crm-library/documentation)[GitHub](https://github.com/WebTolk/WT-Amo-CRM-library-for-Joomla-4)

How to process amoCRM webhook data in Joomla? Creating a Joomla plugin for processing notifications and data from amoCRM.

If the WT amoCRM library is configured correctly, amoCRM webhooks are sent to a single Joomla entry point in the form `<ваш_сайт>/index.php?option=com_ajax&plugin=wt_amocrm&group=system&format=raw&action=webhook&action_type=external&token=`. After that, the data is cleared from the GET parameters of the entry point URL: `option`, `plugin`, `group`, `format`, `action`, `action_type`, `token`.

To process the cleaned data, you need to create your own plugin that will listen to the `onAmocrmIncomingWebhook` event. Plugin groups are imported before the call:

1. `system`
2. `user`
3. `amocrm`

It is recommended to create plugins in the `amocrm` group in order not to overload the Joomla event system. In the general Joomla event manager, system plugins are always called before the group plugins. Thus, the system plugin that processes the incoming webhook will be called every time the page is generated and will participate in all Joomla processes, which in this particular case is completely redundant.

### Creating the amoCRM webhook processing plugin in Joomla

The process of creating a Joomla plugin has been described many times:

1. [Creating plugins based on the new structure of Joomla 4](https://web-tolk.ru/en/dev/biblioteki/wt-amo-crm-library/documentation/index.php?option=com_content&view=article&id=80&catid=10&lang=ru-RU) (on this site, in Russian)
2. [Creating plugins based on the new structure of Joomla 4](https://habr.com/ru/articles/736412/) (on Habr, in Russian)
3. [Official Joomla documentation for Developers manual.joomla.org](https://manual.joomla.org/docs/5.3/building-extensions/plugins /)
4. [The book by the Greek Joomla developer Nicholas Dionisopoulos "Joomla Extensions development"](https://www.dionysopoulos.me/book.html)
5. [How to trigger events for plugins in the manner of Joomla 5+?](https://web-tolk.ru/en/dev/biblioteki/wt-amo-crm-library/documentation/index.php?option=com_content&view=article&id=154&catid=10&lang=ru-RU)

Therefore, the nuances of working with the library will be described here.

#### Namespace of the plugin

For example, the class name of your plugin `customamocrmprocess`. Then in the XML manifest of the plugin we specify:

```
<namespace path="src">Joomla\Plugin\Amocrm\Customamocrmprocess</namespace>
```

In the plugin class, which will be located in **plugins/amocrm/customamocrmprocess/src/Extension/Customamocrmprocess.php** specify

```
<?php

namespace Joomla\Plugin\Amocrm\Customamocrmprocess\Extension;

use Webtolk\Amocrm\Event\WebhookEvent;
use Joomla\CMS\Plugin\CMSPlugin;
use Joomla\CMS\Uri\Uri;
use Joomla\Event\SubscriberInterface;

\defined('_JEXEC') or die;

final class Customamocrmprocess extends CMSPlugin implements SubscriberInterface
{

    /**
     * Returns an array of events this subscriber will listen to.
     *
     * @return array
     *
     * @since   5.3.0
     */
    public static function getSubscribedEvents(): array
    {
        return [
            'onAmocrmIncomingWebhook' => 'onAmocrmIncomingWebhook',
        ];
    }

    /**
     * Set as required the passwords fields when mail to user is set to No
     *
     * @param   PrepareFormEvent $event  The event instance.
     *
     * @return  void
     *
     * @since   4.0.0
     */
    public function onAmocrmIncomingWebhook(WebhookEvent $event): void
    {
        // working with data
    }
}
```

It is assumed that the `onAmocrmIncomingWebhook` method does not return any data (`void`), since in response to the notification we can only execute our API request or simply process the data.

#### The $event argument of onAmocrmIncomingWebhook

The argument `$event` of the `onAmocrmIncomingWebhook` method is an object of the `\Webtolk\Amocrm\Event\WebhookEvent` class located in **libraries/Webtolk/Amocrm/src/Event/WebhookEvent.php**. This class provides an opportunity to get a php array with data from a webhook. If there is no data, an empty array will be returned.

```
<?php
// all the webhook raw data if exists
$data = $event->getData();

// Account data if exists
$account = $event->getAccount();

// Contacts/companies data if exists
$contacts = $event->getContacts();

// Leads data if exists
$leads = $event->getLeads();

// Tasks data if exists
$tasks = $event->getTasks();

// Unsorted data if exists
$unsorted = $event->getUnsorted();

// Messages data if exists
$messages = $event->getMessages();
```

Sample code for **your** plugin.

```
<?php

use Webtolk\Amocrm\Event\WebhookEvent;

/**
 * @param   WebhookEvent  $event
 *
 * @return  void
 *
 * @throws  AmocrmClientException
 * @see     WebhookEvent
 * @since   1.3.0
 */
public function onAmocrmIncomingWebhook(WebhookEvent $event): void
{

    /** @var array $contacts Array of contacts from webhook if exists */
    $contacts = $event->getContacts();

    if (empty($contacts)) {
        return;
    }

    // Do anything with contacts data
}
```

Of course, no one prevents you from getting data from the `Input` Joomla object yourself.

```
<?php
$app = $this->getApplication();

$any_data = $app->getInput()->getString('any_data', 'default_value_if_empty');
```

## JSON-LD Schema

```json
{
    "@context": "https://schema.org",
    "@type": "BreadcrumbList",
    "@id": "https://web-tolk.ru/#/schema/BreadcrumbList/17",
    "itemListElement": [
        {
            "@type": "ListItem",
            "position": 1,
            "item": {
                "@id": "https://web-tolk.ru/en",
                "name": "Home"
            }
        },
        {
            "@type": "ListItem",
            "position": 2,
            "item": {
                "@id": "https://web-tolk.ru/en/dev",
                "name": "Joomla extensions"
            }
        },
        {
            "@type": "ListItem",
            "position": 3,
            "item": {
                "@id": "/en/dev/biblioteki",
                "name": "Libraries"
            }
        },
        {
            "@type": "ListItem",
            "position": 4,
            "item": {
                "@id": "/en/dev/biblioteki/wt-amo-crm-library",
                "name": "WT Amo CRM library"
            }
        },
        {
            "@type": "ListItem",
            "position": 5,
            "item": {
                "@id": "/en/dev/biblioteki/wt-amo-crm-library/documentation",
                "name": "Documentation"
            }
        },
        {
            "@type": "ListItem",
            "position": 6,
            "item": {
                "name": "Creating a plugin for processing amoCRM webhooks in Joomla"
            }
        }
    ]
}
```

```json
{
    "@context": "https://schema.org",
    "@graph": [
        {
            "@type": "Organization",
            "@id": "https://web-tolk.ru/#/schema/Organization/base",
            "name": "WebTolk",
            "url": "https://web-tolk.ru/",
            "logo": {
                "@type": "ImageObject",
                "@id": "https://web-tolk.ru/#/schema/ImageObject/logo",
                "url": "images/webtolk-1080p.jpg",
                "contentUrl": "images/webtolk-1080p.jpg",
                "width": 1920,
                "height": 1080
            },
            "image": {
                "@id": "https://web-tolk.ru/#/schema/ImageObject/logo"
            },
            "sameAs": [
                "https://github.com/WebTolk",
                "https://github.com/sergeytolkachyov",
                "https://vk.com/web_tolk",
                "https://vk.com/webtolkru",
                "https://tenchat.ru/sergeytolkachyov",
                "https://t.me/sergeytolkachyov",
                "https://t.me/webtolkru"
            ]
        },
        {
            "@type": "WebSite",
            "@id": "https://web-tolk.ru/#/schema/WebSite/base",
            "url": "https://web-tolk.ru/",
            "name": "WebTolk websites development, Joomla Extensions",
            "publisher": {
                "@id": "https://web-tolk.ru/#/schema/Organization/base"
            }
        },
        {
            "@type": "WebPage",
            "@id": "https://web-tolk.ru/#/schema/WebPage/base",
            "url": "https://web-tolk.ru/en/dev/biblioteki/wt-amo-crm-library/documentation/creating-a-plugin-for-processing-amocrm-webhooks-in-joomla",
            "name": "Creating a plugin for processing amoCRM webhooks in Joomla - WebTolk websites development, Joomla Extensions",
            "description": "How to process amoCRM webhook data in Joomla? Creating a Joomla plugin for processing notifications and data from amoCRM.",
            "isPartOf": {
                "@id": "https://web-tolk.ru/#/schema/WebSite/base"
            },
            "about": {
                "@id": "https://web-tolk.ru/#/schema/TechArticle/base"
            },
            "inLanguage": "en-GB",
            "breadcrumb": {
                "@id": "https://web-tolk.ru/#/schema/BreadcrumbList/17"
            }
        },
        {
            "@type": "TechArticle",
            "headline": "Creating a plugin for processing amoCRM webhooks in Joomla",
            "url": "https://web-tolk.ru/en/dev/biblioteki/wt-amo-crm-library/documentation/creating-a-plugin-for-processing-amocrm-webhooks-in-joomla",
            "description": "How to process amoCRM webhook data in Joomla? Creating a Joomla plugin for processing notifications and data from amoCRM.",
            "mainEntityOfPage": {
                "@type": "WebPage",
                "url": "https://web-tolk.ru/en/dev/biblioteki/wt-amo-crm-library/documentation/creating-a-plugin-for-processing-amocrm-webhooks-in-joomla"
            }
        }
    ]
}
```
