Invoicing
rochen-api owns every Dedicated invoice. Nothing is charged in advance: compute, storage, IOPS, throughput and data transfer are metered per hour from the change log and billed at the end of each month. Sites on the pool and the included software never appear on an invoice. WHMCS skips pools and the sites under them in code, and rochen-api also owns overdue suspension.
Timeline
- Order · 3 Octno invoice: nothing is charged in advance. The gate is a stored card and no overdue invoices.
- Deployed · activation 3 Oct 10:00the
createchange is applied; billing starts here, not at launchusage accrues hourly from this point · every applied billable change starts a new span - Resize · 18 Oct 14:00new span at the new template rate; no invoice
- Disk grow · 25 Oct 09:00new span at the new allocation; no invoice
- Sites added, licences re-tieredlogged in the change log, never billed
- Monthly invoice · generated 1 Novall of October's usage for every pool the client owns, one invoice, due on the account's usual terms
billed_through→ 31 Oct · WHMCS skips pools and their sites in code - Every month aftereach run bills the complete calendar months since
billed_through - Terminationfinal invoice: usage from
billed_throughtoterminated_at, including the partial data-transfer month
Usage is billed by complete calendar months, as Fully Managed Services does today. A run on 1 Nov bills all of October; the days of November wait for the next run.
At order time
No invoice
Orders now invoice only what they buy up front (domains). A pool buys nothing up front, so no invoice is created and no due date moves. The pool's tblhosting.amount is 0.00 like every Rochen One service.
The gate instead
A stored card, no overdue invoices, and a small authorisation hold that is released at once and never appears on an invoice. Stripe's risk level on that hold decides: normal deploys, elevated or highest sends the order to staff review first (Deployment page).
Indian mandates
For INR clients the card mandate ceiling must cover the pool's monthly maximum, so the order adds the pool's estimate to the ceiling calculation and asks for a new mandate when the current one is too small, as Rochen One orders do.
Monthly invoice — dedicated:invoice-renewals
--report mode prints what it would invoice without writing, and the first production run is done in that modeactive, suspended or terminating whose billed_through is before the last complete calendar monthCreateInvoice::itemMarker() / itemsCreatedSince()). It never runs the full client sweep, which would pull every other renewal forwardbilled_through to the end of the last month billed; the pool's next due date is set to the next run for display onlyOverdue: dedicated:suspend-overdue
WHMCS no longer suspends pools, so rochen-api does. Daily, a pool with a Dedicated invoice unpaid 5 days past its due date is suspended: instance stopped, pool and every site under it marked Suspended, client mailed. When the invoices are paid the same command (and the capture path) unsuspends it and restores the sites the suspension took down. Usage accrues while suspended. Termination for long non-payment follows the business's overdue policy through the same termination job as a cancellation.
Usage from the change log
No separate billing table. Every applied change that affects price (create, resize_instance, resize_disk, resize_iops_throughput, terminate) is billable and stores the complete configuration in to. Its immutable applied_at is the boundary of a usage span. Licence re-tiers and site events are logged with billable = false and never start a span.
- Load the billable changesfor the pool, ordered by
applied_at, plus the last one before the month starts (carried forward so the month opens with a known configuration). - Cut spans at month edgesspan = max(applied_at, month start) → min(next applied_at, month end). Hours are the real elapsed time as a fraction, with an exclusive month end, as the MCS calculation does since October 2026; they are rounded only in the line description.
- Price each span from the pool's own sub-option pricescompute:
monthly ÷ 744 × hours· IOPS:(IOPS − 3000) ÷ 100 × monthly ÷ 744 × hours· throughput:(MiB/s − 125) ÷ 25 × monthly ÷ 744 × hours. - Price storage across the client's poolssee Storage tiers below; hours-prorated the same way.
- Add data transferfrom
dedicated_instances.data_transfer["YYYY-MM"]: the 500 GB allowance (msetupfee) plus(out − 500) × monthlyabove it. - Group into linesconsecutive spans with the same template merge into one line; the same for each storage allocation. Descriptions follow the Rochen One style.
Storage tiers
DiskSize [1-5], [6-20], [21-50], [51-100], [101-200], [201-*], in the client's currency), walked over the client's total dedicated allocation for that hour. With two pools of 200 GB and 300 GB, the first 200 GB fill the lower bands and the next 300 GB continue from where they left off; each pool's line shows its own GB at the rate it landed in.Shared-site storage keeps being billed by WHMCS on the R1 invoice. Rolling it into the same band as dedicated storage would need either WHMCS billing code or rochen-api reproducing WHMCS's bands, so v1 tiers dedicated storage on its own. This is flagged as an open point to confirm with Chris.
Worked example (London, example prices, USD)
One pool, activated 3 Oct 10:00 on r1d.m7i.large with 200 GB. Resized to r1d.m7i.xlarge on 18 Oct 14:00. Storage grown to 300 GB on 25 Oct 09:00. Twelve sites added during the month (free). Invoice generated 1 Nov.
| Span | From → to | Hours | Template | Storage | Compute | Storage |
|---|---|---|---|---|---|---|
| 1 | 03 Oct 10:00 → 18 Oct 14:00 | 364 | m7i.large · 86.35/mo | 200 GB · 23.60/mo | 42.25 | 11.55 |
| 2 | 18 Oct 14:00 → 25 Oct 09:00 | 163 | m7i.xlarge · 161.95/mo | 200 GB · 23.60/mo | 35.48 | 5.17 |
| 3 | 25 Oct 09:00 → 01 Nov 00:00 | 159 | m7i.xlarge · 161.95/mo | 300 GB · 31.60/mo | 34.61 | 6.75 |
| Invoice generated 1 Nov | Type | Amount |
|---|---|---|
| Rochen One Dedicated – r1d.m7i.large – srv1.directrouter.com (03/10 – 18/10, 364 Hours) | Hosting · compute | 42.25 |
| Rochen One Dedicated – r1d.m7i.xlarge – srv1.directrouter.com (18/10 – 01/11, 322 Hours) | Hosting · compute | 70.09 |
| 200GB SSD (Storage) – srv1.directrouter.com (03/10 – 25/10, 527 Hours) | Hosting · storage | 16.72 |
| 300GB SSD (Storage) – srv1.directrouter.com (25/10 – 01/11, 159 Hours) | Hosting · storage | 6.75 |
| Data Transfer – 320GB of 500GB allowance – October 2026 | Hosting · transfer | 64.80 |
| Subtotal before tax | 200.61 |
Hours in October from 3 Oct 10:00 add up to 686, matching the three spans. Compute: 79.95 × 1.08 region factor. Storage bands (example): 0.20 / 0.16 / 0.14 / 0.12 / 0.10 / 0.08 per GB per month, so 200 GB = 23.60 and 300 GB = 31.60. No lines for the twelve sites, cPanel Pro, Imunify360 30 users or LiteSpeed Web Host Essential: all included.
Line rules
Compute
One Hosting-type line per template run per month, hours-prorated from the region's Templates price.
Storage
One line per allocation per month at the band rate it landed in across the client's pools.
Extras
IOPS and throughput only when above the gp3 baseline; data transfer as the allowance plus overage from Cost Explorer via dedicated:log-data-transfer (daily 01:30; a new account reports roughly a day late).
Never
Sites, software licences, management, DNS, backups, monitoring: all included in the compute rate.
Costs card in the app
Dedicated::costs() runs the same maths over the current month for "spend so far" and "estimated end of month", per pool and for the account.
Currency
Prices resolve from the pool's stored sub-option ids and the R1 storage sub-options in the client's currency. A currency with the −1 sentinel is refused at order.
Resizes, suspension
| Event | Effect on billing |
|---|---|
| Template change | the applied change opens a new span at the new compute rate |
| Storage grow | new span at the new allocation; allocations never shrink |
| IOPS / throughput change | new span; only the amount above baseline is charged |
| Site added or removed, licence re-tiered | none |
| Suspension (overdue) or client stop | usage keeps accruing: the instance and volumes stay reserved. The app states this next to Stop. |
Final invoice at termination
The termination job's last step marks the terminate change applied (the end of the timeline) and runs the same routine for billed_through → terminated_at, including the partial data-transfer month, then sets the pool and its site rows Terminated. If nothing is owed, no invoice is created.
Keeping WHMCS out
Advancing due dates is not enough: WHMCS would write a zero-value line and auto-pay it, mail an upcoming-invoice reminder, suspend from unpaid invoice items and advance dates again on payment. So WHMCS skips pools and their sites in code. The full list of edits is on the Maintenance page.
Invoice run and reminders
Product 464 is skipped beside the existing skip for Rochen One Sites, in the invoice run and in the upcoming-invoice reminder. Pool sites are product 466, so they are already skipped.
Payment processing
When a Dedicated invoice is paid, WHMCS's per-service payment step does nothing for a pool: no date advance, no unsuspend, no renew. rochen-api reacts to the payment itself.
Suspension and termination
The suspension cron, the termination queries and the overdue-termination list exclude pools and pool sites. rochen-api's own commands take their place.
Legacy aws checks
The daily "active service without a tracking row" mail excludes pools, which by design have no rows in the legacy aws table. The legacy arrears routine finds nothing to add.
Shared billing untouched
Pool sites have a pool as parent and no billing-log rows, so the Shared plan's arrears routine never counts them. The one module's admin hooks are guarded so they cannot write log rows for a pool site.
Detection
The monthly command alerts if any invoice item for a pool or pool site was created by something other than itself.