Image for post
Image for post

BSBS: Building Solid Billing Systems

One of my first tasks at InterConn was to set up a billing system. We did not have many requirements, so we evaluated a lot of SaaS options. Now, there’s no shortage of billing SaaS — unfortunately, though, none of them could handle our particular rated billing process, except for JBilling, which was awesome but definitely out of our budget’s reach (in retrospect, Stripe might have been a good solution — I just didn’t know about it at the time).

Data Integrity Is Paramount

If you only take one thing away from this article, here it is: you don’t fuck with data when you’re building a billing system. Here’s what happens otherwise:

  1. you bill your clients for two years;
  2. you edit the product’s price to be $65;
  3. you end up with hundreds of partially unpaid invoices which your system sends hundreds of notifications for.
  1. you can version your associated records, and link the invoice to a specific version of the records.

Caching Is Okay, Really

I am writing a series of articles on how powerful relational databases are and how little of their power we harness in day-to-day development. Yet here I am, telling you to cache calculated values. And I have my reasons.

  • no performance bottlenecks;
  • no app crashes because data has been deleted that was needed to calculate the value.

Currency Is Not Your Friend

Saying that working with currency is a pain in the ass would be a huge understatement. However, the same can be said for regular expressions and a lot of other stuff. If you take a few precautions when designing your app, you can pretty much avoid any currency problems.

Maintain Flexibility

One mistake people often make is tying their billing logic with their business logic. Invoices, invoice items, discounts etc. should be as general as possible in their design and implementation.

Technology leader and strategic advisor. I work at the intersection of people, software and words.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store