Skip to content

Invoices & Billing Statements Module Documentation

4 min readUpdated: Nov 29, 2026
View as Markdown
Role Primary Use Case Key Capabilities
Customer Account Administrator Corporate telecom self-service management. View account balance, purchase additional DIDs, manage subscribed plans, and configure company profile.
Finance / Accounts Payable Wallet replenishment & invoice payments. Add funds via credit card / bank transfer, download official PDF invoices, and monitor transaction ledgers.
End Subscriber Personal usage tracking. Review outbound call history, check message logs, and inspect plan quota consumption.

Module Code: billing/client/invoices
Route: /portal/invoices
Backend Service: clientService.ts (ring2all-billing-api)
Database Tables: invoices, invoice_items, payment_methods
Brand Purity: 100% White-Label Compliant (Ring2All BSS)


  1. Executive Summary & Settlement Transparency
  2. Technical Architecture & Invoicing Lifecycle
  3. Visual Interface & Screen Breakdown
  4. Automated Dunning Prevention & One-Click Payment
  5. PDF Tax Invoice Generation & Breakdown
  6. Diagnostic CLI & Operational Playbooks
  7. Domain Glossary

The Invoices & Billing Statements module provides enterprise subscribers with a self-service financial ledger for reviewing generated statements, downloading official PDF tax invoices, and settling unpaid balances via tokenized payment methods.

+-------------------------------------------------------------------------------+
| COMMERCIAL & OPERATIONAL IMPACT |
+-------------------------------------------------------------------------------+
| β€’ Accelerated Collections: Clients can settle past-due invoices with one |
| click using stored payment credentials, drastically lowering DSO. |
| β€’ Full Itemization: Detailed breakdown of recurring subscription plans, |
| minute package overages, DID monthly concessions, and toll usage. |
| β€’ Automated Service Restoration: Settle outstanding balances to immediately |
| restore suspended SIP trunks and PBX extensions. |
| β€’ Compliance & Record Keeping: Permanent access to tax-compliant statements. |
+-------------------------------------------------------------------------------+

Invoices are generated either via recurring subscription sweeps or automated out-of-bundle usage threshold billing. When a customer initiates payment, the API executes payment verification via Stripe:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Customer Reviews Invoice Table β”‚
β”‚ Route: /portal/invoices β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚ Click "Pay Now"
β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Ring2All BSS API (POST /api/client/invoices/:id/pay) β”‚
β”‚ β€’ Verifies Default Vaulted Payment Method β”‚
β”‚ β€’ Dispatches Stripe PaymentIntent Confirmation β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Success β”‚ Error
β–Ό β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ PostgreSQL 17 Atomic Updates β”‚ β”‚ Dunning Lifecycle Handler β”‚
β”‚ β€’ invoices.status = 'paid' β”‚ β”‚ β€’ Records Last Failure Error β”‚
β”‚ β€’ invoices.paid_at = NOW() β”‚ β”‚ β€’ Sets Next Retry Interval β”‚
β”‚ β€’ Unfreezes Customer SIP Trunks β”‚ β”‚ β€’ Dispatches Alert Email β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

The interface categorizes invoices chronologically with dynamic payment status badges:

Invoices & Statements Overview

  • Invoice Number & Dates: Unique alphanumeric statement ID alongside statement generation and due dates.
  • Billing Period: Clear start and end dates covering recurring fees and metered usage.
  • Total & Balance: Total invoiced amount and remaining unpaid balance in USD.
  • Status Badges: Visual indicators for Paid (emerald), Unpaid / Open (amber), and Overdue (destructive red).
  • Payment Action: Instant β€œPay Now” action button for open invoices.

To prevent service degradation:

  • One-Click Vaulted Settlement: If the customer has a default card saved in Payment Methods, clicking Pay Now completes payment in less than 2 seconds without re-entering card numbers.
  • Idempotency Safeguards: Stripe PaymentIntents are tagged with unique invoice UUIDs to eliminate double-billing risks during network retries.
  • Instant Service Unfreeze: When an invoice in dunning status is paid, the system updates customers.status = 'active' and Ring2All SBC Engine unblocks outbound call routing within 100 milliseconds.

Official PDF invoices include:

  1. Corporate Entity Details: Service provider brand, tax ID, registration address, and banking coordinates.
  2. Customer Entity Details: Billed company name, tax ID, physical address, and account number.
  3. Itemized Charges Table: Plan tier recurring base fee, active DIDs, and out-of-bundle call minutes.
  4. Payment Receipts: Transaction reference number, authorization code, and payment gateway timestamp.

Terminal window
su - postgres -c "psql -d ss_billing -c \"
SELECT invoice_number, status, total_amount, amount_paid, due_date, paid_at
FROM invoices
WHERE customer_id = 5;
\""

  • DSO (Days Sales Outstanding): Average number of days taken to collect payment after statement issuance.
  • Dunning: Process of communicating with customers to collect past-due balances before suspension.
  • PaymentIntent: Stripe cryptographic object representing a customer’s payment lifecycle.