From 72be94bc2218d540b73dfbbd03d75c483f815413 Mon Sep 17 00:00:00 2001 From: Roshan Chapagain Date: Thu, 15 Jan 2026 14:10:22 -0600 Subject: [PATCH 1/7] `add:` b2b per usage billing setup guide --- package-lock.json | 10 - .../b2b-sass-per-usage-billing-setup.mdx | 287 ++++++++++++++++++ src/data/sidebarData.ts | 5 + 3 files changed, 292 insertions(+), 10 deletions(-) create mode 100644 src/content/docs/billing/implementation-guide/b2b-sass-per-usage-billing-setup.mdx diff --git a/package-lock.json b/package-lock.json index de0d487eb..13dabdd20 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3430,16 +3430,6 @@ "win32" ] }, - "node_modules/@pkgjs/parseargs": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", - "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", - "optional": true, - "peer": true, - "engines": { - "node": ">=14" - } - }, "node_modules/@radix-ui/number": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@radix-ui/number/-/number-1.1.0.tgz", diff --git a/src/content/docs/billing/implementation-guide/b2b-sass-per-usage-billing-setup.mdx b/src/content/docs/billing/implementation-guide/b2b-sass-per-usage-billing-setup.mdx new file mode 100644 index 000000000..a25599928 --- /dev/null +++ b/src/content/docs/billing/implementation-guide/b2b-sass-per-usage-billing-setup.mdx @@ -0,0 +1,287 @@ +--- +page_id: 9c7d4e5a-6b8f-4c2a-9e3d-1f5a7c8b2d6e +title: B2B SaaS billing with organizations and per-user pricing +sidebar: + order: 1 +description: Implement a standard B2B SaaS architecture in Kinde with organization-scoped access control, administrator-managed billing, and per-user pricing via metered features. +metadata: + topics: [billing, b2b, organizations, per-user pricing, metered usage, implementation] + sdk: [] + languages: [] + audience: [developer] + complexity: intermediate + keywords: [b2b saas, per-user pricing, seat-based billing, metered features, organization billing, implementation guide] + updated: 2025-01-27 +featured: false +deprecated: false +ai_summary: Complete guide to implementing B2B SaaS billing in Kinde with organizations, per-user seat-based pricing, metered features, and multiple user join patterns for administrators to manage subscriptions. +--- + +This guide describes how to implement a **standard B2B SaaS architecture** in **Kinde** using: + +- Organization-scoped access control +- Administrator-managed billing +- Fixed **per-user (seat-based)** pricing via metered features +- Multiple supported organization join patterns + +This guide is intended for developers building B2B products on Kinde, who want to reproduce a typical organization-based billing model. + +## Guide Overview + +The recommended high-level implementation flow is: + +1. Configure a per-user billing plan +2. Define who can manage billing at the organization level +3. Enable organization creation +4. Handle the first user (organization creator) +5. Allow additional users to join the organization +6. Track seat usage for billing + +Kinde is **API-first and flexible**. Some organization join flows are supported out of the box, while others can be implemented using the Management API depending on product requirements. + +## 1. Connect Stripe + +Connect your **Stripe** account from the Kinde dashboard. + +Notes: + +- Test and live environments are supported +- Published plans are automatically synced to Stripe +- Stripe products and prices are managed by Kinde + +**Learn more:** [Manage Stripe connection](https://docs.kinde.com/billing/payment-management/manage-stripe-connection/) + +## 2. Configure a per-user billing plan + +Create a billing plan with a **metered feature** representing users or seats. The plan must be created for **Organizations**. + +### Create an organization plan + +1. Go to **Billing** +2. Select **Add a plan** +3. In **This plan is for**, select **Organizations** +4. Provide a name, description, key, and currency +5. Save the plan + + +### Add a metered feature to the plan + +1. In the plan, scroll to **Features and pricing** +2. Select **Add feature** +3. Choose **New metered** + +Configure the feature: + +- **Feature name** + + `Users` + +- **Key** + + `user` + + This key is required when submitting metered usage. + +- **Maximum units** + + Leave empty for unlimited users, or set a limit if required. + +- **Unit measurement name** + + `user` or `seat` + +- **Pricing model** + + Per unit + +- **Price per unit** + + Fixed price per user + +- **Line item description** + + Example: `User seats` + + +Save the feature. + +### Optional: Add a base subscription charge + +If your pricing model requires a fixed base fee: + +- Add a fixed charge to the plan +- Example name: `Base subscription fee` +- The price can be `$0.00` if billing is fully per-user + + +### Publish the plan + +Plans must be **published** before they: + +- Appear in pricing tables +- Are selectable during signup +- Sync to Stripe + +## 3. Generate a pricing table + +1. Go to **Dashboard → Billing → Pricing tables** +2. Create or customize a pricing table +3. Toggle **Make live** + +The pricing table key is required when initiating signup with plan selection. + + +## 4. Create a Billing Admin role + +Organization administrators require a role that allows them to manage billing. + +**Steps** + +1. Go to **Settings → Roles** +2. Select **Add role** +3. Configure: + - **Name:** Billing Admin + - Key: billing-admin + - **Assign to the creator if organizations self-sign up:** Enabled + - **System permission:** `org:write:billing` +4. Save + +Users with this role can manage subscriptions, plans, and payment methods for their organization. + +## 5. Organization creation (first user) + +Enable organization creation during signup. + +**Settings → Environment → Organizations** + +- Enable **Organization creation during signup** + + +### Trigger organization creation from your application + +```jsx + +Sign up your company + + +``` + +### Direct authorization URL + +``` +https://.kinde.com/oauth2/auth + ?response_type=code + &client_id=YOUR_CLIENT_ID + &redirect_uri=YOUR_REDIRECT_URI + &scope=openid profile email + &is_create_org=true + &pricing_table_key=YOUR_PRICING_TABLE_KEY + +``` + + +### Signup flow behavior + +1. The user registers +2. A new organization is created +3. The user is assigned the Billing Admin role +4. The pricing table is displayed +5. Payment details are collected +6. The organization is created with an active subscription + + +## 6. Adding users to an existing organization + +Once an organization exists, additional users can join using multiple supported approaches. + +- The appropriate authentication method is enabled +- **Org → Policies → Allow org members to be auto-added** is enabled + + + +### Option 1: Manual addition (dashboard) + +- No custom code required +- Intended for internal or low-volume use + + + +### Option 2: Self sign-up using `orgCode` (recommended) + +Users sign up or log in using an organization code. + +```jsx + +Sign up + +``` + +```jsx + +Signin + +``` + + + +Behavior: + +- User authenticates +- User is automatically added to the specified organization + +This is the **recommended default** for most B2B SaaS applications. + + + +### Option 3: Auto-add users from allowed domains + +Users are automatically added to an organization based on their email domain. + +Enable: + +1. Allow org members to be auto-added +2. Enable auto-add users from allowed domains +3. Add allowed domains (for example, `company.com`) + +Example: + +A user signing up with `jane@acme.com` is automatically added to the Acme organization. + + + +## 7. Tracking seat usage for billing + +Kinde does **not automatically calculate seat counts** for metered billing. Applications must submit usage updates. + +### When to submit usage + +Common triggers include: + +- A user is added to an organization +- A user is removed or deactivated +- A scheduled reconciliation job (recommended) + +### How to submit usage + +Usage can be submitted using: + +- Management API +- Workflows (example: [Track org seat usage workflow](https://github.com/kinde-starter-kits/workflow-examples/blob/main/billing/trackOrgSeatUsageWorkflow.ts)) +- Billing webhooks + +This ensures billed usage reflects the number of **active users** in the organization. + + +## Troubleshooting + +### Pricing table not shown during signup + +Verify: + +- The pricing table is **live** +- **Settings → Billing → Billing experience → Show pricing table during signup** is enabled +- The `pricingTableKey` matches the intended pricing table \ No newline at end of file diff --git a/src/data/sidebarData.ts b/src/data/sidebarData.ts index 93f3c1155..cdfdc99f9 100644 --- a/src/data/sidebarData.ts +++ b/src/data/sidebarData.ts @@ -246,6 +246,11 @@ const sidebarData = [ label: "Billing user experience", autogenerate: {directory: "billing/billing-user-experience"}, collapsed: false + }, + { + label: "Implementation guides", + autogenerate: {directory: "billing/implementation-guide"}, + collapsed: false } ] }, From 8e6a5fac7429ce9873b874f93e0aa6c0145a2d95 Mon Sep 17 00:00:00 2001 From: Roshan Chapagain Date: Thu, 15 Jan 2026 14:15:29 -0600 Subject: [PATCH 2/7] `refactor:` change file name --- ...age-billing-setup.mdx => b2b-saas-per-usage-billing-setup.mdx} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/content/docs/billing/implementation-guide/{b2b-sass-per-usage-billing-setup.mdx => b2b-saas-per-usage-billing-setup.mdx} (100%) diff --git a/src/content/docs/billing/implementation-guide/b2b-sass-per-usage-billing-setup.mdx b/src/content/docs/billing/implementation-guide/b2b-saas-per-usage-billing-setup.mdx similarity index 100% rename from src/content/docs/billing/implementation-guide/b2b-sass-per-usage-billing-setup.mdx rename to src/content/docs/billing/implementation-guide/b2b-saas-per-usage-billing-setup.mdx From 8c28752d65a0577fc7d4534b512bb4a0d5b10ff4 Mon Sep 17 00:00:00 2001 From: Roshan Chapagain Date: Thu, 15 Jan 2026 14:16:13 -0600 Subject: [PATCH 3/7] `refactor:` updated date --- .../implementation-guide/b2b-saas-per-usage-billing-setup.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/billing/implementation-guide/b2b-saas-per-usage-billing-setup.mdx b/src/content/docs/billing/implementation-guide/b2b-saas-per-usage-billing-setup.mdx index a25599928..073594b1e 100644 --- a/src/content/docs/billing/implementation-guide/b2b-saas-per-usage-billing-setup.mdx +++ b/src/content/docs/billing/implementation-guide/b2b-saas-per-usage-billing-setup.mdx @@ -11,7 +11,7 @@ metadata: audience: [developer] complexity: intermediate keywords: [b2b saas, per-user pricing, seat-based billing, metered features, organization billing, implementation guide] - updated: 2025-01-27 + updated: 2026-01-15 featured: false deprecated: false ai_summary: Complete guide to implementing B2B SaaS billing in Kinde with organizations, per-user seat-based pricing, metered features, and multiple user join patterns for administrators to manage subscriptions. From fa5cdaae2e94ab467fbbc3190945b50baaf6461a Mon Sep 17 00:00:00 2001 From: Roshan Chapagain Date: Thu, 15 Jan 2026 14:26:26 -0600 Subject: [PATCH 4/7] `refactor:` coderabbit improvements --- .../b2b-saas-per-usage-billing-setup.mdx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/content/docs/billing/implementation-guide/b2b-saas-per-usage-billing-setup.mdx b/src/content/docs/billing/implementation-guide/b2b-saas-per-usage-billing-setup.mdx index 073594b1e..27d04b21d 100644 --- a/src/content/docs/billing/implementation-guide/b2b-saas-per-usage-billing-setup.mdx +++ b/src/content/docs/billing/implementation-guide/b2b-saas-per-usage-billing-setup.mdx @@ -141,7 +141,7 @@ Organization administrators require a role that allows them to manage billing. 2. Select **Add role** 3. Configure: - **Name:** Billing Admin - - Key: billing-admin + - **Key:** billing-admin - **Assign to the creator if organizations self-sign up:** Enabled - **System permission:** `org:write:billing` 4. Save @@ -152,8 +152,7 @@ Users with this role can manage subscriptions, plans, and payment methods for th Enable organization creation during signup. -**Settings → Environment → Organizations** - +- Go to **Settings → Environment → Organizations** - Enable **Organization creation during signup** @@ -198,7 +197,7 @@ https://.kinde.com/oauth2/auth Once an organization exists, additional users can join using multiple supported approaches. -- The appropriate authentication method is enabled +- The appropriate authentication (email + password, email + code, etc.) method is enabled - **Org → Policies → Allow org members to be auto-added** is enabled From 678092e691b211c04f154adf397b271c80e04898 Mon Sep 17 00:00:00 2001 From: Roshan Chapagain Date: Fri, 16 Jan 2026 11:27:15 -0600 Subject: [PATCH 5/7] `add:` screenshots for clarity --- .../implementation-guide/b2b-saas-per-usage-billing-setup.mdx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/content/docs/billing/implementation-guide/b2b-saas-per-usage-billing-setup.mdx b/src/content/docs/billing/implementation-guide/b2b-saas-per-usage-billing-setup.mdx index 27d04b21d..8a30a254d 100644 --- a/src/content/docs/billing/implementation-guide/b2b-saas-per-usage-billing-setup.mdx +++ b/src/content/docs/billing/implementation-guide/b2b-saas-per-usage-billing-setup.mdx @@ -63,6 +63,7 @@ Create a billing plan with a **metered feature** representing users or seats. Th 4. Provide a name, description, key, and currency 5. Save the plan +![Create an organization plan](https://imagedelivery.net/skPPZTHzSlcslvHjesZQcQ/1c756f99-8534-4805-8b42-5e8a6ee48b00/public) ### Add a metered feature to the plan @@ -113,6 +114,7 @@ If your pricing model requires a fixed base fee: - Example name: `Base subscription fee` - The price can be `$0.00` if billing is fully per-user +![Base subscription fee](https://imagedelivery.net/skPPZTHzSlcslvHjesZQcQ/fbbe9660-8386-4791-f06b-52f7c787e900/public) ### Publish the plan From 83bb54c52697966a393ed6be3db8f6b3662d331b Mon Sep 17 00:00:00 2001 From: Roshan Chapagain Date: Fri, 16 Jan 2026 11:32:42 -0600 Subject: [PATCH 6/7] `fix:` typo in Sign in --- .../implementation-guide/b2b-saas-per-usage-billing-setup.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/billing/implementation-guide/b2b-saas-per-usage-billing-setup.mdx b/src/content/docs/billing/implementation-guide/b2b-saas-per-usage-billing-setup.mdx index 8a30a254d..615b9963e 100644 --- a/src/content/docs/billing/implementation-guide/b2b-saas-per-usage-billing-setup.mdx +++ b/src/content/docs/billing/implementation-guide/b2b-saas-per-usage-billing-setup.mdx @@ -223,7 +223,7 @@ Sign up ```jsx -Signin +Sign in ``` From 89239c9cc7394b4b97b0a56fa021b31afdc54e52 Mon Sep 17 00:00:00 2001 From: Roshan Chapagain Date: Fri, 16 Jan 2026 14:33:45 -0600 Subject: [PATCH 7/7] `fix:` updates docs to match new kinde style --- .../b2b-saas-per-usage-billing-setup.mdx | 272 +++++++++--------- 1 file changed, 143 insertions(+), 129 deletions(-) diff --git a/src/content/docs/billing/implementation-guide/b2b-saas-per-usage-billing-setup.mdx b/src/content/docs/billing/implementation-guide/b2b-saas-per-usage-billing-setup.mdx index 615b9963e..2ed3e1e21 100644 --- a/src/content/docs/billing/implementation-guide/b2b-saas-per-usage-billing-setup.mdx +++ b/src/content/docs/billing/implementation-guide/b2b-saas-per-usage-billing-setup.mdx @@ -3,7 +3,7 @@ page_id: 9c7d4e5a-6b8f-4c2a-9e3d-1f5a7c8b2d6e title: B2B SaaS billing with organizations and per-user pricing sidebar: order: 1 -description: Implement a standard B2B SaaS architecture in Kinde with organization-scoped access control, administrator-managed billing, and per-user pricing via metered features. +description: Implement a standard B2B SaaS architecture with organization-scoped access control, administrator-managed billing, and per-user pricing using metered features. metadata: topics: [billing, b2b, organizations, per-user pricing, metered usage, implementation] sdk: [] @@ -14,149 +14,161 @@ metadata: updated: 2026-01-15 featured: false deprecated: false -ai_summary: Complete guide to implementing B2B SaaS billing in Kinde with organizations, per-user seat-based pricing, metered features, and multiple user join patterns for administrators to manage subscriptions. +ai_summary: Complete guide to implementing B2B SaaS billing with organizations, per-user seat-based pricing, metered features, and administrator-managed subscriptions. --- -This guide describes how to implement a **standard B2B SaaS architecture** in **Kinde** using: +This guide explains how to implement a **standard B2B SaaS billing architecture** using organizations, administrator-managed billing, and **per-user (seat-based) pricing** with metered features. + +By the end of this guide, you will have: - Organization-scoped access control -- Administrator-managed billing -- Fixed **per-user (seat-based)** pricing via metered features +- A per-user billing model backed by metered features +- A billing admin role to manage subscriptions - Multiple supported organization join patterns +- A strategy for tracking seat usage accurately + -This guide is intended for developers building B2B products on Kinde, who want to reproduce a typical organization-based billing model. -## Guide Overview +### What you need -The recommended high-level implementation flow is: +- A Kinde account +- A Stripe account +- An application connected to Kinde +- Access to the Kinde dashboard -1. Configure a per-user billing plan -2. Define who can manage billing at the organization level -3. Enable organization creation -4. Handle the first user (organization creator) -5. Allow additional users to join the organization -6. Track seat usage for billing -Kinde is **API-first and flexible**. Some organization join flows are supported out of the box, while others can be implemented using the Management API depending on product requirements. -## 1. Connect Stripe +## Step 1: Connect Stripe Connect your **Stripe** account from the Kinde dashboard. -Notes: +1. Go to **Dashboard > Billing > Payment management** +2. Select **Connect Stripe** +3. Follow the Stripe onboarding flow + +After connecting Stripe: - Test and live environments are supported -- Published plans are automatically synced to Stripe +- Billing plans published in Kinde automatically sync to Stripe - Stripe products and prices are managed by Kinde **Learn more:** [Manage Stripe connection](https://docs.kinde.com/billing/payment-management/manage-stripe-connection/) -## 2. Configure a per-user billing plan -Create a billing plan with a **metered feature** representing users or seats. The plan must be created for **Organizations**. -### Create an organization plan +## Step 2: Create an organization billing plan -1. Go to **Billing** +Create a billing plan that is scoped to **Organizations**. + +1. Go to **Dashboard > Billing** 2. Select **Add a plan** 3. In **This plan is for**, select **Organizations** -4. Provide a name, description, key, and currency -5. Save the plan +4. Enter a name, description, key, and currency +5. Select **Save** ![Create an organization plan](https://imagedelivery.net/skPPZTHzSlcslvHjesZQcQ/1c756f99-8534-4805-8b42-5e8a6ee48b00/public) -### Add a metered feature to the plan +This plan represents the subscription that organizations will purchase. + + -1. In the plan, scroll to **Features and pricing** -2. Select **Add feature** -3. Choose **New metered** +## Step 3: Add a metered feature for user seats + +Add a **metered feature** to represent per-user (seat-based) pricing. + +1. Open the organization plan +2. Scroll to **Features and pricing** +3. Select **Add feature** +4. Select **New metered** Configure the feature: -- **Feature name** - - `Users` - -- **Key** - - `user` - - This key is required when submitting metered usage. - -- **Maximum units** - - Leave empty for unlimited users, or set a limit if required. - -- **Unit measurement name** - - `user` or `seat` - -- **Pricing model** - - Per unit - -- **Price per unit** - - Fixed price per user - -- **Line item description** - - Example: `User seats` - - -Save the feature. - -### Optional: Add a base subscription charge - -If your pricing model requires a fixed base fee: - -- Add a fixed charge to the plan -- Example name: `Base subscription fee` -- The price can be `$0.00` if billing is fully per-user +- **Feature name:** `Users` +- **Key:** `user` + This key is required when submitting metered usage. +- **Maximum units:** + Leave empty for unlimited users, or set a limit if required. +- **Unit measurement name:** `user` or `seat` +- **Pricing model:** Per unit +- **Price per unit:** Fixed price per user +- **Line item description:** `User seats` + +Select **Save**. + + + +## Step 4: Add an optional base subscription charge + +If your pricing model requires a fixed base fee in addition to per-user pricing: + +1. In the same plan, select **Add feature** +2. Select **Fixed charge** +3. Configure the feature: + - **Name:** Base subscription fee + - **Price:** Optional (can be `$0.00`) ![Base subscription fee](https://imagedelivery.net/skPPZTHzSlcslvHjesZQcQ/fbbe9660-8386-4791-f06b-52f7c787e900/public) -### Publish the plan +This allows you to combine a flat subscription fee with per-user billing. + + + +## Step 5: Publish the billing plan + +Billing plans must be published before they can be used. -Plans must be **published** before they: +1. Open the billing plan +2. Select **Publish** -- Appear in pricing tables -- Are selectable during signup -- Sync to Stripe +After publishing, the plan: -## 3. Generate a pricing table +- Appears in pricing tables +- Can be selected during signup +- Syncs to Stripe -1. Go to **Dashboard → Billing → Pricing tables** + + +## Step 6: Create a pricing table + +Pricing tables allow users to select a plan during signup. + +1. Go to **Dashboard > Billing > Pricing tables** 2. Create or customize a pricing table 3. Toggle **Make live** -The pricing table key is required when initiating signup with plan selection. +Save the **pricing table key**, as it is required during signup. -## 4. Create a Billing Admin role -Organization administrators require a role that allows them to manage billing. +## Step 7: Create a Billing Admin role -**Steps** +Organization billing should be managed by administrators. -1. Go to **Settings → Roles** +1. Go to **Settings > Roles** 2. Select **Add role** -3. Configure: - - **Name:** Billing Admin - - **Key:** billing-admin - - **Assign to the creator if organizations self-sign up:** Enabled - - **System permission:** `org:write:billing` -4. Save +3. Configure the role: + - **Name:** Billing Admin + - **Key:** `billing-admin` + - **Assign to the creator if organizations self-sign up:** Enabled + - **System permission:** `org:write:billing` +4. Select **Save** Users with this role can manage subscriptions, plans, and payment methods for their organization. -## 5. Organization creation (first user) -Enable organization creation during signup. -- Go to **Settings → Environment → Organizations** -- Enable **Organization creation during signup** +## Step 8: Enable organization creation during signup + +Allow users to create organizations when signing up. +1. Go to **Settings > Environment > Organizations** +2. Enable **Organization creation during signup** + + + +## Step 9: Handle the first user (organization creator) + +The first user creates the organization and selects a plan. ### Trigger organization creation from your application @@ -166,14 +178,13 @@ Enable organization creation during signup. isCreateOrg pricingTableKey="your_pricing_table_key" > -Sign up your company + Sign up your company - ``` -### Direct authorization URL +### Use a direct authorization URL -``` +```bash https://.kinde.com/oauth2/auth ?response_type=code &client_id=YOUR_CLIENT_ID @@ -181,11 +192,9 @@ https://.kinde.com/oauth2/auth &scope=openid profile email &is_create_org=true &pricing_table_key=YOUR_PRICING_TABLE_KEY - ``` - -### Signup flow behavior +### Organization Signup behavior 1. The user registers 2. A new organization is created @@ -195,57 +204,52 @@ https://.kinde.com/oauth2/auth 6. The organization is created with an active subscription -## 6. Adding users to an existing organization -Once an organization exists, additional users can join using multiple supported approaches. +## Step 10: Add users to an existing organization -- The appropriate authentication (email + password, email + code, etc.) method is enabled -- **Org → Policies → Allow org members to be auto-added** is enabled +Additional users can join an existing organization using multiple supported approaches. +Before enabling any join flow: +- Ensure the required authentication methods are enabled +- Go to **Org > Policies** and enable **Allow org members to be auto-added** -### Option 1: Manual addition (dashboard) - -- No custom code required -- Intended for internal or low-volume use +### Option 1: Manually add users (dashboard) +Administrators can add users directly from the dashboard. +- No custom code required +- Intended for internal or low-volume usage -### Option 2: Self sign-up using `orgCode` (recommended) +### Option 2: Allow self sign-up using an organization code (recommended) -Users sign up or log in using an organization code. +Users join by signing up or logging in with an organization code. ```jsx -Sign up + Sign up ``` ```jsx -Sign in + Sign in ``` - - Behavior: -- User authenticates -- User is automatically added to the specified organization - -This is the **recommended default** for most B2B SaaS applications. - +- The user authenticates +- The user is automatically added to the organization +This is the recommended default for most B2B SaaS applications. ### Option 3: Auto-add users from allowed domains -Users are automatically added to an organization based on their email domain. - -Enable: +Users are automatically added based on their email domain. -1. Allow org members to be auto-added -2. Enable auto-add users from allowed domains +1. Enable **Allow org members to be auto-added** +2. Enable **Auto-add users from allowed domains** 3. Add allowed domains (for example, `company.com`) Example: @@ -254,9 +258,9 @@ A user signing up with `jane@acme.com` is automatically added to the Acme organi -## 7. Tracking seat usage for billing +## Step 11: Track seat usage for billing -Kinde does **not automatically calculate seat counts** for metered billing. Applications must submit usage updates. +Kinde does not automatically calculate seat counts for metered billing. Your application must submit usage updates. ### When to submit usage @@ -268,21 +272,31 @@ Common triggers include: ### How to submit usage -Usage can be submitted using: +Submit usage using one of the following: - Management API -- Workflows (example: [Track org seat usage workflow](https://github.com/kinde-starter-kits/workflow-examples/blob/main/billing/trackOrgSeatUsageWorkflow.ts)) +- Workflows + Example: [Track org seat usage workflow](https://github.com/kinde-starter-kits/workflow-examples/blob/main/billing/trackOrgSeatUsageWorkflow.ts) - Billing webhooks -This ensures billed usage reflects the number of **active users** in the organization. +This ensures billing reflects the number of active users in the organization. + ## Troubleshooting ### Pricing table not shown during signup -Verify: +Verify the following: - The pricing table is **live** -- **Settings → Billing → Billing experience → Show pricing table during signup** is enabled -- The `pricingTableKey` matches the intended pricing table \ No newline at end of file +- **Settings > Billing > Billing experience > Show pricing table during signup** is enabled +- The `pricingTableKey` matches the intended pricing table + + + +## Conclusion + +You now have a complete B2B SaaS billing setup with organization-scoped access control, administrator-managed subscriptions, and per-user pricing using metered features. + +From here, you can extend this architecture with additional metered features, scheduled usage reconciliation, or custom organization join flows using the Management API. \ No newline at end of file