How to implement a webhook endpoint in Shopware?

To elaborate a little further. Like Simkli mentioned, when creating callback urls in this manner you have to take care of security yourself!

So be sure to add your own security model (if necessary).

Below is an example for creating a callback url controller that is reachable like so, https://yourdomain.com/webhooks/index.

class Shopware_Controllers_Frontend_Webhooks extends Enlight_Controller_Action implements CSRFWhitelistAware
{
    public function getWhitelistedCSRFActions()
    {
        // Whitelist the action
        return ['index'];
    }

    public function indexAction()
    {
        // Your code here
        ...

        // Call exit() after you've echoed your response, otherwise the controller might try to return a view, which could lead to errors.
        exit();
    }
}

Have a nice evening!

Greets,

Donny