[PR #7951] [MERGED] fix(stripe): drop metered billing, use generic lineItems instead #33250

Closed
opened 2026-04-17 23:53:59 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/7951
Author: @bytaesu
Created: 2/12/2026
Status: Merged
Merged: 2/12/2026
Merged by: @bytaesu

Base: canaryHead: 2026-02-13/fix/stripe-drop-metered-billing


📝 Commits (1)

  • fe84d45 fix(stripe): drop metered billing, use generic lineItems instead

📊 Changes

8 files changed (+15 additions, -456 deletions)

View changed files

📝 packages/stripe/src/error-codes.ts (+0 -1)
📝 packages/stripe/src/index.ts (+1 -4)
📝 packages/stripe/src/routes.ts (+2 -89)
📝 packages/stripe/src/types.ts (+2 -4)
📝 packages/stripe/src/utils.ts (+1 -46)
packages/stripe/test/metered-billing.test.ts (+0 -271)
📝 packages/stripe/test/seat-based-billing.test.ts (+8 -8)
📝 packages/stripe/test/utils.test.ts (+1 -33)

📄 Description

Metered billing is basically just part of lineItems, and exposing ingestUsage as an HTTP endpoint introduces clear performance limitations. Instead, we'll adopt a more flexible lineItems-based structure and provide guidance for metered billing in the documentation.


Summary by cubic

Removed the metered billing API and shifted plans to generic lineItems for checkout. This simplifies Stripe usage and removes the performance bottleneck of HTTP usage ingestion.

  • Refactors

    • Removed /subscription/usage/ingest endpoint and stripeIngestUsage export.
    • Checkout now uses plan.lineItems (metered prices, add-ons, etc.) instead of meters.
    • Deleted UNKNOWN_METER error and related validation/customer lookup helpers.
    • Cleaned up types/exports and removed metered billing tests.
  • Migration

    • Update StripePlan: replace meters with lineItems, e.g. lineItems: [{ price: "price_meter_api" }].
    • Remove any calls to auth.api.stripeIngestUsage; send usage to Stripe directly following Stripe’s metered billing docs.
    • No changes needed for seat-based billing; seatPriceId continues to work.

Written for commit fe84d45e88. Summary will update on new commits.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/7951 **Author:** [@bytaesu](https://github.com/bytaesu) **Created:** 2/12/2026 **Status:** ✅ Merged **Merged:** 2/12/2026 **Merged by:** [@bytaesu](https://github.com/bytaesu) **Base:** `canary` ← **Head:** `2026-02-13/fix/stripe-drop-metered-billing` --- ### 📝 Commits (1) - [`fe84d45`](https://github.com/better-auth/better-auth/commit/fe84d45e88f6d39b71329a3323dc0a790cc49449) fix(stripe): drop metered billing, use generic lineItems instead ### 📊 Changes **8 files changed** (+15 additions, -456 deletions) <details> <summary>View changed files</summary> 📝 `packages/stripe/src/error-codes.ts` (+0 -1) 📝 `packages/stripe/src/index.ts` (+1 -4) 📝 `packages/stripe/src/routes.ts` (+2 -89) 📝 `packages/stripe/src/types.ts` (+2 -4) 📝 `packages/stripe/src/utils.ts` (+1 -46) ➖ `packages/stripe/test/metered-billing.test.ts` (+0 -271) 📝 `packages/stripe/test/seat-based-billing.test.ts` (+8 -8) 📝 `packages/stripe/test/utils.test.ts` (+1 -33) </details> ### 📄 Description Metered billing is basically just part of lineItems, and exposing ingestUsage as an HTTP endpoint introduces clear performance limitations. Instead, we'll adopt a more flexible lineItems-based structure and provide guidance for metered billing in the documentation. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Removed the metered billing API and shifted plans to generic lineItems for checkout. This simplifies Stripe usage and removes the performance bottleneck of HTTP usage ingestion. - **Refactors** - Removed /subscription/usage/ingest endpoint and stripeIngestUsage export. - Checkout now uses plan.lineItems (metered prices, add-ons, etc.) instead of meters. - Deleted UNKNOWN_METER error and related validation/customer lookup helpers. - Cleaned up types/exports and removed metered billing tests. - **Migration** - Update StripePlan: replace meters with lineItems, e.g. lineItems: [{ price: "price_meter_api" }]. - Remove any calls to auth.api.stripeIngestUsage; send usage to Stripe directly following Stripe’s metered billing docs. - No changes needed for seat-based billing; seatPriceId continues to work. <sup>Written for commit fe84d45e88f6d39b71329a3323dc0a790cc49449. Summary will update on new commits.</sup> <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-17 23:53:59 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#33250