Billing
Subscription billing with Stripe — checkout, customer portal, webhooks, and plan management, ready to toggle.
Overview
SiteKnock's billing is powered by Stripe. It provides subscription checkout, the Stripe-hosted customer portal, secure webhooks, and subscription lifecycle handling — wired into the dashboard UI.
Enable it
"billing": {
"enabled": true,
"processors": [
{ "processor": "stripe", "enabled": true }
],
"orders": true
}
What's included
Checkout
Create Stripe Checkout sessions for plan purchases and redirect to Stripe-hosted checkout.
Customer portal
Let customers update payment methods, change plans, and cancel — all in the Stripe-hosted portal.
Webhooks
Securely handle subscription events with signature verification.
Subscriptions
Monthly/annual tiers with automatic provisioning and grace-period handling.
Billing UI
The dashboard ships with billing components: current plan with tier badge, upgrade/downgrade buttons that open checkout, payment method management, an invoice history table, and a customer-portal button.
Environment variables
Set your Stripe keys for the backend:
STRIPE_SECRET_KEY=sk_...
STRIPE_WEBHOOK_SECRET=whsec_...
STRIPE_PUBLISHABLE_KEY=pk_...
Testing webhooks locally
Forward Stripe webhooks to your local backend during development:
pnpm stripe:listen
This forwards events to http://localhost:5000/api/billing/webhook.
Configure in Studio
Toggle billing, add your Stripe API keys and webhook secret under integrations, and set up pricing plans.
Always validate the session and organization membership before any billing operation, and never trust client-supplied prices — create checkout sessions server-side from your own plan definitions.