For these cases Magento event / observer design pattern would be suitable, also refer to documentation.
So for example for add product to cart webhook, you can use checkout_cart_product_add_after event.
Your module should look like this:
app/code/Company/Module/registration.php:
<?php
declare(strict_types = 1);
use Magento\Framework\Component\ComponentRegistrar;
ComponentRegistrar::register(
ComponentRegistrar::MODULE,
'Company_Module',
__DIR__
);
app/code/Company/Module/etc/module.xml:
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Company_Module"/>
</config>
app/code/Company/Module/etc/events.xml:
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
<event name="checkout_cart_product_add_after">
<observer name="company_module_checkout_cart_product_add_after" instance="Company\Module\Observer\CheckoutCartProductAddAfter" />
</event>
</config>
app/code/Company/Module/Observer/CheckoutCartProductAddAfter.php:
<?php
declare(strict_types = 1);
namespace Company\Module\Observer;
use Magento\Framework\Event\Observer;
use Magento\Framework\Event\ObserverInterface;
class CheckoutCartProductAddAfter implements ObserverInterface
{
/**
* Execute observer
*
* @param Observer $observer
* @return void
*/
public function execute(
Observer $observer
): void {
// Your code logic here, like:
$item = $observer->getEvent()->getQuoteItem();
$product = $item->getProduct();
$data = $this->_request->getParams();
}
}
After adding these files run php bin/magento setup:upgrade from command line to enable the module.
If you make this an open source composer package than they only have to install the package and do a little configuration. That would be the way to go.
It's not possible however to observe these event from outside of Magento. So if you really can't make any changes in Magento, what you can do is polling the Magento api for new quotes/shipments.
E.g. getting list of shipments with Magento Rest API (sending date from/to filter recommended): https://magento.redoc.ly/2.4.3-admin/tag/shipments#operation/salesShipmentRepositoryV1GetListGet