Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

jlmmns's avatar
Level 12

SaaS application billable entity

What should be the billable entity in a SaaS application when working with Teams?
Pretty much comparable to the popular messaging app Slack.

Relationships:

Relationships
----------------------------
Team belongsTo Plan (Free, Business, Pro)
Team <-- many-to-many --> User

Every Team has one owner (User).

The billing is per Plan only (not per every User)

Since I want to have recurring payments going through Stripe, I'm wondering where I should put the Billable trait on? Team, or User?

Also important, an Owner can have more than one Team, and should be able to manage each Team's subscription in one place.

So which models do I end up with?
So far, I only have: Plan, Team, User
Should I also have something like Account or Owner?

Any help would be much appreciated!

PS: Too bad Spark is only in alpha stage.

0 likes
5 replies
martinbean's avatar
Level 80

@jlmmns Depends what you want to bill. If it’s by team, then the team is the billing entity. Maybe give users the ability to add a payment method to the team, where they can then hook up the team to that organisation’s stripe account.

1 like
jlmmns's avatar
Level 12

@martinbean Since a Team is on a subscription, the Team should get the Billable trait then?

That makes sense, yes.
So the Team model will end up having the billing details.

But then how can the owner manage multiple teams' subscription in one place?
I should keep the Team's billing details in sync, when the owner updates them.
Or am I over-thinking things? (I tend to do that a lot)

I guess I should just keep it all separated. Keep it simple.
It's possible that the owner wants different billing details for each Team anyway, right?
It shouldn't be my decision to keep those details in sync.

martinbean's avatar

@jlmmns I’m not sure I follow. Surely each team would have its own subscription? What would you be needing to keep in sync?

jlmmns's avatar
Level 12

@martinbean Say a User owns 2 Teams.

My first instinct was to keep each Team's billing details in sync, since they belong to the same owner.
But on second guess, it's not up to me to make that decision.
Because the owner maybe wants different billing details for each Team.

So you can ignore my "keep in sync" reasoning. :)

Thanks for your help!

martinbean's avatar

@jlmmns Yeah, you wouldn’t want to “cross-pollinate” things like billing details across teams. If a user wants to use one Stripe account for one team, and another Stripe account for a second team, let them. It may be a case they’ve created a team on your platform for their day job and another team for say, freelance work. They definitely wouldn’t want to use the same Stripe account in that instance.

1 like

Please or to participate in this conversation.