Mission Control docs
Technical Reference

Billing: Technical Reference

Stripe integration, subscription lifecycle, webhook handling, and plan enforcement.

Billing: Technical Reference

See Stripe Billing for the Stripe-specific implementation details, webhook events, and checkout flow.

Plans and internal keys

UI LabelInternal KeyDescription
InitiatefreeDefault; BYO OpenClaw gateway
StrategosproHosted OpenClaw included
ArchonteamDedicated provisioned OpenClaw

Plans are stored in tenants.plan as the internal key (free, pro, team).

Database details Schema (billing-relevant columns)

-- tenants table (billing fields)
plan                text    NOT NULL DEFAULT 'free',
stripe_customer_id  text,
stripe_sub_id       text,
stripe_plan_key     text,
seats               integer NOT NULL DEFAULT 1,
sub_status          text,   -- 'active' | 'canceled' | 'past_due' | ...
sub_period_end      timestamp,

API endpoints

RouteMethodPurpose
/api/billing/checkoutPOSTCreate Stripe Checkout session
/api/billing/portalPOSTCreate Stripe Customer Portal session
/api/billing/webhookPOSTReceive Stripe lifecycle events
/api/billing/statusGETCurrent subscription status for tenant

Plan Enforcement

Plan gates are enforced at the API layer via resolveTenantId() + plan check. Feature flags derived from plan:

FeatureInitiateStrategosArchon
Agent slots138
AiPipe routing
ContentAI
CoderAI
Provisioned gateway

Webhook Events Handled

  • checkout.session.completed — set stripe_customer_id, stripe_sub_id, update plan
  • customer.subscription.updated — update plan, status, period end
  • customer.subscription.deleted — downgrade to free
  • invoice.payment_failed — set sub_status = 'past_due'

Webhook signature verification uses STRIPE_WEBHOOK_SECRET env var.

On this page