WHMCS hourly billing is not built in. The shortest recurring billing cycle is monthly, Usage Billing collects module metrics twice a day and bills them on the next renewal invoice, and billable items are hours that someone enters. For cloud-style hourly VPS billing from a prepaid balance, you need a commercial module or a custom hourly billing module.
I have built hourly billing for many WHMCS products, mostly cloud VPS plans and other services sold by the hour. I checked every WHMCS fact below against the official documentation on 16 October 2026. To hand the job over, see my 7-day scope near the end.
Does WHMCS support hourly billing natively?
No. WHMCS has no hourly billing cycle, and nothing built in measures server hours against a prepaid balance. The cycles in the pricing array of the AddProduct API run from monthly to triennially. Four features come close.
| Built-in feature | What it does | Why it is not hourly billing |
|---|---|---|
| Billing cycles | A fixed price per cycle, monthly to triennially. | Nothing shorter than a month. |
| Usage Billing (Metric Billing on the Module Settings tab) | A module reports metrics, priced per unit, by total volume or graduated. The cPanel, DirectAdmin and Plesk modules report metrics already. | The TenantUsageMetrics cron task updates usage twice a day, metric types are snapshot, daily or monthly, and the charge lands on the next renewal invoice. It never stops a server when money runs out. |
| Billable items and time billing | Line items such as 3 hours at $50, added by staff or with AddBillableItem. | Built for project time. Nothing measures the hours. |
| Credit balance | Clients add funds, and Automatic Credit Use pays new invoices from the balance. | Nothing deducts credit by the hour, and adding funds does not pay existing invoices. |
The Usage Billing page recommends monthly cycles for metered products, because usage is captured on the Next Due Date. The billable items page presents time billing as staff time on client projects. The one official exception I found is the SolusIO addon, which bills virtual machine uptime at an hourly token rate on post-pay invoices, for SolusIO only.
What are the options for hourly billing in WHMCS?
There are five; the choice turns on whether customers pay before or after use.
| Option | Customer pays | Stops at zero? | Fits when | Main drawback |
|---|---|---|---|---|
| Usage Billing with a custom metric provider | After use, on the monthly renewal invoice | No | Trusted customers, and you write a server module anyway | Data refreshes twice a day |
| Prepaid credit with hourly deduction | Tops up first, then each hour is charged | Yes | Public cloud VPS sign-ups | Custom balance checks, alerts and suspension |
| Monthly postpaid with hourly usage lines | After use, hours x rate on one monthly invoice | Only through overdue suspension | Business customers with a saved card | A month of credit risk |
| Commercial module from the WHMCS Marketplace | Whatever it supports | Check the module | Your platform and pricing match it | License fee, encoded code, its release schedule gates your upgrades |
| Custom module | Any of the above | Your rule | Nothing you can buy fits | Upfront cost, and you own the upkeep |
Before you buy, ask the vendor which WHMCS and PHP versions it supports, whether it suspends at zero within the hour or at the daily cron, and what the meter does when a customer cancels. A WHMCS Community thread raised that last point: a cancellation that waits for the daily cron keeps charging.
How does a custom WHMCS hourly billing module work?
It is a server module that drives the platform, plus a usage table and a cron hook that charges each hour once. My VPS provisioning guide covers the platform side. Billing adds a job to each module function:
CreateAccountbuilds the server and opens the meter.SuspendAccountandUnsuspendAccountpower it off and on. Decide in writing whether a stopped server still pays for disk and IP.TerminateAccountcloses the last hour and destroys the server.ChangePackageruns when an upgrade or downgrade is paid, for products and configurable options. It closes the open hour and starts the new rate.MetricProvider, optional, reports hours to Usage Billing so clients see them on the service page, as the usage metrics docs describe.
The meter is a module table such as mod_hourly_usage: one row per service per hour, with the hour start in UTC, rate, amount and invoice ID. A unique key on service ID plus hour start makes double billing impossible.
Charging runs from an AfterCronJob hook. The cron hooks reference says it runs each time the system cron is called, after all scheduled tasks finish, and WHMCS recommends calling the cron every five minutes, so the hook must stay cheap. My hooks guide and cron guide cover setup. An outline, not production code:
add_hook('AfterCronJob', 1, function () {
if (!hourlybill_lock()) {
return; // an earlier cron run is still billing
}
foreach (hourlybill_services_with_a_finished_hour() as $svc) {
if (!hourlybill_record_hour($svc)) {
continue; // unique key hit: hour already charged
}
$hoursLeft = hourlybill_balance($svc->userid) / $svc->rate;
if ($hoursLeft <= 0) {
localAPI('ModuleSuspend', ['serviceid' => $svc->id, 'suspendreason' => 'Credit used up']);
} elseif ($hoursLeft <= 24) {
hourlybill_low_balance_notice($svc, $hoursLeft);
}
logActivity("hourlybill: service {$svc->id} charged {$svc->rate}");
}
hourlybill_release_lock();
});
- Rounding. Charge each started hour or per minute; pick one and print it on the order page.
- Rates. The pricing grid has no hourly column, so the module stores a rate per product and per configurable option value.
- Time zones. Store UTC. WHMCS needs the web and cron PHP timezones to match, per System Timezone Issues.
How are the hours charged to the customer?
Through invoices, not by quietly removing credit, so each charge carries tax and shows on the client's invoices. The calls go through localAPI(), explained in my WHMCS API guide.
- Prepaid. Available balance is the
creditfield fromGetClientsDetailsminus unbilled usage. Daily, or past a set amount, the module callsCreateInvoicewithautoapplycredit, or pays it withApplyCredit.AddCreditwithtypeset toremoveexists, but carries no tax line. - Postpaid.
AddBillableItemwithunitset tohoursandinvoiceactionset tonextinvoice. Itsamountis the line total, not the rate. - Low balance.
SendEmailwith a custom product email at runway thresholds you choose, for example 24 and 4 hours, once each. - Zero.
ModuleSuspend. WHMCS unsuspends after an overdue invoice is paid, and an empty balance has none, so the module callsModuleUnsuspendwhen a top-up lands. - Cancellation. The System Cron page lists the CancellationRequests task as daily. The
CancellationRequesthook fires when the client asks, so the meter stops then. - Mid-hour upgrades. My default is to charge the started hour at the higher rate and switch at the next boundary; the rule is configurable and stated on the order page.
- Product price. Payment type Free stops WHMCS invoicing, but the Products page says it also removes the Next Due Date and blocks Client Area cancellation requests, so the module needs its own destroy button.
What breaks in WHMCS hourly billing?
Mostly money, and each failure has a known fix.
| Problem | What happens | Prevention |
|---|---|---|
| Cron overlap | Two runs charge the same hour. | A database lock plus the unique key. |
| Clock drift | Hours are skipped or repeated. | NTP, UTC, and hours counted from stored timestamps. |
| Failed platform API call | Suspension fails, the server runs on, the balance goes negative. | The Module Queue page says WHMCS will not retry failed actions itself, so the module retries, logs with logModuleCall() and alerts staff. |
| Refunds and disputes | A top-up is charged back after the hours were used. | Suspend on dispute, keep usage rows as evidence, refund only unused credit. |
| Tax on usage | Credit removals escape VAT or GST. | Taxed invoice lines (itemtaxedx in CreateInvoice). |
| No saved payment method | A postpaid month ends unpaid. | A saved card for postpaid, or prepaid only. |
| First top-up blocked | With Require Active Order on, new clients cannot add funds before an approved order. | Make the first top-up part of the first order. The Credit settings page warns that turning it off may raise fraud and chargeback risk. |
| Abuse | Stolen cards fund crypto mining for a few hours, then the payment is disputed. | Fraud checks on first orders, a minimum deposit, CPU alerts and an acceptable use policy. |
How do you test hourly billing before going live?
On a staging copy of WHMCS, with a test node and a gateway in test mode:
- Run a server for 61 minutes, then terminate. The charge matches your rounding rule.
- Start
cron.phptwice at once. One usage row per hour remains. - Drain a balance. Each warning arrives once, the server stops, and a top-up restarts it.
- Block the platform API. The failed suspension is logged, retried and reported.
- Upgrade and downgrade mid-hour, then read the invoice lines.
- Request cancellation. The meter stops at the request.
- Invoice a taxed and a tax-exempt client.
- Refund a top-up and dispute a test payment.
- Reconcile a month of usage rows with invoices, to the cent.
Can a custom hourly billing module be ready in 7 days?
Yes, for a standard scope. Hire me, and a custom WHMCS hourly billing module is ready in 7 calendar days, counted from the day the written scope is signed and the platform API and staging access are ready. The speed comes from having solved these problems before. The standard scope covers:
- One provisioning platform API.
- One billing model: prepaid credit with hourly deduction, or monthly postpaid with hourly usage lines.
- Hourly usage records with the double-billing protection above.
- Low-balance emails, automatic suspension at zero and unsuspension after a top-up.
- An admin usage report and a client-area usage view.
- Testing on a staging copy of WHMCS before going live.
- Two weeks of support after delivery.
Several platforms, tiered or spot pricing, and migrating balances from another system go into a phase 2 with its own date. Missing access or late answers move the date. The price is a fixed quote, or $55 to $65 per hour. See WHMCS custom module development, hire a WHMCS developer, or start a project with your platform and pricing rules.
When is hourly billing the wrong choice?
When customers rarely start and stop resources, it adds work without adding revenue.
- Shared hosting. Nobody runs a website for six hours. Monthly and yearly cycles already work.
- A small customer base. A few dozen VPS customers on stable plans earn the same on monthly pricing, and the module pays back slowly.
- Support load. Hourly charges create tickets about amounts, stopped servers and vanished credit. A one-person desk should start with one hourly product.
Last reviewed 16 October 2026. Disclosure: I sell WHMCS custom module development, including the hourly billing module described above, so I am not neutral. I founded WHMCSPilot, which sells premium WHMCS modules and themes, and I am CTO at ElySpace, a hosting company. I am not affiliated with WHMCS.