SYSTEM DEEP-DIVE
Area 1: Account Management
The customer-facing surface — 79 touchpoints across Dashboard, iAPI Gateway, and NinjaPanel. Sees billing state without understanding it.
Customer self-service — plan management, payment methods, billing history. The primary interface for all subscription changes and on-session payments.
Service-to-service calls from other Cloudflare systems. The largest surface area in Area 1.
Internal support tool for account state, subscriptions, credits, and billing dispute resolution. Writes to the same APIs as Dashboard.
CRUD operations, validation, sync with Stripe customer objects. The billing identity that all other processes reference.
Add, update, and tokenize payment methods. Card vaulting and PayPal agreements. Determines the collection path for all subscriptions.
List invoices, detail views, PDF generation for customer records. Previously showed "Paid / Paid" for resolved bad debt — now fixed.
Retry failed payments, reconcile account state, clear bad debt flags. Now isolated behind a dedicated endpoint with guards.
Prometheus metrics, Grafana dashboards, account health alerts. Business observability for billing state across all entry points.
| Store | Role |
|---|---|
| PostgreSQL | Primary relational store for account records and billing profiles. |
| Redis | Cache layer, session management, and rate limiting. |
| Stripe Customer | The sixth store — shared state across all three areas. Stripe customer objects are the canonical reference for payment methods and billing identity. |
Invoice pagination and date filtering for accurate customer-facing records. Replaces the misleading "Paid / Paid" display for resolved bad debt.
Isolated /pay-bad-debt endpoint with guards. Separate from the regular collection path to prevent accidental state corruption.
Support self-service — trigger a full account recompute from NinjaPanel. Eliminates the need for engineering intervention on stuck accounts.
Metrics pipeline and Grafana dashboards for account health. Visibility into billing state that didn't exist before.
Braintree token migration to correct the PayPal vaulting path. Fixes the wrong dunning path that PayPal customers were taking.
Single payment flow replacing per-product checkout pages. The front door to billing — card vaulting, PayPal vaulting, and Turnstile.
Area 1 is the blind surface — it presents billing state to customers and support without understanding the underlying complexity. Six new capabilities from three initiatives are changing that.