Billing and Licenses
The current portal billing slice covers Stripe checkout, billing portal access and online license activation.
Billing flow
- Open
/app/billing. - Start a Stripe checkout session for
solo,teamorenterprise. - After successful checkout the portal syncs the subscription and creates or updates the portal license record.
- 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_KEYandSTRIPE_WEBHOOK_SECRETare required for production billing.DATABASE_URLis required to persist subscriptions and license state.- Step 11 adds rate limiting to checkout, license validation and webhook handling.
