# Custom WHMCS Hooks Development

> Small PHP hooks that make WHMCS follow your rules at checkout, provisioning, suspension, email and client area events.

Custom WHMCS hooks written to a plain-language rule: checkout checks, cart fees, suspension exceptions, provisioning follow-ups and email control. Fixed price, tested on staging.

- **Price:** $100 - $500
- **Billing:** One-time, fixed scope
- **Category:** Custom Development
- **Quote turnaround:** Fixed-price quote within 24 hours
- **Start a project:** https://whmcspilot.com/start-project
- **Details:** https://whmcspilot.com/services/whmcs-hooks-development
- **Last updated:** 2026-11-05

## Overview

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](/services/whmcs-webhook-setup); if an outside system needs to read or change WHMCS data, see [WHMCS API integration](/services/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](/services/whmcs-9-upgrade) includes a review of existing hooks. Old hooks that already fail after a PHP change are handled under [legacy module rescue](/services/whmcs-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

ScopeFixed priceOne rule at one hook point, such as a checkout check or a menu changeFrom $100A rule with conditions by product, client group or billing cycle, plus activity loggingPriced inside the $100 to $500 bandSeveral hooks that work together, for example a checkout rule, a post-provisioning step and a daily cron checkUp to $500A 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](/services/whmcs-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.

## What's included

- Business rules written as hooks in /includes/hooks/ or an addon's hooks.php
- Checkout validation with ShoppingCartValidateCheckout and clear error messages
- Cart fees and discounts through CartTotalAdjustment
- Provisioning follow-up on AfterModuleCreate and failure handling on AfterModuleCreateFailed
- Suspension exceptions for chosen clients through PreModuleSuspend
- Extra merge fields, attachments or blocked sends through EmailPreSend
- Client area menu and homepage panel changes without theme edits
- An activity log entry each time a rule acts
- A README per rule with hook point, priority and off switch
- Staging test log plus a 14-day correction window

## Business outcomes

- Billing and provisioning rules apply every time instead of depending on staff memory
- WHMCS updates leave the work in place, since core files stay untouched
- Staff can see in the activity log why WHMCS acted the way it did
- Any rule can be turned off in seconds by renaming one file
- Small behavior changes cost a small fixed price instead of a full module build

## Frequently asked questions

### What is a WHMCS hook?

A PHP function registered with add_hook that WHMCS runs when a specific event happens, such as InvoicePaid or ClientAdd. At some hook points it can also return values that change what WHMCS does next.

### Do I need a hook or a module?

A hook is enough when you are changing how WHMCS behaves around products it already handles. A module is needed when WHMCS must create, suspend and terminate accounts on a system it cannot talk to yet.

### Will my hooks survive WHMCS updates?

Files in /includes/hooks/ are not replaced by WHMCS updates, and we only use documented hook points. Major releases can change the variables a hook point passes, so retest after upgrading, especially when moving to 9.x.

### Can hooks slow WHMCS down?

Badly written ones can, particularly at hook points that run on every client area page. We exit early when a rule does not apply and move heavy work to cron hook points such as DailyCronJob.

### Can you fix hooks another developer wrote?

Yes. We read the existing files first, then quote the repair or tell you when a rewrite would cost less.

### Do custom hooks work on WHMCS Cloud?

This service is for self-hosted WHMCS. WHMCS's documentation marks several hook-based customizations as unsupported on WHMCS Cloud, so ask us before ordering if that is what you use.

### How is a hook job paid?

Small hook jobs are split 50/50: the first half confirms the booking and the second is due when the hook is live. Stripe (cards, Apple Pay, Google Pay), PayPal and NOWPayments crypto all work.
