Integrating with External Systems
API, webhooks, hooks for CRM, accounting, automation
What it is
WHMDC can integrate with external systems in three ways: the Public REST API, outgoing webhooks, and the hook system. Use these to build integrations with CRMs, accounting software, automation tools, or your own applications.
Public REST API
Use GET/POST/PUT/DELETE /api/v1/... with API key authentication. Create clients, fetch products, manage services, create invoices, record payments. See API Reference.
Outgoing webhooks
Configure webhooks via API or admin. When events occur (invoice.paid, service.provisioned), WHMDC POSTs your URL. Verify signature with HMAC-SHA256. Use for: syncing to CRM, Slack notifications, triggering external provisioning.
Hooks (addons)
Create an addon in modules/addons/youraddon/ with hooks.php. Use HookManager::addAction('slack_invoice_created', $callback) to run code when invoices are created. Hooks run inside WHMDC; use for custom logic, logging, or calling external APIs. See the Hooks Reference for all available hooks.
Example: Sync new invoices to CRM
HookManager::addAction('slack_invoice_created', function($data) {
// $data contains invoice info – adapt for your CRM
$payload = json_encode(['invoice_id' => $data['invoice_id'] ?? null, 'client_id' => $data['client_id'] ?? null]);
file_get_contents('https://crm.example.com/api/invoices', false, stream_context_create([
'http' => ['method' => 'POST', 'header' => 'Content-Type: application/json', 'content' => $payload]
]));
}, 10);
See the Hooks Reference for the full list of hooks, including slack_invoice_created, slack_order_created, admin_domain_manage_sections, client_domain_manage_sections, admin_footer, client_service_view_content, and many more.
Was this helpful?