> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://docs.clientexec.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Using Hooks

To use a Hook in Clientexec you need to create a Snapin ( For instructions creating a Snapin see [this](/en/article/snapin-plugin-development-guide-y25hs7/) ). 

Using **Invoice-Create** as an example:

```html
<?php

require_once 'modules/admin/models/SnapinPlugin.php';

class PluginSamplesnapin extends SnapinPlugin
{
    public $listeners = [
        ["Invoice-Create", "invoiceCreateCallback"]
    ];

    public function invoiceCreateCallback($e)
    {

        if (is_array($e)) {
            $event = $e;
        } else {
            $event = $e->getParams();
        }
        CE_Lib::log(4, $event);
    }
}
```

A List of Hooks can be found [here](/en/article/list-of-events-hooks-1tadivx/).  