PAYGO PLATFORM
System Overview
The self-serve billing platform handles ~4M accounts across monthly and annual subscriptions, zone plans, add-ons, and usage products. Three services divide the work: an engine that holds all billing intelligence, a pipe that routes Stripe events, and a facade that displays account state.
PayGO (Pay-As-You-Go) is the self-serve billing tier — distinct from enterprise contracts and manual invoicing. Approximately 4 million accounts subscribe to zone plans, add-ons, and usage-based products. Billing runs on monthly and annual cycles, managed entirely through automated subscription machinery. No sales motion, no contract negotiation — the platform handles everything from checkout to renewal to dunning.
| Term | What It Is | Where It Lives |
|---|---|---|
| OPE | Object Products Element — the domain subscription model. A row in subs_object_products_element. State is emergent from five signals: deleted_date, value_phases[0], value_phases[1], license_source_id, workflow_id. | subs_object_products_element |
| SSLC | Scheduled Service Level Change — a delayed downgrade record. Captures the intent to downgrade at period end without immediately mutating the subscription. | subscriptions-api |
| changes_calculator | The mutation pipeline inside the engine. Four phases: Gather → Validate → Plan → Sync+Save. All subscription mutations flow through this single path. | subscriptions-api |
| The Pipe | billing-webhooks service. 27 handlers route Stripe events to the engine. At-least-once delivery via Pub/Sub. 50K–100K events daily. | billing-webhooks |
| The Engine | subscriptions-api. All billing intelligence: subscription changes, dunning decisions, payment orchestration, invoicing, entitlements. | subscriptions-api |
| License Source | How an OPE is billed. Values: stripe-linked, admin, user, contract, pending. Determines whether Stripe or an internal mechanism owns the billing cycle. | Field on each OPE row |
| Billing Clock | Period boundaries and renewal timing. Stripe owns the billing clock today — subscription period_start/period_end drive renewal events. | Stripe (external) |
Why state is fragmented across six stores, how OPEs replace Stripe subscriptions as the domain model, and the object relationships that connect everything.
How every change flows through one pipeline, why upgrades are immediate but downgrades are delayed, and what the billing clock controls.
The four payment paths, the Green Zone safety property, and why PayPal is the outlier that breaks every assumption.
Why the system is reactive (nothing happens without a Stripe event), what the 27 handlers do, and where decision code still leaks into the pipe.
The invoice state machine, why five separate paths finalize invoices, and how hidden metadata makes invoices lie about debt.
What triggers bad debt flagging, why recovery is broken today, and which account types get different treatment.
How ~50 product services independently translate billing state to access — and why no unified model exists.
The BigQuery view layer, two independent drift detection systems, and how weekly ticket digests connect engineering to customer pain.
Start with the Data Model to learn the objects, then follow the lifecycle.