[GH-ISSUE #3772] [STRIPE] Plugin should support stripe subscription id for organizations #27042

Closed
opened 2026-04-17 17:50:26 -05:00 by GiteaMirror · 5 comments
Owner

Originally created by @sigma-andex on GitHub (Aug 4, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/3772

Currently the stripe subscription id is always on the user. In case of using organizations, the stripe subscription id should however be on the organization, or at least it should be possible to set it on the organization.

Problem

Here is a simple scenario:

Imagine freelancer Bob Wilson working for two corporations Acme Corporation and Krusty Krab.
If he buys a subscription for Acme Corp., a stripe user will be created in stripe and the billing address will be set to Acme Corp's billing address. Now when he buys another subscription for Krusty Krab, it will use the existing stripe customer id from the customer (since it was already created previously) and the the billing address for the user will be overwritten with the Krusty Krab's billing address.

This can potentially lead to some nasty problems with invoicing.

Solution

The plugin should support stripe customer ids on the organization and use these when organizations are enabled.

Temporary workaround

We have created a simple patch that allows to pass in an additional stripeCustomerId to the request (see attached pull request #3773 ). However this should only be done when using better-auth only backend-side. So we added a field stripe_customer_id on the subscription, then manually generate a new stripe customer id for each generation and pass in the organization's stripe customer id to the initial subscription request.

Originally created by @sigma-andex on GitHub (Aug 4, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/3772 Currently the stripe subscription id is always on the user. In case of using organizations, the stripe subscription id should however be on the organization, or at least it should be possible to set it on the organization. # Problem Here is a simple scenario: Imagine freelancer Bob Wilson working for two corporations Acme Corporation and Krusty Krab. If he buys a subscription for Acme Corp., a stripe user will be created in stripe and the billing address will be set to Acme Corp's billing address. Now when he buys another subscription for Krusty Krab, it will use the existing stripe customer id from the customer (since it was already created previously) and the the billing address for the user will be overwritten with the Krusty Krab's billing address. This can potentially lead to some nasty problems with invoicing. # Solution The plugin should support stripe customer ids on the organization and use these when organizations are enabled. # Temporary workaround We have created a simple patch that allows to pass in an additional stripeCustomerId to the request (see attached pull request #3773 ). However this should only be done when using better-auth only backend-side. So we added a field stripe_customer_id on the subscription, then manually generate a new stripe customer id for each generation and pass in the organization's stripe customer id to the initial subscription request.
GiteaMirror added the lockedenhancement labels 2026-04-17 17:50:26 -05:00
Author
Owner

@saturnonearth commented on GitHub (Aug 11, 2025):

Yea this is a desperately needed feature - personally I can't proceed with using Stripe without it. In my mind, this would be the least confusing way to manage this. Organizations are a business, and therefore should be tied to a Stripe customer. This would make it easier to switch owners of the business as well or hand off.

<!-- gh-comment-id:3175356782 --> @saturnonearth commented on GitHub (Aug 11, 2025): Yea this is a desperately needed feature - personally I can't proceed with using Stripe without it. In my mind, this would be the least confusing way to manage this. Organizations are a business, and therefore should be tied to a Stripe customer. This would make it easier to switch owners of the business as well or hand off.
Author
Owner

@kylegwalsh commented on GitHub (Aug 27, 2025):

Just came across this as well. In my application, I'm forcing all users to be associated with organizations (creating a default "Personal" organization during signup). Having everything attached to organizations greatly simplifies the database relations and it would be great to have stripe supported in the same way.

<!-- gh-comment-id:3226427298 --> @kylegwalsh commented on GitHub (Aug 27, 2025): Just came across this as well. In my application, I'm forcing all users to be associated with organizations (creating a default "Personal" organization during signup). Having everything attached to organizations greatly simplifies the database relations and it would be great to have stripe supported in the same way.
Author
Owner

@dosubot[bot] commented on GitHub (Nov 26, 2025):

Hi, @sigma-andex. I'm Dosu, and I'm helping the better-auth team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You requested that the Stripe plugin support storing subscription IDs at the organization level instead of the user level to avoid billing conflicts.
  • Several community members, including saturnonearth and kylegwalsh, have expressed strong support for this feature.
  • A temporary workaround exists, but native support in the plugin would provide a smoother and more reliable solution.
  • The issue has received multiple positive reactions, showing clear community demand.
  • The issue remains unresolved with no recent updates.

Next Steps:

  • Please let me know if this feature is still relevant to the latest version of the better-auth repository by commenting on this issue.
  • If I do not hear back within 7 days, the issue will be automatically closed.

Thank you for your understanding and contribution!

<!-- gh-comment-id:3582088919 --> @dosubot[bot] commented on GitHub (Nov 26, 2025): Hi, @sigma-andex. I'm [Dosu](https://dosu.dev), and I'm helping the better-auth team manage their backlog and am marking this issue as stale. **Issue Summary:** - You requested that the Stripe plugin support storing subscription IDs at the organization level instead of the user level to avoid billing conflicts. - Several community members, including saturnonearth and kylegwalsh, have expressed strong support for this feature. - A temporary workaround exists, but native support in the plugin would provide a smoother and more reliable solution. - The issue has received multiple positive reactions, showing clear community demand. - The issue remains unresolved with no recent updates. **Next Steps:** - Please let me know if this feature is still relevant to the latest version of the better-auth repository by commenting on this issue. - If I do not hear back within 7 days, the issue will be automatically closed. Thank you for your understanding and contribution!
Author
Owner

@sigma-andex commented on GitHub (Nov 27, 2025):

Still relevant and hopefully getting solved in #5952

<!-- gh-comment-id:3585919711 --> @sigma-andex commented on GitHub (Nov 27, 2025): Still relevant and hopefully getting solved in #5952
Author
Owner

@bytaesu commented on GitHub (Dec 2, 2025):

Hello @sigma-andex,

I haven’t finished #5952 yet due to other tasks, but I haven’t forgotten. I’ll wrap it up soon 🙂
I discussed something in that PR, could you share your thoughts on the preferred approach? I’ll complete it soon.

<!-- gh-comment-id:3603845011 --> @bytaesu commented on GitHub (Dec 2, 2025): Hello @sigma-andex, I haven’t finished #5952 yet due to other tasks, but I haven’t forgotten. I’ll wrap it up soon 🙂 I discussed something in that PR, could you share your thoughts on the preferred approach? I’ll complete it soon.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#27042