Documentation
Data Model
Stackhouse-Billing tables and how they relate to each other.
Data Model
All Stackhouse-Billing tables are prefixed billing_ and created by idempotent
migrations that run on boot when the module is enabled.
Entity relationships
Rendering diagram…
Tables
| Table | Purpose |
|---|---|
apps | Top-level tenant boundary — one row per app using Stackhouse-Billing |
products | Store-side SKUs (store, store_product_id, product_type) |
entitlements | Named feature/access grants (e.g. pro) |
entitlement_products | Many-to-many join: which products unlock which entitlements |
offerings | Named groups of packages shown in a paywall (one marked is_current per app) |
packages | Purchasable options within an offering, each referencing a product |
audiences | Rule groups used by offerings and experiments |
experiments | A/B tests with status, audience, and metric |
experiment_variants | Weighted offering pointers belonging to an experiment |
experiment_assignments | Sticky (experiment, customer) → variant mapping |
experiment_events | Impressions and conversions per variant |
paywalls | Per-offering live/draft visual configuration |
customers | End users, identified by app_user_id |
subscriptions | Active/expired subscription state per customer + product |
transactions | Individual purchase/renewal/refund events |
receipts | Raw receipt payloads submitted by clients, for audit/replay |
webhook_endpoints | Outbound listener URLs registered by app owners |
webhook_deliveries | Delivery attempts, status, and retry state |
See src/billing/schema.rs for the full DDL.