Skip to main content
Plans are assigned per app.
No plan assigned: the app can still issue tokens, but no limits claim is added. Retired plan assigned: token issuance is blocked.

What Billing Controls

Billing is tied to plan assignment on a tenant app.
  • free plans can be assigned directly
  • paid plans use the payment provider flow
  • changing plans may either assign immediately or create a billing session, depending on the current app state

Assigning Or Changing A Plan

Plan changes are initiated from the dashboard and applied to a specific app.

Backend Flow

  1. load the target plan
  2. validate that the target plan can be assigned
  3. load the app’s current plan and subscription state
  4. decide whether the change is direct or requires billing

Free And Paid Plan Behavior

Free Plans

Free plans can be assigned directly without a checkout session. If the app already has a paid subscription, the backend cancels that subscription and updates the app state before completing the free-plan assignment. Paid plans use the payment provider flow.
  • if the app already has an active paid subscription, the backend requests a plan change on that subscription
  • if the app has no active paid subscription, the backend creates a checkout session
  • the final assignment is completed after the billing flow succeeds

One Free Plan Rule

The current domain logic allows only one app with a free plan per tenant. If a tenant already has another app on a free plan, assigning a free plan to a second app fails.

Subscription Status

The billing flow tracks subscription status on the app.
StatusDescription
PendingBilling setup has started but is not complete yet.
ActiveThe subscription is active.
OnHoldPayment method or billing action is required.
FailedThe billing flow failed.
CancelledThe subscription was cancelled.
ExpiredThe subscription expired.
Treat subscription management as a separate step from enabling, disabling, or deleting an app.

Plan Status Rules

The backend treats plan status differently depending on the operation.
  • Active plans can be assigned
  • Draft plans cannot be assigned
  • Archived plans cannot be assigned to a new app
  • Retired plans block token issuance for apps that still use them

Developer Notes

For setup and troubleshooting, these are the most important rules:
  • assign a usable plan if you need the limits claim (measured in Document Units)
  • keep only one free-plan app per tenant
  • expect billing flow only for paid plans
  • if a paid app becomes OnHold, billing action is required before normal changes continue
Last modified on April 1, 2026