Docs
Dashboard
View as Markdown
On this page
  1. The pieces
  2. Five minutes to a product list
  3. Agents use the same API

Headless commerce

Run your own storefront on any stack with the Storefront API, the SDK and the Next.js starter.

Your ShopFast store already has a fast storefront with templates. Go headless when you want your own design system, an app, a site on another stack, or ShopFast products inside something you already run. ShopFast keeps doing the hard parts: the catalog, stock and keys, carts and discounts, checkout and payments, delivery, buyer accounts, taxes and fraud checks.

The pieces

Storefront API The public API: catalog, search, cart, checkout, buyer accounts, support. Keys, CORS, caching and limits.
Reference Every operation, generated from the live contract.
JavaScript SDK @shopfast-sdk/client: typed, no dependencies, browsers and servers.
Next.js starter A complete store on the App Router you can deploy as it is.
Headless checkout Hand off to the hosted checkout, embed it, or use your own form.
Buyer accounts Email-code sign-in, orders, keys and downloads, subscriptions and the wallet.
Cache and revalidation Edge caching and the storefront.updated webhook.

Five minutes to a product list

  1. In Settings → Headless & MCP → Storefront keys, create a publishable key.
  2. Fetch your products:
import { createStorefrontClient } from '@shopfast-sdk/client';

const shop = createStorefrontClient({ shop: 'your-store', key: 'sfpk_live_…' });
const { items } = await shop.products.list({ limit: 12 });
  1. Add to a cart and send the buyer to checkout:
const cart = await shop.cart.create({ lines: [{ productId: items[0].id, quantity: 1 }] });
const { checkoutUrl } = await shop.cart.checkoutLink(cart.id);
location.href = checkoutUrl;

Agents use the same API

AI shopping agents get the same catalog, cart and checkout through your store’s public MCP server, with nothing to set up.

Was this page helpful?