Using WooCommerce as a SaaS billing system, and keeping things simple(r) with WooCommerce Subscriptions
Published | Last Update
If you're starting a SaaS business, the billing system can be one of the main issues to overcome.
1,076 view, 1 RAM, and 4 comments
- #1 You need recurring payments
- #2 You want to be able to switch between payment gateways easily
- #3 You want to spend more time building the actual software, instead of things like billing systems
- #4 You need to incorporate something as simple as coupons
- #5 You want to easily integrate third party apps like MailChimp
- #6 You want to automate invoicing
- #7 You want to calculate taxes on checkout
- #8 You need users to be able to upgrade or downgrade subscriptions
- #9 You want to offer a limited trial
- #10 You need multiple billing schedules
- #11 You need automatic re-billing
- #12 Customers should be able to manage their subscriptions
- #13 You don’t want to build a billing admin panel
- Why is doing these things easier with WooCommerce?
- What else do you need in order to get your SaaS web application to work with WooCommerce?
- Managing Databases
- Registering users and authentication
It's really nothing new that WooCommerce opens up a whole world of possibilities when it comes to running something like an online store. Chances are, if you need a great deal of customisation, you're probably way better off using Wordpresswith WooCommerceand the Woocommerce Subscriptions plugin instead of coding the full thing from scratch.
If you’re bootstrapping a SaaS business, every penny counts, and if you can save time and money by using something already available, you should probably do so. Sure, if we were talking about an online store, then using a WooCommerce alternative like Shopify (especially if you can’t code for shit) is a viable option. However, if you need different ways to customise anything and everything, as you probably will with a SaaS business, Shopify isn’t really an option. Plus, you use WooCommerce ALONG with Wordpress, you probably won’t want your SaaS landing page to look like an ecommerce store (or however Shopify looks) anyway.
If you want to start a software as a service business, you're going to come across a number of problems that you will need to solve. Some of those problems include coming up with a billing system that can not only work with recurring payments, but can work across multiple gateways, and which lets customers upgrade, downgrade, or cancel orders as they wish, among other things.
Before I get more technical, let's take a deeper look at some of the development issues you can come across when building a SaaS, and why any of these could be a major headache if you had to code everything from scratch, as well as how we can solve these problems with WooCommerce.
#1 You need recurring payments
This is the obvious one, but if you're starting a web-based software service, you will probably have a monthly, yearly, or some other type of recurring payment option (if you have any brains). This opens up the issue of having to build a subscription system that not only charges users on a monthly basis, but also does so securely, while giving you control over the whole process. Building this from scratch creates all sorts of issues you can't even think of. The WooCommerce Subscriptions plugin let’s you do all this with a few clicks. Sure, it costs $200, but see what a developer will charge in order to build this properly and get back to me.
Now, before you say something stupid like how recurring billing is easy to setup with PayPal, let me continue to the next point.
#2 You want to be able to switch between payment gateways easily
Sure, PayPal is nice and useful and handy. Until they ban your ass for whatever reason they come up with, or because you had one refund too many, or because you live in a shithole that doesn’t even allow you to use PayPal in the first place. Now you may need to use Stripe, 2CheckOut, or some other merchant service, which you need to incorporate into your app’s billing system.
#3 You want to spend more time building the actual software, instead of things like billing systems
Perhaps you were smart and decided to go with both PayPal and Stripe as options for your recurring payments. Needless to say, that’s twice the work, and a larger time and money investment. Careful how you handle that credit card data, too, if you’re coding this yourself. If you’re paying someone to do it for you, you sure better trust them.
#4 You need to incorporate something as simple as coupons
Let's say you want your customers to be able to use a coupon code at checkout. Pretty simple, right? Now, you also want to be able to add and delete coupon codes as you see fit. This will require additional checkout options, as well as an admin panel where you manage the coupons from. Now, are they percentage coupons or are they a fixed amount coupons? What if you want to switch between the two? Whether you're building this yourself or paying a developer by the hour, you better have the resources to get this done. Or, you could just use WooCommerce and save yourself the trouble.
#5 You want to easily integrate third party apps like MailChimp
You may want to subscribe all your customers to a mailing list. Or ask them if they’d like to sign up for your mailing list on checkout. You may even be the wild kind who wants to integrate Zapier and Google Sheets and notify Zuck of your every order. Guess what, that’s more APIs that you incorporate with your billing/checkout system. By using Wordpress and WooCommerce instead, it’s as simple as installing a plugin or adding an extra checkbox on checkout.It’s what you would call, and I’m not exaggerating, “very easy”.
#6 You want to automate invoicing
If you’re selling software, you will probably need to have some sort of invoicing system. Optimally, you don’t want to be making these by hand (or those computer things) and then mailing them to every customer who requests one.
#7 You want to calculate taxes on checkout
If you live in homosexual Europe you probably need to calculate VAT, and unless you’re 12 or live in a shithole that doesn’t even have PayPal where you can get away with tax evasion or you're John McAfee, you will need to do this. Different European countries have different VAT rates though, you either go through the painful process of figuring that out, or you let something like the WooCommerce EU VAT Compliance Assistant do it for you.
#8 You need users to be able to upgrade or downgrade subscriptions
This is an obvious one, but let’s say someone wants to upgrade their subscription plan. Surely, you want to take their money. So, what do you do? Refund their previous order, charge them the additional amount, what? You let WooCommerce handle it for you.
#9 You want to offer a limited trial
You’re probably picking this up by now, but again, this is easily doable with WooCommerce - want to charge them after three days, seven, two weeks? No problem.
#10 You need multiple billing schedules
If you offer something like a quarterly billing plan, that’s again more work that you need to do, and like I said, it usually gets more complicated the more payment gateways and options you have. WooCommerce Subscriptions allows you to manage these easily.
#11 You need automatic re-billing
Did a payment fail because the user didn’t have enough funds? WooCommerce can easily try to charge them again.
#12 Customers should be able to manage their subscriptions
If someone wants to cancel their subscription easily, you’re better off letting them do that easily, instead of waiting for the next charge and then having to issue a refund. What if they wanted to change their payment method or shipping address?
#13 You don’t want to build a billing admin panel
Building admin panels is a pain in the neck. You need to design them, code them, and secure them. Plenty of work for something as simple as managing a software subscription. Why build it if you don’t have to?
Why is doing these things easier with WooCommerce?
Glad you asked! The other main reason why doing all of the above is way easier with WooCommerce Subscriptions, other than the nice admin panel and dozens of plugins that make everything easier, is a little thing called Woocommerce Subscriptions Actions (Webhooks).
A webhook is how an application informs other applications. For example, let’s say you want to register a user and send them a confirmation email AFTER they paid, and before they can login.
You can use something like the 'woocommerce_checkout_subscription_created' action found here,which basically does whatever you program it to after a subscription to your web app was purchased.
If they cancel or upgrade/downgrade their subscription, you can use 'woocommerce_subscription_status_updated', which will fire whenever a subscription status was updated. This way you can make sure people can no longer use your monthly payment app, if they haven’t paid for it.
What else do you need in order to get your SaaS web application to work with WooCommerce?
When it comes to databases, if you use both WooCommerce Subscriptions for payments and another web app built in the stack of your choice, you have two options:
- Share the same database, or
- Keeping both the WP and app databases synchronized
Both of these are viable options, depending on your needs. If you allow the users to store a lot of data in their account, or don’t want to use MySQL, the second options is probably better. Keep in mind that by opting for this option, you need to keep all user data synchronized, so things get a little more challenging when it comes to things like password resets, and you will probably need to use the same encryption for both. Still doable, though.
If you decide to share the same database, your app will need to work with the Wordpress DB, and you will be querying the wp_users table. Still doable, but not what I would go for if my subscribers had to store a lot of data.
Registering users and authentication
Unless you're sharing the same database, you also have two options here:
- First register them through Wordpress
- First register them through your app
If you decide to go with the first option, you will probably want to allow registration only through checkout. This means that whenever a user is registered, you will use the 'woocommerce_checkout_subscription_created' hook to also register them in your app (that is, if you’re not sharing the WP database). This may not be too convenient if you want have a free, non-trial option with which you simply want to let users have a sneak peak of your app.
If you’re doing the registration through your app first, you will need to create a custom endpoint with the Wordpress REST API, which is called when a user is registered through your app. However, if you want to redirect users to checkout with WooCommerce after they’ve registered through your app, you may want to keep them logged in so they don’t have to login on the Wordpress site separately.
You can do this by either logging them in programmatically with something like a one time token from sent as a URL parameter or whatever and by using something like wp_set_auth_cookie(),or by sharing the same auth token between Wordpress and your app. The second option is the better long term solution, and less of a hack.
Keep in mind that you probably also want the users to confirm their email at some point before they can login in to use the app in order to prevent abuse, which you can do after the first successful payment. Also, if you’re using two databases and they decide to reset their password, you will need to keep the two password hashes synced (which is why I mentioned using the same encryption), and thus call the appropriate endpoints when a password is changed to update it in either WP or your app. When it comes to authenticating where the call comes from, you can simply use the WP/app’s server (preferably dedicated) IP address in order to do so, and block all calls to said endpoints if they don’t originate from there.
There’s also plenty of other different ways to do the things I described. Anyway, hope this brings some ideas of things you can do with WooCommerce to make your SaaS development easier.
- How to Make a Website: A Simple Guide for Complete Beginners
- 5 Tasks You Didn't Know Could be Done from the Developer Console
- Using WooCommerce as a SaaS billing system, and keeping things simple(r) with WooCommerce Subscriptions
- The Ultimate WordPress Performance Resource
- How much is my website worth?
- GeneratePress: Total overview of what it can offer and why it's the only theme I use.
- DreamHost: Review, FAQ, and Affiliate Program
- Get These Dependencies Off My Lawn: 5 Tasks You Didn't Know Could be Done with Pure HTML and CSS
- How to Parse a User Agent in PHP with Minimal Effort
- Best PHP Frameworks
I sell rare words
This is smart.
Have you come across any limitations with woocommerce yet?
Are there other SaaS's out there using this that you know of?
"THAT DOG IS GETTING RAPED" - Terry A. Davis
So far so good, and a SaaS I'm working on using WooCom is almost finished. Some expected programming challanges, but nothing a bunch of googling, cocaine, and dreaming about functions couldn't solve.
In terms of SaaS business using WooCommerce (or even WordPress, for that matter), there is a surprisingly low number of them. I always knew it was a possibility, but apparently it isn't something most SaaS businesses have thought of as far as I'm aware, unless if there's something I'm missing. Plebs on Quora, apart from promoting bs, seem to think that building a SaaS with WooCommerce is uncomfortable because "most new themes on woocommerce all look the same". If anyone building a SaaS feels the same, they probably shouldn't be building a SaaS.
i am building a SAAS and using woocommerce to handle the billing. pretty much exactly the same way as you described in this post! i would gladly share the name of the project but it hasn't launched yet as we're still trying to figure some things out.
specifically: user-authentication and limiting number of machines.
would you have any suggestions on how the software should communicate with the woocommerce database to ensure that the software is only actively open on one computer at all times? (i.e. prevent user abuse by distributing one account across multiple computers)
should the software send some sort of hardware ID together with the user information? how often should our software poll? and should woocommerce ping back some data to authenticate the user?
at the moment we can get logging in to work already so technically this is the last step..
any help would be great!
Post a New Comment
Do you like having a good time?
Register an Account
Read Quality Articles
Read some quality articles. If you can manage to not get banned for like five minutes, you can even post your own articles.
Argue with People on the Internet
Use your account to explain why people are wrong on the Internet forum.
Vandalize the Wiki
Or don't. I'm not your dad.
Ask and/or Answer Questions
If someone asks a terrible question, post a LMGTFY link.
Make Some Money
Hire freelancers and/or advertise your goods and/or services. Hire people directly. We're not a middleman or your dad. Manage your own business transactions.