Simplifying Commerce for Small Business

This article was first published on in PHP Advent.

Selling has never been easy. There’s too much red tape. The simple act of you giving me currency in exchange for a good or service I provide is not so simple when you factor in sales tax, VAT, inventory, shipping, reporting income, and any number of other factors that require accounting and fulfillment to be a damned nightmare — and that’s just when you give me paper money! When dealing with online transactions and credit cards, it can be downright gruesome.

The early days of commerce on the Web were difficult, to say the least. If you wanted a comprehensive solution for your business, you needed a merchant account specifically for online transactions, and you needed to process transactions through a gateway that could connect to your merchant account. On top of that, you’d have to estimate sales tax and shipping rates, and handle fulfillment and inventory on your own.

Solutions are easier now for small businesses and the developers who work with them. Simple APIs exist for use at affordable rates to handle transaction processing, sales tax calculation, and fulfillment.


In the early days of the Web, if you rolled your own cart, you likely used services like Authorize.Net and VeriSign PayFlow Pro (now PayPal). For developers, these weren’t easy to integrate with. For small businesses, the online merchant account was a headache, and SSL certificates were expensive, so many opted to redirect their carts to a third party, where the transaction would take place and then redirect back to the business’s site. This did not provide a very good user experience.

Stripe is a new service aimed at developers and focused on simplifying transactions and integrations, allowing you to focus on user experience. They have a simple API and do not require a merchant account or gateway. In a sense, they are the gateway. They provide all the features you’d expect, including storing credit card data, offering the ability to set up subscription payments, and paying out directly to your bank account, but there’s no hassle. You simply accept the data from your own forms and send it to them over SSL. (You still need your own SSL certificate, but those are much cheaper these days.)


Many businesses choose to avoid the hassle of calculating sales tax on the front end, and bake it into the cost of the good or service, but this means there’s hassle on the accounting side at the end of the year. Your accountant must then determine where you have nexus (a fancy term for regions where you are required to collect sales tax), examine the shipping address of everyone who bought from you to see if they need to calculate sales tax, and, if needed, calculate the sales tax for that jurisdiction — or guess at it and (hopefully) overpay.

SpeedTax (recently acquired by CCH) provides a service with an easy-to-use API to reduce and eliminate this hassle. You can set up your SKUs within the SpeedTax system and categorize them so that SpeedTax will know how to calculate the sales tax according to each jurisdiction’s laws. Then, you specify where you have nexus. When you send a request to the SpeedTax API, you include the SKU and the shipping address of the customer. SpeedTax takes care of the rest and gives you back the appropriate sales tax that you should collect for that jurisdiction.


Fulfillment includes three different processes, none of which are easy for a small business to perform alone. The first is calculating shipping fees. This can be done online, but you have to make decisions about which provider to use (USPS, UPS, FedEx, DHL, &c.) and integrate with their API (APIs if you choose multiple providers). The second is determining whether you have the inventory required to fulfill the order. The third is actually picking, packing, and shipping the product. Most small businesses do this on their own at first, but if you want to scale your business, you’ll need to outsource this, so you can focus on running your business instead of shipping your product.

Shipwire provides all three of these services. Their APIs calculate shipping rates for a variety of vendors (which you can provide to your users as options), and you can store inventory within their global warehouses, so you can query their APIs to determine whether you can actually fulfill an order, based on inventory available. Furthermore, since you store your product in Shipwire’s warehouses, they will pick, pack, and ship your product based on API calls you make to their system.

Seize the Opportunity

When you or your clients are out and about, either at trade shows and conventions or just through the course of normal, everyday life, accepting payments whenever and wherever the opportunity arises is important.

Square provides a credit card reader and app for iOS and Android devices that allows you to swipe and accept credit cards virtually anywhere. They don’t provide any APIs, so they’re not an application integration tool, but if you have clients who need to accept payments online, then they likely to need to accept payments offline, so suggest this solution to improve their business. Square is similar to Stripe in that they don’t require a merchant account, and they deposit directly to your bank account. What’s best is that the card reader and app are free!


I’d be amiss if I didn’t mention that your mileage may vary. Depending upon your transaction volume and customer base, you may need to consider PCI compliance or TRUSTe certification, among other compliance and regulatory considerations.

These are also not the only options out there. There are many, many products and solutions; I have only picked one from each category I’ve identified as important. I think these are good for small businesses; they’re easy to integrate with, and they’re affordable. They will simplify things for you or your clients. You may want to consider other options, though. For example, PayPal, Amazon, and Google provide excellent transaction alternatives that many of your customers will trust and appreciate.

Finally, I don’t want to close without promoting a simple solution provided by one of my Nashville friends, Luke Stokes. FoxyCart aims to simplify the checkout process for small businesses by providing a secure (PCI and Safe Harbor compliant) and fully-customizable (CSS and HTML) cart experience, while eliminating the need to host or develop your own cart or maintain your own SSL certificates. They provide features such as coupon codes and shipping rates.

Developer Gift

It’s no secret that I love beer. The other night, Luke Stokes asked me what my favorite beer was. It’s no small task for me to answer this. I like malty, I like hoppy, and I like sour. I really love Yazoo Fortuitous, but it’s hard to find. So, for those who like malty beers, I recommend the gift of Clutch from New Belgium, and for those who like hoppy beers, I recommend Le Terroir, also from New Belgium. Both are sour. Both are delicious.