Wise Agile
Engineering

Building Billing Systems for Utilities: A Technical Deep Dive

Tatiana Chiril15 December 20244 min read
FinTechBillingUtilitiesArchitecture

The Challenge of Utility Billing

Billing systems for utility companies — energy, water, gas, telecom — are among the most complex software challenges in FinTech. Unlike simple e-commerce invoicing, utility billing must handle:

  • Variable consumption data arriving from thousands of smart meters in real time
  • Complex tariff structures with time-of-use rates, seasonal pricing, and tiered thresholds
  • Multi-jurisdictional compliance across different regulatory frameworks
  • Bank integration for direct debits, SEPA transfers, and reconciliation

At Wise Agile, we've built billing platforms processing millions of monthly invoices for providers across 6 European countries. Here's what we've learned.

Architecture Principles

Event-Driven at the Core

The biggest mistake we see in legacy billing systems is batch processing. Modern utility billing needs to be event-driven. When a meter reading arrives, it should immediately trigger:

  1. Validation against historical patterns
  2. Tariff calculation based on the active contract
  3. Invoice generation (or accumulation for periodic billing)
  4. Ledger entry creation

We use RabbitMQ for message queuing and PostgreSQL with proper partitioning for the ledger. This architecture handles 50,000+ events per second on modest hardware.

The Calculation Engine

The heart of any billing system is the calculation engine. Ours supports:

  • Formula-based tariffs — define any pricing logic as composable rules
  • Multi-currency — real-time FX rates with configurable rounding
  • Retroactive adjustments — recalculate any period when tariffs or readings are corrected
  • Audit trail — every calculation step is logged and reproducible
interface TariffRule {
  id: string;
  name: string;
  effectiveFrom: Date;
  effectiveTo: Date | null;
  tiers: TariffTier[];
  currency: CurrencyCode;
}

interface TariffTier {
  minUnits: number;
  maxUnits: number | null;
  ratePerUnit: number;
  fixedCharge: number;
}typescript

Bank Integration

We integrate with banking systems via PSD2-compliant APIs for:

  • Direct debit mandate management
  • Real-time payment status webhooks
  • Automated reconciliation with fuzzy matching
  • SEPA Credit Transfer initiation

The reconciliation engine matches 97% of payments automatically. The remaining 3% are flagged for manual review with suggested matches.

Technology Choices

LayerTechnologyWhy
FrontendReact + Next.jsSSR for dashboards, fast iteration
APINode.js + GraphQLFlexible querying for complex billing data
DatabasePostgreSQLACID compliance, partitioning, JSON support
QueueRabbitMQReliable message delivery, dead-letter handling
CacheRedisSession management, rate limiting, temp calculations
InfrastructureDocker + K8sHorizontal scaling for peak billing periods

Lessons Learned

1. Design for Corrections from Day One

In utility billing, corrections are not edge cases — they're a core workflow. Meter readings get revised, tariffs are backdated, customers dispute charges. Your data model must support:

  • Immutable ledger entries (append-only)
  • Reversal transactions rather than updates
  • Point-in-time recalculation

2. Invest in Testing Infrastructure

Billing has a combinatorial explosion of scenarios. We maintain a test harness with 10,000+ generated scenarios covering:

  • Every tariff combination
  • Edge cases (leap years, DST transitions, zero consumption)
  • Regulatory-specific calculations per jurisdiction

3. Make Compliance a Feature, Not an Afterthought

GDPR, PCI-DSS, and local utility regulations should be baked into the architecture. We implement:

  • Data retention policies at the database level
  • Anonymisation pipelines for analytics
  • Complete audit logs with tamper-evident checksums

Results

Our billing platforms consistently deliver:

  • 95% reduction in billing errors vs. legacy systems
  • 3x faster invoice cycle times
  • 97% automatic payment reconciliation
  • 100% audit compliance across all jurisdictions

Next Steps

If you're building or modernising a billing system, get in touch — we'd love to share more detailed architecture patterns and discuss your specific requirements.


Tatiana Chiril is the Founder and Technical Leader at Wise Agile, specialising in FinTech and EnergyTech solutions. She is currently pursuing a PhD researching solar energy optimisation and rural development.

Let's Discuss Your Project

Whether it's billing, integration, or a full platform build — we'd love to hear about your challenge.