Interfaces Dashboard customer UI NinjaPanel support agents Product Services ~50 services Billing Platform Account Creation Sub Commerce Entitlements Usage Metering Auto Billing Dunning Data & Payment cf_prod PostgreSQL billing_prod PostgreSQL Stripe subscriptions Braintree PayPal vault
Three layers — interfaces at the top, six billing processes in the middle, data stores and payment processors at the bottom.
Account Creation & Management

Customer profiles, payment methods, and billing contacts. Creates the Stripe Customer object that all other processes reference.

Subscription Purchase

Plan selection, checkout, and on-session card charges. Creates Stripe Subscriptions with 3-D Secure payment authentication while the customer is present.

Entitlement Provisioning

Grants and revokes feature access based on subscription state. Provisioned asynchronously, checked at runtime by ~50 product services.

Usage Metering

Products report consumption through metering APIs. Usage records are aggregated into billable line items on the billing schedule cadence.

Automated Billing

Invoice generation and charge attempts on a recurring schedule. Off-session payments through Stripe where the customer is not present.

Dunning

Retries failed payments on an escalating schedule. Exhausted retries accumulate into bad debt, triggering account bans and payment method enforcement.

Dashboard
23 endpoints · customer self-service

The primary customer interface for plan management, payment methods, and billing history. All subscription changes and on-session payments originate here.

NinjaPanel
18 endpoints · support agents

Internal tool for support to view account state, modify subscriptions, issue credits, and resolve billing disputes. Writes to the same APIs as Dashboard.

Product Services
~50 services · read-heavy

Distributed services that check entitlements at runtime and report metered usage. Read-heavy consumers of billing state with write access only through metering APIs.

cf_prod
PostgreSQL

Account records, entitlement state, and product configuration. The authoritative source for what a customer owns and what features are provisioned.

billing_prod
PostgreSQL

Invoices, charge attempts, dunning state, and billing schedules. The financial ledger — every charge, refund, and credit lives here.

Stripe
Subscriptions · Invoices · Customers · Prices

Payment processor and subscription engine. Manages recurring billing schedules, processes card charges, and emits webhook events for state changes.

Braintree
PayPal vault

PayPal payment method vault. Handles PayPal-specific checkout flows and stores vaulted payment tokens for recurring charges.

Account Creation Subscription Purchase Entitlement Provisioning Usage Metering Automated Billing Dunning
Six processes forming a continuous lifecycle — from account creation through dunning and back to account-level consequences.
FromToWhat Flows
AccountSubscriptionAccount ID and payment method enable subscription creation. Every subscription belongs to exactly one account.
SubscriptionEntitlementsCreates, changes, and cancellations emit events that trigger entitlement grants and revocations.
SubscriptionBillingNew subscriptions create billing schedules. Plan prices and billing periods determine charge amounts and timing.
UsageBillingMetered usage records feed into invoice line items. Aggregated on the billing schedule cadence alongside fixed charges.
BillingDunningFailed charge attempts enter the dunning pipeline. Each failure increments the retry counter and escalation level.
DunningAccountExhausted dunning escalates to account-level consequences — bad debt flags, payment method requirements, or account bans.