Selling Online

Suppose a small business makes ceramic mugs and wants to sell them online. It needs a way to show customers what is available, let them choose products and quantities, and accept their orders. Someone also has to enter new products, change prices, and keep track of how many mugs remain. These are ordinary requirements for e-commerce software, the software that supports buying and selling online.

One option is to sell through Amazon’s marketplace. The business lists its mugs, and customers find and buy them through Amazon. The business supplies the products, and Amazon provides the website where customers shop. The merchant can start selling without building a shopping website.

But suppose the business wants its own online shop. It wants a website under its own name, with pages about how the mugs are made and a shopping experience designed around its products. Listing the mugs on Amazon does not create that website. A platform such as Shopify provides software for the merchant’s own storefront and the commerce work behind it.

Storefront and backend

The part a customer sees is the storefront: product pages, search results, the cart, and the steps for placing an order. In software terms, the storefront is the frontend. Behind it is the backend, the software that stores the product catalog, manages carts, checks availability, and records orders. When the merchant changes a price, the change happens in the backend, and the frontend shows the new price the next time it requests the product from the backend.

A ready-made commerce platform can supply both the frontend and the backend. The merchant picks a theme, enters products, and configures the shop.

Headless commerce

In the client-server pattern, the frontend and the backend are independent, and the frontend uses an API to reach the backend. A full separation means the backend can be used independently of the frontend, by a different frontend or directly through the API. This arrangement is called headless commerce. The term was coined by Dirk Hoerig, co-founder of commercetools, in 2013.

Shopify supports headless commerce. A developer can create a custom storefront connected to Shopify’s backend. The developer then controls the storefront. The developer is also responsible for building and maintaining it.

Suppose we want to build our own headless commerce system: a small, open-source commerce backend that developers can deploy for their own shops.