BOON PIN
Back to Projects

Billing Management System

An end-to-end SaaS billing platform — from product configuration and customer onboarding to automated subscription charging, invoice delivery, and service lifecycle enforcement.

NestJSReactMongoDBRedisPayment Gateway IntegrationPDF GenerationWebhook Events

Overview

The Billing Management System handles the full revenue lifecycle for subscription-based services. Administrators configure products with pricing, tax, and commission rules. Customers register under a BMS account and subscribe to products. The system automatically charges subscriptions on schedule, generates PDF invoices with embedded payment links, and enforces service access based on payment status — integrating directly with downstream user service systems to disable or restore access in real time.

Top-Level Architecture

Admin

Configures products, tax, commission

BMS Core

Product catalog, account registry, billing rules

Customer

Registers, subscribes to products

Scheduled jobs (daily/monthly)

Auto Subscription Charge Engine

Calculates amount (price + tax − commission), charges account

Generate invoice

Invoice Service

PDF invoice + payment link via email

+

Payment Gateway

Customer pays online via unique link

Product Services System

External system receives webhook events to enable / disable user access

Architecture Components

Product Configuration Engine

Admin-managed product catalog

  • Define products with base price, tax rates, and billing cycle
  • Configure tiered commission rules per product or reseller
  • Group products into sales catalogues with unique storefront URLs
  • Manage pricing overrides per account or customer segment

Customer Account Registry

Account hierarchy & onboarding

  • Register customers under a BMS account (reseller or direct)
  • Assign subscribed products and billing plans per account
  • Maintain account status: active, suspended, or terminated
  • Support multi-tenant account hierarchy (parent → sub-accounts)

Auto Subscription Charge Engine

Scheduled billing processor

  • Run scheduled jobs to detect subscriptions due for renewal
  • Calculate final charge: base price + tax − commission
  • Attempt automatic charge via stored payment method
  • Record charge result and trigger downstream invoice flow

Invoice & Delivery Service

PDF generation and email dispatch

  • Generate itemized PDF invoice upon each billing cycle
  • Embed a unique payment link for immediate online settlement
  • Deliver invoice via email to the registered customer address
  • Maintain full invoice history per account with status tracking

Payment Gateway Integration

Multi-gateway payment processing

  • Support GKASH, EGLH, and additional gateway adapters
  • Handle payment link generation with invoice reference
  • Receive and verify payment callbacks from gateways
  • Update invoice status and trigger service provisioning

User Services Integration

Service lifecycle control

  • Expose webhook/API hooks consumed by downstream service systems
  • Automatically disable user services on overdue invoices
  • Re-enable services immediately upon successful payment
  • Emit events for audit trail and third-party notification systems

System Workflow

  1. 1

    Configure Products

    Admin defines products with base price, applicable tax, billing cycle, and commission rules for reseller accounts.

  2. 2

    Customer Registration

    Customers register under a BMS account and subscribe to one or more products. Account status and billing plan are recorded.

  3. 3

    Auto Subscription Charge

    On the renewal date, the charge engine calculates the final amount (price + tax − commission) and attempts to collect payment from the account.

  4. 4

    Invoice Generation & Delivery

    A PDF invoice is generated with full billing details and a unique payment link. The invoice is emailed to the customer immediately after the billing cycle runs.

  5. 5

    Online Payment via Invoice Link

    Each invoice carries a unique payment link. The customer clicks it to complete payment immediately via the integrated payment gateway, which confirms back to BMS.

  6. 6

    Service Enforcement

    BMS sends webhook events to the downstream user services system. Overdue accounts trigger automatic service suspension; paid accounts are instantly re-enabled.

Key Features

Tax & Commission Rules

Per-product tax configuration and tiered commission rules for reseller accounts, all factored automatically into every billing cycle.

Automated Subscription Billing

Scheduled charge engine runs billing cycles automatically, removing the need for manual invoicing or payment collection.

PDF Invoice with Payment Link

Every invoice is a self-contained PDF with an embedded payment link, so customers can settle outstanding amounts with a single click.

Service Suspension & Restoration

Tightly integrated with downstream service systems — overdue accounts are automatically suspended and restored the moment payment clears.

Multi-Gateway Checkout

Supports multiple payment gateways with a high-conversion, mobile-responsive checkout interface for new subscriptions.

Financial Dashboard

Full visibility into orders, payments, invoice history, and transaction records for admin oversight and revenue tracking.

System Interfaces

1. Administrative Dashboard

Administrative Dashboard

2. Subscription Packages Configuration

Subscription Packages Configuration

3. Package Creation Form

Package Creation Form

4. Sales Catalogues Management

Sales Catalogues Management

5. Configured Payment Gateways

Configured Payment Gateways

6. Secure Checkout Interface

Secure Checkout Interface

7. Order Tracking & Transactions

Order Tracking & Transactions