Custom WHMCS hooks development means writing small PHP functions that WHMCS runs at a named event, such as an invoice being paid, a cart reaching checkout or a client area page loading, so your own business rules apply without editing WHMCS itself. It is for providers who need one rule or a handful of them enforced, not a whole new module, and fixed quotes run from $100 to $500. This page covers logic that runs inside your install. If you want WHMCS to tell Slack, Discord or Zapier that something happened, see WHMCS webhook integration; if an outside system needs to read or change WHMCS data, see WHMCS API integration.
Rules a hook can enforce
WHMCS lists its hook points in the Hook Index on developers.whmcs.com, grouped into invoices, shopping cart, modules, clients, tickets, client area output, cron and more. These are the requests we see most:
- Checkout rules. ShoppingCartValidateCheckout runs before the order and invoice exist, so it can stop an order with a clear error: one free trial per customer, a phone number required for VPS plans, or no new orders from a client group on hold.
- Price changes at checkout. CartTotalAdjustment adds a fee or discount line to the cart total, for example a setup fee that only applies to monthly billing.
- Suspension exceptions. PreModuleSuspend can abort a suspension, which is how partners or a VIP client group stay online while an overdue invoice is chased by hand.
- Steps after provisioning. AfterModuleCreate runs extra work once an account exists, and AfterModuleCreateFailed can open a ticket so a failed setup does not sit unnoticed.
- Payment follow-up. InvoicePaid can flag an account, apply credit or notify an internal tool.
- Email control. EmailPreSend can add merge fields, attach a file or stop a specific template from going out.
- Client area changes. ClientAreaPrimaryNavbar and ClientAreaHomepagePanels add, hide or reorder menu items and homepage panels without touching the theme.
- Scheduled checks. DailyCronJob runs with the daily cron, which suits housekeeping such as listing services that have had no payment in 60 days.
How the code is written
- One clearly named file per rule in /includes/hooks/, or a hooks.php inside an addon module when the rule belongs to that addon
- Function names prefixed with your company name, as WHMCS recommends, so they cannot collide with another vendor's hooks
- An explicit priority on every add_hook call, because the priority decides the order when several hooks share one hook point
- Early exits when the event does not concern the rule, so ordinary page loads stay fast
- Database reads through WHMCS's Capsule layer, and changes through localAPI wherever an API action exists
- A logActivity line each time the rule acts, so staff can see in the activity log why an order was blocked or a suspension skipped
- No edits to WHMCS core files or to encoded modules
Every hook can be switched off without deleting it: WHMCS skips any hook file whose name starts with an underscore. The README we hand over says which file to rename.
WHMCS versions
We write and test on the version you run: WHMCS 8.13 on PHP 8.1 or newer, or 9.x on PHP 8.2 or newer. On 9.x, published invoices are immutable by default and adjustments are recorded as credit and debit notes, so a hook that rewrites an issued invoice needs a different approach there. If you plan to leave 8.13, our WHMCS 9 upgrade service includes a review of existing hooks. Old hooks that already fail after a PHP change are handled under legacy module rescue.
What we need from you
- The rule in plain words, with one real example of when it should fire and one when it should not
- WHMCS admin access and file access by SFTP or cPanel File Manager, ideally on a staging copy
- A list of the hooks and addons already installed, so we can check for conflicts at the same hook point
What you receive
The hook files, a README for each rule (hook point, priority, what it changes, how to turn it off) and a short log of the scenarios we ran on staging before going live. Most single-rule jobs are ready for review within a few business days of approval, and the quote commits to a date. If a rule misbehaves within 14 days of delivery, the fix is free.
Pricing
| Scope | Fixed price |
|---|---|
| One rule at one hook point, such as a checkout check or a menu change | From $100 |
| A rule with conditions by product, client group or billing cycle, plus activity logging | Priced inside the $100 to $500 band |
| Several hooks that work together, for example a checkout rule, a post-provisioning step and a daily cron check | Up to $500 |
| A running list of small changes | $65/hour, or 10 hours a week for $650 |
Half is paid when you approve the quote and half on delivery, by card through Stripe, PayPal or crypto via NOWPayments.
Not part of this service
- Provisioning, registrar or gateway modules, which fall under module development
- Theme or order form redesigns
- Changing behavior inside third-party encoded modules
- Server, PHP or cron configuration
Write the rule down in a sentence or two and we will reply with the hook point we would use and a fixed price.