Introduction
In the world of tech startups, billing is often seen as a necessary evil, a complex and tedious area that few developers enjoy. However, effective billing is crucial for the financial health of the company. Bryan Mikaelian, in his article on the exe.dev blog, shares an innovative approach to simplify this process using what he calls "billable facts."
The Challenge of Billing
Billing quickly becomes a nightmare when billing logic gets tangled with business logic. This leads to code that's hard to maintain and brittle pricing structures. Even a minor modification can require an expensive rewrite of the billing system, which few startups can afford.
For instance, consider adding a user to a team. This involves several steps: invitation, acceptance, account verification, resource allocation, etc. Each of these steps can impact billing, and if something fails, it can cause significant complications.
Billable Facts: A New Approach
Instead of embedding billing API calls at every step of the code, Mikaelian proposes generating "billable facts." These facts are events produced by the system that inform the billing module of changes potentially requiring a billing update.
Take the example of a user joining a team on a platform like exe.dev. Every step of this process generates a billable fact, which is then processed by the billing system. This centralizes the billing logic and makes it more robust against failures.
Advantages of Billable Facts
- Robustness: In case of a transaction or API call failure, the billable fact remains recorded and can be retried.
- Scalability: It's easier to add new features without rewriting the billing logic.
- Clarity: Developers can focus on product development without worrying about affecting billing.
Use Cases and Figures
According to a Chargebee study, companies that streamline their billing processes see a 30% reduction in billing errors and a 20% increase in customer satisfaction. Billable facts can contribute to these improvements by reducing complexity and risks associated with traditional billing systems.
Conclusion
Billing should not be a barrier to innovation. By adopting methods such as billable facts, startups can focus on what they do best: innovating and growing.
Let's discuss your project in 15 minutes.