Skip to main content
General
Admin Panel

Subscriptions

Monitor and manage organization subscriptions from the admin Organizations page.

Open MarkdownFull AI corpusFeedback

The shipped kit manages subscriptions from /dashboard/admin/organizations. It does not include a standalone /dashboard/admin/subscriptions route or an admin.subscription tRPC router.

Included Admin Controls

The Organizations table shows the latest subscription for each organization. Admins can:

  • Search for an organization by name
  • Filter organizations by subscription status
  • Open an active subscription in Stripe
  • Schedule an active subscription to cancel at the end of its billing period
  • Sync subscription and order data from Stripe

The table derives its displayed plan label from the text before the first underscore in the stored Stripe price ID and also displays the subscription status. It does not resolve that value against configured plan names or provide revenue analytics or payment history.

List Subscription Summaries

Subscription summaries are returned by the existing organization list procedure:

components/admin/organizations/organizations-table.tsx
const { data, isPending } = trpc.admin.organization.list.useQuery({
  limit: 25,
  offset: 0,
  query: '',
  sortBy: 'name',
  sortOrder: 'asc',
  filters: {
    subscriptionStatus: ['active', 'trialing']
  }
});

const organizations = data?.organizations ?? [];
// Each result includes subscriptionId, subscriptionStatus,
// subscriptionPlan and cancelAtPeriodEnd.

There is no trpc.admin.subscription.list procedure. The list returns the most recent stored subscription for each organization instead of every subscription record.

Cancel a Subscription

The row action uses the admin organization router:

const cancelSubscription =
  trpc.admin.organization.cancelSubscription.useMutation();

cancelSubscription.mutate({
  subscriptionId,
  immediate: false
});

The shipped interface always passes immediate: false, which schedules the subscription to cancel at the end of its current period. The procedure also accepts immediate: true for custom admin interfaces. Stripe webhooks update the local subscription record after cancellation.

Sync Billing Data from Stripe

Use the sync procedure with one or more organization IDs:

const syncFromStripe = trpc.admin.organization.syncFromStripe.useMutation();

syncFromStripe.mutate({
  organizationIds: [organizationId]
});

This syncs subscriptions and one-time orders for the selected organizations. The input accepts between 1 and 1,000 organization IDs. The Organizations table supports both a row action and a bulk action for this procedure.

Not Included

The current kit does not include:

  • A separate admin subscriptions page
  • trpc.admin.subscription.list, trpc.admin.subscription.cancel or trpc.admin.subscription.syncFromStripe
  • A global subscription table with revenue or churn reporting
  • Admin payment history or bulk subscription cancellation

Organization owners and organization admins manage their own billing from /dashboard/organization/settings?tab=subscription through the trpc.organization.subscription router.