Billing & Subscriptions
HostMetrics uses Stripe for subscription billing. The billing system manages plan tiers, payment methods, checkout, and subscription lifecycle.Plan Tiers
Plans are stored in theplans table. Each tier defines:
- Monthly and annual pricing
- Feature limits (number of vehicles, investors, imports)
- Access to premium features (reports, fleet pages, toll sync)
BillingCycleToggle component lets users switch between monthly and annual pricing views. PlanComparisonModal shows a side-by-side feature comparison.
Checkout Flow
- User clicks upgrade on
CurrentPlanCard - API creates a Stripe Checkout session
- User is redirected to Stripe’s hosted checkout page
- On success, Stripe sends a webhook to the app
- The webhook handler creates/updates the
subscriptionsrecord
Subscription Lifecycle
The
CancelSubscriptionDialog handles cancellation with confirmation and reason collection.
Payment Methods
Users manage saved cards viaPaymentMethodsCard and AddPaymentMethodDialog. Payment methods are stored in Stripe and referenced in the payment_methods table.
Customer Portal
TheStripeConnectButton redirects users to Stripe’s Customer Portal where they can:
- Update payment methods
- View invoice history
- Download receipts
- Manage subscription