Billing Overview
CMP billing has three layers that work together:
Rate Card (what it costs) → Billing Cycle (how often) → Payment Mode (how customer pays)
↑ ↑
Billing Rules (policies that adjust or enforce charges)
| Layer | Question it answers | Documentation |
|---|---|---|
| Billing Settings (admin) | See generate_prepaid_reciept, enabled payment modes, billing rules | Billing Settings |
| One Account One Invoice | Consolidated monthly invoice for postpaid/manual (enable_one_account_one_invoice) | OAOI |
| Customer Billing Dashboard | End-customer Billing UI, Account Statement, Usage Details | Customer Billing Dashboard |
| Rate cards | What packages exist and what do they cost? | Rate Cards |
| Billing cycles | Hourly through tri-annually? | Billing Cycles |
| Payment modes | Prepaid, postpaid, or manual payment? | Payment Modes |
| Billing rules | How charges are calculated (pro-rata, etc.)? | Billing Rules |
| Invoice Settings | Branches, invoice branding, tax, invoice numbers, terms | Invoice Settings |
| Payment gateways | Which provider collects payments? | Payment Gateways |
| Stoppable services | Do compute charges pause when a VM/K8s is stopped? | Stoppable Services |
| Low infra credit notifications | Prepaid wallet below threshold alerts? | Low Infra Credit Notifications |
| Free trials | Offer VMs / volumes / licenses at no cost for a limited period? | Free Trials |
| Auto Pay | Prepaid auto top-up from saved payment method? | Auto Pay |
| Disciplinary actions | Freeze, suspend, terminate for overdue / negative balance | Disciplinary Actions |
- Create rate cards and configure all package prices with billing cycles
- Set global rules — bandwidth threshold, backup billing, and other settings in Billing Rules (note:
plan_ip_billingis deprecated; charge IPs separately — see IP Address packages) - Configure Payment Mode Settings with StackConsole — decide which modes are available per account type before go-live — see Payment Mode Settings
- Configure payment gateways and currency top-up amounts in Settings → Billing Setup
- Onboard test customer → provision VM hourly and monthly → verify wallet or invoice behaviour
- Review Billing FAQs for common customer questions
The Four Core Billing Dimensions
To quickly understand how CMP calculates and collects charges without getting lost in technical settings, think of billing as four independent dimensions working together:
| Dimension | Core question | What it controls | Examples |
|---|---|---|---|
| 1. Billing Cycle | "For what duration?" | The length of the billable period | Hourly (PAYG), Monthly, Quarterly, Yearly, Multi-Year |
| 2. Billing Mode | "When do we charge?" | Charging in advance vs. in arrears | Prepaid (before service) vs. Postpaid (after service) |
| 3. Collection Trigger | "How is payment collected?" | Mechanism that executes the charge | Wallet deduction, automated card charge, Manual, Threshold |
| 4. Billing Rule | "How is amount calculated?" | Calendar alignment and partial-period math | PRO_RATA, DATE_TO_DATE, CALENDAR_MONTH |
A billing cycle is NOT locked to a single payment mode. While Yearly cycles are commonly paired with Prepaid (to collect the full period upfront), CMP supports both Prepaid and Postpaid across billing cycles.
- Billing Mode controls when the customer is charged (timing).
- Billing Rule controls how the date boundaries and prorations are calculated.
- Changing the payment mode does not alter the base catalogue price from the Rate Card.
1. Billing Cycle (The Service Period)
Defines the duration for which pricing is quoted and calculated:
- Hourly (Pay as you go): Charged strictly for the actual hours a service runs.
- Monthly: Standard fixed recurring monthly commitment.
- Quarterly / Yearly / Multi-Year: Extended commitments (3, 6, 12, 24, or 36 months).
2. Billing Mode (Advance vs. Arrears)
Defines when the customer's financial obligation is realized:
- Prepaid: Charged at the beginning of the period. For Monthly, the month is paid upfront. For Yearly, the full annual charge is collected before usage begins.
- Postpaid: Invoiced after the consumption period has completed (or at scheduled billing intervals).
3. Collection Method / Trigger (How Payment Occurs)
Determines how the payable amount is collected or what event triggers invoicing:
- Prepaid Wallet (Infra Credits): Balance deducted in real time (for hourly) or at cycle renewal.
- Postpaid Card Auto-Charge: Automated charge against a saved credit card (e.g., Stripe) at invoice generation.
- Manual Payment: Offline settlement (bank wire, check, PO). Admin verifies receipt and manually marks invoices as paid.
- Threshold Invoicing: Triggers an interim invoice automatically as soon as accrued unbilled usage hits a defined spending cap (e.g., $500), rather than waiting for period-end.
4. Billing Rule (Calculation & Alignment)
Determines how the billing engine calculates charges when a service starts mid-period or follows specific date boundaries:
PRO_RATA: Calculates exact daily usage for the partial start month, aligning all subsequent renewals to calendar boundaries (1st of the month).DATE_TO_DATE: Follows the customer's exact creation date anniversary (e.g., 15 Jan → 14 Feb). Required for Service Contracts.CALENDAR_MONTH: Strictly aligns billing windows to full calendar months.
How the Dimensions Work Together (Examples)
Because these four dimensions are decoupled, providers can configure flexible combinations to meet diverse customer needs:
| Billing Cycle | Billing Mode | Billing Rule | Real-World Workflow |
|---|---|---|---|
| Monthly | Prepaid | PRO_RATA | Customer pays remaining days of first month upfront, then full monthly price on the 1st. |
| Monthly | Postpaid | PRO_RATA | Customer uses VM throughout the month; billed on the 1st of the following month for actual usage. |
| Monthly | Postpaid | DATE_TO_DATE | Customer is invoiced on each monthly anniversary of their creation date (e.g., 18th to 17th). |
| Yearly | Prepaid | DATE_TO_DATE | Upfront annual plan: full 12-month rate card price deducted from wallet/card at deployment. |
| Yearly | Postpaid | DATE_TO_DATE | Postpaid annual plan: customer invoiced after the 12-month period (or tracked via threshold caps). |
| Yearly | Postpaid / Prepaid | DATE_TO_DATE (Contract) | Service Contract: 12-month commitment lock-in, but billed in predictable monthly installments (Yearly ÷ 12 minus discount) rather than charging the entire year upfront. |
Under standard billing, a Yearly cycle on Postpaid would mean waiting up to 12 months for payment. Enabling Service Contracts solves this: it secures a binding 12-month legal commitment with deletion blocks and renewal deadlines, while billing the customer in manageable monthly installments.
Billing Cycle + Billing Mode + Collection/Trigger + Billing Rule → Billing Outcome
Key Takeaway: The Rate Card sets the base service price, while the four independent dimensions determine how, when, and over what period that price is calculated, triggered, and collected.
Payment modes (summary)
| Mode | Payment model |
|---|---|
| Prepaid | Customer tops up wallet; usage deducted in real time. Low infra credit notifications alert when balance falls below a threshold. |
| Postpaid | Usage tracked; invoiced at cycle end; card can auto-charge |
| Manual | Customer pays offline; admin verifies and marks invoices paid |
See Payment Modes.
Billing cycles (summary)
| Cycle | Duration | Invoice timing |
|---|---|---|
| Hourly | Per hour | End of month (consolidated) |
| Monthly | 1 month | On service creation |
| Quarterly | 3 months | On service creation |
| Semi-annually | 6 months | On service creation |
| Annually | 12 months | On service creation |
| Bi-annually | 24 months | On service creation |
| Tri-annually | 36 months | On service creation |
Always hourly: VM_SNAPSHOT, BS_SNAPSHOT, BACKUP, BS_BACKUP, BANDWIDTH, ACCOUNT_TEMPLATE, ISO
See Billing Cycles.
Key billing rules (summary)
| Rule | Setting |
|---|---|
| IP charged separately from VM (recommended) | Default / deprecated plan_ip_billing = true — bill via IP Address packages; do not rely on bundling IPs into the VM package |
| Free bandwidth allowance | Cloud Provider Setup → Free Bandwidth Threshold |
| Custom package minimum price | Unit pricing ≥ predefined package |
| Coupon discount duration | First billing cycle only |
| Tax exempt (testing) | Customer → Billing Setup → Is Tax Exempted? |
See Billing Rules.
Pricing formulas
CMP derives hourly and yearly prices from monthly using 30.5 × 24 = 732 hours per month.
See Pricing Formulas.
Failed Transactions & Retry Policies (Prepaid vs. Postpaid)
A common operational question from providers and customers is:
"Does CMP retry a failed or timed-out transaction (such as a payment or
balance_modifycall)? If yes, with what policy — count, backoff, maximum window?"
The answer depends directly on the Payment Mode and whether the operation is user-initiated or system-automated:
1. Prepaid Accounts (Wallet)
- Customer-Initiated Wallet Top-Ups: In standard Prepaid mode, customers manually add funds to their wallet (Infra Credits) using a payment gateway. Because this is an interactive session, any failure (card decline, 3DS authentication failure, bank timeout) is communicated immediately to the customer on screen. CMP does not execute automated background retries for failed customer top-up transactions.
2. Postpaid Accounts (Saved Card Auto-Charge Retries)
In Postpaid mode, CMP generates payable invoices for consumed usage and automatically attempts to charge the customer's saved payment method (credit/debit card). If the payment fails for any reason (e.g. invalid card, expired card, insufficient balance, gateway decline):
| Policy Parameter | Value / Behaviour | Where Configured |
|---|---|---|
| Retry Schedule | Retried once per day (24-hour interval via automated daily billing cron) | Platform default cron |
| Maximum Retry Attempts | Configured by platform setting invoice_no_of_attempts (e.g. 3 attempts) | Settings → Billing Setup → Billing Settings |
| Backoff Strategy | Fixed daily retry (no exponential backoff; runs once every 24 hours) | System billing scheduler |
| Failure / Frozen State | When all attempts fail, the invoice becomes Frozen; auto-charge stops, and notification emails are sent | Email templates: FrozenInvoiceCustomerNotification, FrozenInvoiceAdminNotification |
| Resolution | Admin manually unfreezes the invoice after verification, or customer logs in and pays manually | Handling Frozen Invoices |
For complete workflow details, see Postpaid Auto-Charge Failure Workflow and Disciplinary Actions.
Documentation in this section
- Billing Settings (admin) — Invoices → Billing Settings; prepaid receipt flag, modes, rules
- One Account One Invoice (OAOI) — consolidated monthly invoice for postpaid/manual
- Customer Billing Dashboard — end-customer Billing tabs
- Account Statement
- Usage Details — prepaid Model 1 vs Model 2 vs postpaid/manual
- Stoppable Services —
enable_stoppable_service_billing(compute pause vs storage continues) - Free Trials — global + package settings, expiry, reminders, deletion, examples
- Disciplinary Actions — freeze, suspend, terminate
- Payment Modes — overview and comparison of all three modes
- Billing Cycles — hourly through tri-annually
- Billing Rules — calculation rules and platform policies
- Service Contracts — term commitments, monthly installments, cancellation deadline
- Payment Gateways — Stripe, AsiaPay, HyperPay, Authorize.net, M-Pesa, PayPal, Razorpay, Mollie, Dinger, Cardlink, Paytm, Payduniya, SSLCommerz
- New Payment Gateway Requirements — checklist when requesting a new integration (prepaid vs postpaid)
- Stripe
- AsiaPay
- HyperPay
- Authorize.net
- M-Pesa
- PayPal
- Razorpay
- Mollie
- Dinger
- Cardlink
- Paytm
- Payduniya
- SSLCommerz