Skip to content

Billing and Licenses

The current portal billing slice covers Stripe checkout, billing portal access and online license activation.

Billing flow

  1. Open /app/billing.
  2. Start a Stripe checkout session for solo, team or enterprise.
  3. After successful checkout the portal syncs the subscription and creates or updates the portal license record.
  4. Existing customers can open the Stripe billing portal from the same page.

License endpoints

The portal currently exposes:

  • /api/portal/license/activate
  • /api/portal/license/validate
  • /api/portal/license/deactivate

These endpoints require a signed-in portal user or a valid agent bearer token.

Agent-side license behavior

  • The local agent validates the online license in the background.
  • If no online JWT is available yet, it attempts an activation once after startup.
  • Runner and swarm execution stay blocked when the license state is not valid.

Operational notes

  • STRIPE_SECRET_KEY and STRIPE_WEBHOOK_SECRET are required for production billing.
  • DATABASE_URL is required to persist subscriptions and license state.
  • Step 11 adds rate limiting to checkout, license validation and webhook handling.

Cloud portal · Local Playwright agent.