Build log/E-commerce

Headless commerce explained: when it helps and when it is overkill

Headless commerce separates the storefront customers see from the engine that runs products, carts and orders. It suits custom experiences and many channels, and costs more to build and run.

The short answer

  • Headless commerce is an architecture in which the storefront is built separately from the commerce engine, with the two connected through APIs.
  • It helps when you need a shopping experience a theme cannot deliver, sell through several channels from one catalogue, or want full control of the front end.
  • For a standard shop with one website, a themed platform is usually cheaper to build and run, because headless makes you responsible for the storefront, its hosting and its SEO.

Headless commerce is an architecture in which the storefront, the part customers see and click, is built and hosted separately from the commerce engine that holds products, prices, carts, checkout and orders. The two communicate through APIs, so one engine can serve a website, an app, an in-store screen and a trade portal at the same time. It is worth the extra cost when the shopping experience or the number of channels outgrows what a themed store can do, and it is overkill for most shops that sell a standard catalogue through one website.

What headless means

In a traditional e-commerce platform, the engine and the storefront come as one product. You choose a theme, customise it with the platform’s templates and the platform renders the pages. The storefront is called the “head”. Going headless means removing it and building your own, which then asks the engine’s APIs for everything it needs.

A typical journey through a headless shop works like this.

  1. A customer opens a product page on your storefront, often a JavaScript framework application hosted on a platform such as Vercel, Netlify or Cloudflare.
  2. The storefront asks the commerce engine’s API for the product, its variants, its price and its stock.
  3. It asks a content management system (CMS) for the editorial content around the product, such as the story, the size guide and the lifestyle images.
  4. When the customer adds the product to their basket, the storefront calls the engine’s cart API.
  5. At checkout, the customer is often handed to the engine’s own hosted checkout, which takes payment and keeps card data away from your code.

A related term is composable commerce, which means assembling the whole stack from separate specialist services, such as search, content, payments, reviews and the commerce engine, each connected by APIs. Composable set-ups are almost always headless, but a headless shop can still use a single engine for everything behind the storefront.

Commerce engines that support headless

Most modern engines offer APIs suitable for a headless build. They differ in how much they include and who runs them.

  • Established platforms with headless options, such as Shopify, BigCommerce, Adobe Commerce and Salesforce Commerce Cloud. Shopify, for example, offers a Storefront API and its own React-based framework, Hydrogen.
  • API-first engines designed for headless from the start, such as commercetools.
  • Open-source engines that you host yourself, such as Medusa, Saleor and Vendure.

The right engine depends more on your catalogue, pricing rules and integrations than on the storefront, so choose the engine first and the front-end framework second.

When headless helps

Custom shopping experiences

Product configurators, made-to-measure ordering, editorial content woven through product pages, or a shop that is one part of a larger web product all push against theme systems. When the theme gets in the way of the experience you need, owning the front end removes the limit.

Several channels from one catalogue

A business selling through a website, a mobile app, in-store screens and a trade portal can run them all from one engine, with one set of products, prices and stock levels. Each channel is its own front end, built for its own users. Our article on B2B ordering portals covers one common second channel.

Performance and control

A headless storefront can pre-render pages and serve them from servers close to the customer, which helps page speed and Core Web Vitals. A well-built theme can also be fast, though, so speed alone is rarely a strong enough reason. The case is stronger when you also need the control for one of the reasons above.

When it is overkill

Headless adds a second system to build, host, monitor and keep up to date. It is likely to be the wrong choice when:

  • the catalogue is standard and a good theme already does what you need;
  • there is no developer available to maintain the storefront after launch;
  • the business relies on apps or plugins that add features to theme pages, many of which do not work on a headless front end;
  • marketing needs to change pages without a developer and there is no budget for a CMS with preview;
  • the real goal is a redesign, which a new or customised theme can deliver for much less.

Cost and team implications

Going headless moves cost around more than it removes it. The table compares where effort goes.

Cost driverThemed storeHeadless store
Initial buildTheme purchase and customisationA full front-end application, plus integration with the engine and a CMS
HostingIncluded in the platformSeparate front-end hosting, plus the engine
Content editingThe platform’s built-in editorA headless CMS, with page preview to set up
Apps and pluginsInstalled from the platform’s app storeOften need custom integration work
SEOMostly handled by the platformYour job: rendering, metadata, sitemaps and redirects
Ongoing workPlatform updates and theme changesFramework upgrades, security patches and monitoring
TeamMerchandisers and an occasional developerFront-end developers on call, and someone who owns the integrations

SEO needs particular care. A storefront that only builds product pages in the browser can be slow to index, so render pages on the server or at build time. Our guide to SEO for JavaScript sites covers how. When you move an existing shop to headless, keep the same URLs where you can and redirect any that change, or you risk losing the search traffic the old shop had earned.

Caching is the other hidden decision. Pre-rendered pages are fast because they are built in advance, but prices and stock change during the day. Decide for each part of a page how long it can be cached, and fetch the parts that must be live, such as stock levels or a trade customer’s own prices, when the page is requested. Getting this wrong shows customers products they cannot buy.

A middle path

Headless does not have to be all or nothing. Several half-steps get most of the benefit for less cost:

  • keep the themed store and build one custom part, such as a configurator, as an embedded app;
  • run a separate content site for guides and campaigns that links into the themed shop;
  • use the engine headless for a second channel, such as an app or a trade portal, while the main website stays themed.

We compare these routes on one popular platform in Shopify or a custom build.

Weighing up a headless build? See how we approach e-commerce projects.

Questions people ask

What is headless commerce?

Headless commerce is an architecture where the customer-facing storefront is built separately from the commerce engine that manages products, carts, checkout and orders. The two connect through APIs. It lets one engine serve several front ends, such as a website, an app and a trade portal.

Is headless commerce better for SEO?

Not automatically. A headless storefront can be very fast, but it also makes you responsible for rendering, metadata, sitemaps and redirects that a themed platform handles for you. Pages should be rendered on the server or at build time so search engines can read them easily.

What is the difference between headless and composable commerce?

Headless commerce separates the storefront from the commerce engine. Composable commerce goes further and builds the whole stack from separate specialist services, such as search, content, payments and the engine, each connected through APIs. A composable set-up is almost always headless, while a headless shop may still use one engine for everything behind the storefront.

Is headless commerce worth it for a small business?

Usually not. A small business with a standard catalogue and one website will normally get more from a well-built theme, at lower build and running costs. Headless becomes worth considering when the experience or the number of channels outgrows what the theme can do.

Can you build a headless store on Shopify?

Yes. Shopify offers a Storefront API and a React-based framework called Hydrogen for building custom storefronts, while Shopify still runs the catalogue, checkout and orders. Many theme apps will not work on a headless storefront, so check which features you rely on first.

Written by Flavoureak

We build and run Estimark, CurioKids and CalcStack, and we build web and mobile software for other businesses. Start a project.