Stripe Payment & Billing Architecture
This section documents the serverless, dynamic billing ecosystem connecting Stripe, Cloudflare KV, and BigQuery.
Architecture Highlights
-
Universal Metadata Tagging: Every Customer, Checkout Session, Payment Intent, Subscription, and Invoice is stamped with
pid,_id,user_id, anddomainto enable real-time attribution and reporting. -
Zero-Maintenance Credit Top-Ups: Stripe Payment Links dynamically add
instantCreditsorweeklyCreditsto user domains upon webhook receipt (checkout.session.completed) without requiring local cart state. -
Lightweight CMS Product Catalog: Stripe Payment Links and Price tiers act as the live product inventory. Targeted partner promotions are filtered via
pidmetadata rules (DLR,DDC,-ADD). -
Headless Billing & Customer Auto-Binding: Accounts created via API, Admin UI, or self-service registration automatically check Stripe for existing customers by email, bind their
stripe_customer_id, and sync metadata tags. -
Dynamic Checkout Sessions: Checkout sessions created via
payment.checkout.createcascade domain and partner metadata into underlying subscriptions and charges.