Skip to content

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.

  1. Connect Stripe. Paste a Stripe restricted key under Billing in the dashboard. Payments go straight to your Stripe account.
  2. 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.
  3. 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.
  4. Read entitlements. Your app calls GET /billing/entitlements with 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
}
}

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.

Each user and organization has at most one plan in force, chosen in this order:

SourceWhen
subscriptionA Stripe subscription that is active, trialing or past_due
assignedA plan an admin assigned in the dashboard or with the Management API
defaultThe plan marked Default
noneNone 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.

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.