Platform Module

Billing & Finance Enterprise Billing Engine

A complete billing platform — subscriptions, invoicing, usage metering, payment processing, and automated revenue collection. Integrated with Stripe for secure payment handling.

Subscription Management

Full lifecycle control

Manage subscriptions from activation through cancellation. Monthly, quarterly, or annual billing frequencies with automatic plan changes, pausing, and dunning workflows.

Subscription States

Active

Billing in progress, services running

Paused

Temporarily halted — no invoices generated, services remain

Past Due

Payment failed repeatedly, entering dunning workflow

Cancelled

Terminated immediately or at period end

Expired

Natural end of subscription term

Monthly — standard recurring
Quarterly — every 3 months
Annual — yearly with auto discount
Create

Initializes first billing period, schedules next invoice

Pause

Halts billing, services remain accessible

Resume

Restarts from paused state, recalculates next billing date

Upgrade

Change to higher plan — price adjustment immediate or at renewal

Downgrade

Change to lower plan — takes effect at next billing period

Cancel

Immediate termination or scheduled at period end

Invoicing

Automated invoice lifecycle

From draft to paid — every invoice follows a deterministic lifecycle. Auto-generated numbers, itemized line items, tax calculations, discount application, and professional PDF export.

Each invoice includes subscription charges, usage charges, one-time fees, add-ons, percentage or fixed discounts, per-line-item tax rates with VAT/tax ID tracking, and full payment attempt history.

Auto-generated number — INV-202603-48271
Itemized line items with quantities and unit prices
Discount and tax breakdowns per line item
Payment timeline — issued, sent, due, paid, overdue
Professional PDF export with company branding
invoice lifecycle
Draft
Pending
Sent
Paid
Partially Paid
Overdue
Refunded
Voided
any state → voided · partial payments tracked
Payment Processing

Stripe-powered, PCI compliant

Payments processed securely through Stripe. Credit cards with 3D Secure, SEPA and ACH direct debit, automatic retries, and real-time webhook processing with idempotent 24-hour deduplication.

Payment Flow

1
Select MethodCustomer chooses payment method in portal
2
PaymentIntentStripe PaymentIntent created with invoice amount
3
3D SecureSCA challenge if required for strong authentication
4
ConfirmationPayment confirmed — invoice transitions to Paid
5
ReceiptReceipt delivered via notification service
6
ReconcilePartial payments tracked — remaining balance updated
Credit/Debit Cards

Visa, Mastercard, Amex with 3D Secure

SEPA Direct Debit

EU bank transfers with mandate management

ACH Direct Debit

US bank transfers with verification

Automatic Retry

Failed payments retried with configurable logic

Usage-Based Billing

Metering & rating engine

Real-time resource consumption tracking across all provisioned services. Usage records collected continuously and aggregated per billing period with batch recording for high-volume ingestion.

metered resources
CPUCore-hours
4 cores x 720 hours = 2,880 core-hours
MemoryGB-hours
16 GB x 720 hours = 11,520 GB-hours
StorageGB-months
500 GB for 30 days
BandwidthGB transferred
2.5 TB outbound traffic
API RequestsCall count
1.2 million API calls
CustomConfigurable
Any metric your service reports
Flat Rate

Fixed price per billing period, regardless of usage

€100/month for unlimited storage
Per-Unit

Simple per-unit charge with optional free tier

€0.10/GB storage, first 100 GB free
Tiered

Volume tiers with decreasing unit cost

0–100 GB: €1.00 · 100–500: €0.80 · 500+: €0.50
Volume

Total volume determines the per-unit rate

Up to 100 GB: €1.00/GB (all units)
Refunds & Credits

Safe, auditable refund processing

Full and partial refunds with cumulative over-refund prevention. Credit notes auto-generated and applicable to future invoices. Every refund coordinates with the Order Service saga for resource deprovisioning when needed.

1
Refund requested (customer or admin)
2
Validation — amount cannot exceed invoice total
3
Admin approval (manual or rule-based)
4
Stripe refund processed
5
Credit note automatically generated
6
billing.refund-completed event published

Customer Request

Standard refund initiated by customer

Duplicate Charge

Accidental double billing corrected

Service Issue

Product failure or outage compensation

Billing Error

Internal mistake corrected

Chargeback

Cardholder dispute via bank

Compensation

Goodwill credit for customer satisfaction

Recurring Automation

Always running, always idempotent

The billing scheduler runs continuously — generating invoices, processing cancellations, detecting past-due accounts, and cleaning up expired keys. Every cycle is idempotent. Safe to retry, never creates duplicates.

Invoice GenerationHourly

Find subscriptions due for billing, rate usage, create invoices

Cancellation ProcessingEvery 30 min

Execute scheduled end-of-period cancellations

Past-Due DetectionEvery 2 hours

Flag subscriptions with repeated payment failures

CleanupHourly

Purge expired idempotency keys

max 5 consecutive failures before circuit break · idempotent · no duplicate invoices
Analytics & Revenue

Real-time financial KPIs

MRR

Monthly Recurring Revenue — prorated from all active subscriptions

Revenue This Month

Sum of paid invoices in current calendar month

Outstanding Balance

Total unpaid invoices (pending + sent + overdue)

Payment Success Rate

Successful payment attempts / total attempts

Active Subscriptions

Count of currently active subscriptions

Overdue Count

Number of invoices past due date

MRR prorates by frequency: monthly at face value, quarterly / 3, annual / 12
Event-Driven Integration

Platform in sync, always

Billing events flow through Kafka to keep subscriptions, provisioning, notifications, and audit trails synchronized across the entire platform.

Billing Events9 topics
Notify
Billing
Audit
Provision
Portal
billing.invoice-generated
billing.payment-received
billing.subscription-created
billing.subscription-cancelled
billing.subscription-upgraded
billing.subscription-past-due
billing.refund-completed
billing.refund-failed
billing.usage-recorded
streaming
exactly-once deliverysaga coordinationtenant-scoped

Automate your billing

Subscriptions, invoicing, usage metering, payment processing — fully automated, fully auditable, Stripe-integrated.

FAQ

Common Questions

Subscriptions handle fixed recurring charges. Usage is metered separately and added as line items on the next invoice. Both coexist on a single invoice — the customer sees one clear bill with subscription charges and usage charges broken down.

Failed payments are retried automatically with configurable logic. After repeated failures, the subscription transitions to Past Due and enters the dunning workflow. Services remain active during dunning to give customers time to resolve payment issues.

Yes. Pricing rules have effective date ranges. When you change pricing, it applies only to future billing periods. Active subscriptions continue at their current rate until renewal, upgrade, or explicit price change.

Refunds are validated against invoice totals with cumulative over-refund prevention. Once approved, Stripe processes the refund, a credit note is generated, and a billing.refund-completed event coordinates with the Order Service saga for resource deprovisioning if needed.