Skip to main content

Bill8:Billing — Business Requirements & Functionality

Audience: product owners, business analysts, and anyone evaluating what Bill8:Billing does for the business. For architecture read README.md; for wire-level detail read DESIGN.md.

1. Business Purpose​

Bill8:Billing is the recurring revenue engine. It delivers:

  • Subscriptions — a customer subscribes to a price and is billed per cycle.
  • Metered usage — usage records aggregate deterministically onto invoices.
  • Correct proration — a plan change prorates to the cent.
  • Discounts and credits — coupons and prepaid credits adjust the amount owed.

2. Business Scope (What the Service Provides)​

#CapabilityWhat the business gets
1ProductsCatalog of sellable things
2PricesRecurring or one-off price points
3SubscriptionsCustomer plan instances
4Subscription itemsQuantified lines
5InvoicesGenerated bills
6Invoice itemsLine items on invoices
7Usage recordsMetered consumption
8CouponsDiscounts
9CreditsPrepaid value
10Credit notesInvoice-level corrections
11Trials & anchorsFree periods and cycle alignment (calendar-month or custom anchor)
12Pause & resumeVoluntary billing pause with correct proration on resume
13DunningScheduled retries + notifications for past-due invoices, with deterministic cancellation or recovery
14Pricing modelsFlat, tiered, volume, and packaged usage pricing
15PreviewsUpcoming-invoice and plan-change quotes with zero commitment
16TaxExplicit tax lines per jurisdiction, inclusive or exclusive
17Invoice documentsPDF invoices and email delivery

What the service does NOT own (business boundary):

Out of scopeOwned by
Money movementBill8:Ledger
Charge executionBill8:Payments
Workflow orchestrationSentin8:Flow
SchedulingSentin8:Cron

3. Business Capabilities​

CapabilityBusiness rule
SubscribeA customer subscribes to a price
Offer a trialA subscription can start with a free period that converts exactly once
Change planA plan change prorates against the remaining cycle
Align billingCycles align to the calendar month or a custom anchor date
Pause billingA paused subscription generates no invoices and resumes with correct proration
Meter usageUsage records aggregate onto the next invoice per the price's model
Recover failed paymentsA past-due invoice retries on a configurable schedule with notifications, then cancels or recovers deterministically
Quote before committingUpcoming-invoice and plan-change previews match the real outcome exactly, with no writes
Correct an invoiceA credit note adjusts a paid invoice within its paid amount
Charge taxInvoices carry explicit, cent-exact tax lines per jurisdiction
Send invoicesA finalized invoice renders to PDF and delivers by email with retry
Apply discountA coupon/credit reduces the invoice amount

4. Business Events (Outbound)​

EventFires when
product:created/updatedProduct changes
price:created/updatedPrice changes
subscription:created/updated/canceled/paused/resumedSubscription lifecycle changes
subscription:trial_endedA trial converts
invoice:created/paid/voided/retryingInvoice lifecycle changes
invoice:emailedAn invoice is emailed
usage_record:createdA usage event is metered
coupon:created/updated / credit:created/updated / credit_note:issued/voidedDiscount/adjustment changes
tax_rate:created/updatedTax configuration changes

5. Business Rules & Invariants​

  1. Invoices are immutable once finalized.
  2. Proration nets to the cent (half-up).
  3. Subscription items sum to the billed amount.

6. Target-User Roles & Use Cases​

PersonaDoes
MerchantDefine products/prices, manage subscriptions
CustomerView invoices, manage subscription

7. KPIs / Success Criteria​

KPIMeasure
Invoice accuracyproration + metering reconcile to the cent
Billing successinvoices paid / opened

8. Dependencies & Reliance on Other Services​

RelianceOn
Charge executionBill8:Payments
Money movementBill8:Ledger
OrchestrationSentin8:Flow
SchedulingSentin8:Cron

9. Acceptance Criteria​

  1. A subscription generates invoices with correct proration and metered usage.
  2. A coupon/credit correctly reduces the invoice amount.
  3. A failed invoice charge drives the subscription to past-due and recovers on the next run.

10. Open Business Questions​

  • See backlog.md BIL-*.

Design attribution: bill8:billing and its underlying concepts were designed by Hamid Jahanzad Hamid@Jahanzad.com.