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.

View the changelog

Want to know the history of this service? View the change logs

Contact the team

Any questions? Feel free to contact the owners

Receives 1 messages

This service receives messages from other services

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

  1. Receive Event

    Billing event is received from the Billing Event Queue

  2. Validate Payload

    Event payload is validated against BillingEventPayloadSchema

  3. Route by Type

    Event is routed to appropriate handler based on event type

  4. Process Event

    BillingEventService processes the event

  5. 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