Skip to content
Guide

What is headless commerce?

Headless commerce separates the storefront your shoppers see from the commerce engine that holds products, carts and orders. This guide explains how the two talk, when the split helps, and what to check before you choose it.

What is headless commerce?

Every online store has two halves. The front end is what shoppers see: pages, product photos, the cart and the checkout screens. The back end is the commerce engine: the catalog, prices, stock, customer accounts, orders, payments and tax rules.

In a traditional store the two halves are one application. The engine renders every page from a theme, so a change to the design is a change to the engine’s templates.

Headless commerce cuts that link. The storefront is its own application, the “head”, and it talks to the engine only through an API. The engine no longer draws pages. It answers questions such as “what is in this category?”, “add this item to the cart” and “place this order”.

The name sounds more dramatic than the idea. A headless store still has a storefront. The storefront is built and deployed on its own, and it can be replaced without touching the engine.

How a headless store works

Follow one shopper through a headless store:

  1. The shopper opens a product page. The storefront application loads in the browser, often from a server that has already rendered the page for speed and for search engines.
  2. The storefront asks the engine’s API for the product: name, price, options, photos and stock.
  3. The shopper adds the item to the cart. The storefront sends that to the engine, which keeps the cart and works out prices, discounts and tax.
  4. At checkout, the storefront collects the address and payment, and the engine places the order. From there the order is handled in the admin like any other.

Two kinds of API are common. A GraphQL API lets the storefront ask for exactly the fields a page needs in one request. A REST API exposes resources such as products and orders at fixed addresses, and suits server-to-server work like syncing stock with a warehouse system.

Pages that rarely change, such as category and product pages, can be cached close to the shopper and served without asking the engine each time. The cart and checkout always ask the engine, because prices and stock must be current.

Because the engine only speaks through the API, more than one front end can use it at once: the website, an in-store register, a kiosk or a partner’s site, all reading the same products and writing to the same orders.

Headless storefront or a theme?

Neither approach is better in general. They trade control for simplicity in different places:

Headless storefront compared with a theme
QuestionThemeHeadless storefront
Who draws the pagesThe commerce engine, from theme templatesA separate storefront application, from API data
Changing the designEdit the theme, and changes ship with the engineEdit the storefront, which ships on its own schedule
Skills you needTheme development for the engine you useFront-end development, or a visual editor on top
Add-ons that change pagesUsually render into the theme directlyNeed storefront support before shoppers see them
Other front endsHard: the theme is the only front endThe same API serves a register, an app or a kiosk

The add-on row is the one people miss. In a theme store, many extensions change the product page or checkout by injecting into the theme. In a headless store, an extension that only touches the engine works as before, while one that draws storefront screens needs those screens built for the headless front end.

When headless helps

Headless is worth it when one or more of these is true for you:

  • Most of your shoppers are on phones. A storefront built as a modern web application can feel like an app: fast page changes, a cart that never reloads, and layouts designed for small screens first.
  • Your design is your brand. You want pages that do not look like a template, and you want to change them without waiting on an engine upgrade.
  • You sell through more than one front end. A website and an in-store register that share one catalog, one stock count and one order list.
  • You publish a lot of content. Landing pages, lookbooks and campaign pages that marketing changes every week.

It is less useful for a small catalog with a standard look and no plans for other channels. There, a good theme does the job with fewer moving parts.

What to check before you choose

Ask these questions of any headless platform or agency:

  • Search engines. Are pages rendered on the server, with real titles, meta descriptions and clean URLs? A storefront that renders only in the browser can index poorly.
  • Checkout and payments. Which payment methods work in the headless checkout today? Ask for the list, not the roadmap.
  • Product types. Can the storefront sell every product type you carry, such as products with options, bundles and digital goods?
  • Editing. Can a marketer change a page without a developer? Look for a visual editor that publishes to the live storefront.
  • Who runs the front end. Someone has to host, update and secure the storefront application. Find out whether that is you, an agency or the platform.
  • Tracking. Can you connect your analytics and tag manager, and do cart and checkout events reach them?

A short proof of concept answers most of these. Build one category page, one product page and the checkout, and test them on a phone.

What headless costs to run

The engine costs the same either way. The difference is the storefront, which in a headless setup is a second application with its own bills:

  • Building it. A custom storefront is a real software project: design, development, testing on every common phone and browser.
  • Hosting it. The storefront needs servers or an edge platform, and someone watching them.
  • Keeping it current. Front-end frameworks move fast. Security fixes and upgrades for the storefront are as routine as they are for the engine.
  • Add-on work. Every extension that shows something to shoppers needs its storefront part built or adapted.

These costs drop sharply when the platform ships a ready storefront and runs it for you. Then you pay for design changes, not for keeping the lights on.

What headless does not mean

“Headless is only for big companies.” It used to mean building a storefront from scratch. Platforms that ship a ready headless storefront remove most of that cost.

“Headless is always faster.” Speed comes from how the storefront is built and cached, not from the word headless. A heavy headless storefront can be slower than a light theme.

“You lose easy page editing.” Only if nobody built an editor. A visual editor that writes to the headless storefront gives marketers the same control a theme editor does.

How Stoily does it

Every Stoily store comes with a mobile-first headless storefront on your own domain, in front of a Magento 2 engine. You do not host or patch it yourself, and pages are served from a full-page cache.

  • Build and edit storefront pages visually with the Designer.
  • Set your colors, fonts and spacing once, and the whole storefront follows.
  • Set page titles, meta descriptions and clean URLs for every product, category and page, and manage redirects.
  • Prefer a classic Magento theme? Switch your store to theme mode from the admin.
  • Build your own front end on the storefront GraphQL API, and connect your systems through the REST API and webhooks.

The headless storefront sells simple products and products with options such as size and color. See the online store, the Designer and the developer docs.

On the way

Coming soon to Online store

Planned, not available yet.

  • Bundles and digital products

    Your storefront will sell bundles, grouped products, downloads and virtual products.

  • Returns requested online

    Customers will request a return from their account, and you approve it in the admin.

  • Add to home screen with your name

    Shoppers who save your storefront to their phone will see your store's name and icon.

  • Storefront sitemap

    Each store will publish a sitemap.xml so search engines can find every product and page.

Start a headless store on Stoily

Every store comes with a mobile-first headless storefront and the Designer to edit its pages. You do not host the storefront yourself.