Billing Event Processor
Service that processes billing events related to subscriptions, payments, and usage-based billing
Service
Overview
The Billing Event Processor service handles asynchronous processing of billing events. It processes subscription events, payment events, and usage-based billing calculations, ensuring reliable billing operations.
Architecture diagram
Event Types
The processor handles various billing event types:
- Subscription Created: New subscription created
- Subscription Updated: Subscription plan or details updated
- Subscription Cancelled: Subscription cancelled
- Payment Succeeded: Payment successfully processed
- Payment Failed: Payment processing failed
- Usage Calculated: Usage-based billing calculated
- Invoice Generated: Invoice generated for tenant
Processing Flow
How Billing Event Processor Works
-
Receive Event
Billing event is received from the Billing Event Queue
-
Validate Payload
Event payload is validated against BillingEventPayloadSchema
-
Route by Type
Event is routed to appropriate handler based on event type
-
Process Event
BillingEventService processes the event
-
Update Records
Billing records, subscriptions, and invoices are updated
Integration
The Billing Event Processor integrates with:
- Billing Event Service: Core billing logic
- Stripe: Payment processing
- Database: For storing billing records
- Subscription Service: For managing subscriptions
Event-driven architecture documentation: Impulsell