Subscriptions
AuthAction connects your plans to Stripe. You define plans with prices, features and limits; your users pay through Stripe Checkout; and your app asks AuthAction what the signed-in user, or their organization, may use.
There is no billing code to write and no Stripe webhook to handle yourself.
How it works
Section titled “How it works”- Connect Stripe. Paste a Stripe restricted key under Billing in the dashboard. Payments go straight to your Stripe account.
- Price your plans. Give each plan a key (
pro), its features (export_pdf), its limits (projects: 50) and its prices. AuthAction creates the products and prices in Stripe. - Send users to checkout. From your app, with the web SDK or one API call. Or link to the hosted pricing page if you have none of your own.
- Read entitlements. Your app calls
GET /billing/entitlementswith the user’s access token and gets the plan, features and limits in force now.
{ "subject": { "type": "user", "id": "6650c1f2a4b5c6d7e8f90123" }, "plan": { "id": "6650c1f2a4b5c6d7e8f90abc", "key": "pro", "name": "Pro" }, "source": "subscription", "features": ["export_pdf", "sso"], "limits": { "projects": 50 }, "subscription": { "id": "6650c1f2a4b5c6d7e8f90def", "status": "active", "interval": "month", "currentPeriodEnd": "2027-01-03T10:00:00.000Z", "cancelAtPeriodEnd": false, "trialEnd": null }}Why an endpoint and not token claims
Section titled “Why an endpoint and not token claims”Entitlements come from an endpoint rather than from claims in the access token. A token is a snapshot: a user who cancels would keep paid features until their token expired, and an upgrade would not show until the next sign-in. The endpoint always answers with the current state, and it can carry limits and subscription details that would bloat every token.
The SDKs cache the answer briefly (a minute in the browser, 30 seconds on the server). Clear the cache when the user comes back from Stripe, or when your server receives a subscription event.
Where a plan comes from
Section titled “Where a plan comes from”Each user and organization has at most one plan in force, chosen in this order:
| Source | When |
|---|---|
subscription | A Stripe subscription that is active, trialing or past_due |
assigned | A plan an admin assigned in the dashboard or with the Management API |
default | The plan marked Default |
none | None of the above |
A subscription stays in force while Stripe retries a failed payment
(past_due). It stops when Stripe marks it unpaid or canceled, and the
user falls back to their assigned or default plan.
Users and organizations
Section titled “Users and organizations”A user subscribes for themselves. For B2B apps, an organization can subscribe
instead, and every member gets the organization’s plan when your app asks with
?organization=<id>. Choose who may buy for an organization under
Billing > Organizations; see Checkout and portal.