quantity field on subscriptions. You can set a default quantity in the plan config, update it manually through the API, or let the plugin sync it automatically when organization members are added or removed.
Plan quantity
Setquantity on a plan to define the default number of seats included in the subscription. The value is stored on the local subscription row and passed to Razorpay when the subscription is created.
auth.ts
quantity: false disables quantity tracking for that plan. quantity: 1 or higher enables seat-based billing.Updating quantity manually
Callsubscription.update to change the seat count at any time. You can apply the change immediately or schedule it for the end of the current billing cycle.
Automatic seat sync for organizations
When you enable the Better Authorganization plugin and set organization: { enabled: true } in the Razorpay plugin, seat counts sync automatically:
- Member added: the plugin increments the subscription quantity by 1.
- Member removed: the plugin decrements the subscription quantity by 1.
- Invitation accepted: the plugin increments the subscription quantity by 1 when the invitee joins.
quantity configured. The plugin uses the active organization’s subscription and updates the quantity through Razorpay’s subscription update API.
auth.ts
React example: seat management UI
Build a team settings page where admins can view and adjust seat counts.app/team/billing/page.tsx