clerk-billing
Billing
STOP, prerequisite. Billing must be enabled before any
<PricingTable />,<CheckoutButton />,has({ plan }), orhas({ feature })usage works. Two paths: (1) Dashboard → Billing → Settings, or (2)clerk enable billing(see "Agent-first: Programmatic billing config" below). Enabling auto-creates defaultfree_user/free_orgplans. Dev instances can use the shared Clerk development gateway (no Stripe account needed); production requires a Stripe account for payment processing only.Note: Billing APIs are still experimental. Pin your
@clerk/nextjsandclerk-jspackage versions. Seeclerkskill for the supported version table.
Quick Start
-
Enable Billing, via Dashboard → Billing → Settings or
clerk enable billing(see Agent-first section). Skipping this throwscannot_render_billing_disabledin dev and renders empty in prod. -
Create plans in the matching tab, Dashboard → Billing → Plans. Two tabs, slugs scoped per tab, not movable after creation:
- User Plans →
<PricingTable />(defaultfor="user") - Organization Plans →
<PricingTable for="organization" />
Wrong-tab is the #1 cause of an empty
<PricingTable />. Plans live in Clerk; not synced to Stripe. - User Plans →
-
Add features inside a plan, open the plan in Dashboard → Billing → Plans, use its Features section. Features are scoped per plan, not global. The same slug can attach to multiple plans;
has({ feature: 'export' })matches if the active plan contains that slug. -
Render
<PricingTable />(passfor="organization"for B2B). -
Gate access with
has({ plan })orhas({ feature })fromauth(). -
Handle billing webhooks for subscription lifecycle.
More from clerk/skills
clerk-nextjs-patterns
Advanced Next.js patterns - middleware, Server Actions, caching with
11.3Kclerk
Clerk authentication router. Use when user asks about adding authentication,
7.8Kclerk-setup
Add Clerk authentication to any project by following the official quickstart
7.0Kclerk-custom-ui
Custom authentication flows and component appearance - hooks (useSignIn,
6.8Kclerk-webhooks
Clerk webhooks for real-time events and data syncing. Verify with verifyWebhook
6.1Kclerk-testing
E2E testing for Clerk apps. Use with Playwright or Cypress for auth flow
5.8K