Home / Integrations / Headless

Headless & custom storefronts

Build your storefront on any stack — Next.js, Astro, a mobile app, anything — and use Foundry as the catalog, inventory, and order source of truth behind it. Your frontend reads live catalog and inventory from the public Storefront API and posts orders back; Foundry handles reservations, fulfillment, and multi-channel inventory math.

What you'll get

  • • A read API for products, variants, categories, brands, and search
  • • Live inventory availability, so you never sell what you can't ship
  • • A checkout endpoint that creates real Foundry orders with server-side pricing and reservations
  • • Signed webhooks for order status, inventory, and catalog changes — keep your frontend cache fresh
  • • Per-storefront scoped API keys you can rotate or revoke any time
1

When headless is the right fit

Choose headless when you want full control of the frontend

If you're building a bespoke storefront, a mobile app, or embedding commerce into an existing site, headless lets you own the entire buyer experience while Foundry stays the system of record. If instead you already run a store on Shopify, BigCommerce, or Medusa, connect that platform directly instead — it's less to build.

Want checkout and payments handled for you?

You can pair a headless Foundry catalog with a hosted cart/checkout engine so you don't build payments yourself. See the Throttle integration for that pattern.

2

How it works

Your frontend reads, Foundry records

Your storefront calls GET /api/v1/storefront/* for catalog and inventory, renders however you like, and posts the cart to POST /api/v1/storefront/orders at checkout. Foundry recomputes totals server-side (so a tampered client price is rejected), creates the order, and reserves stock across all your channels.

Foundry pushes changes back to you

Subscribe a webhook endpoint and Foundry delivers signed events — order.status_changed, inventory.changed, and catalog.changed — so you can revalidate caches and update order state without polling.

3

Get started

The full flow — with copy-paste requests and responses — lives in the Storefront API reference. The short version:

Create a Headless channel & a Storefront key

In Foundry, add a channel with platform Headless, then mint a Storefront API key (fims_sf_…) bound to it. This key is safe to use from your storefront's server and is scoped to storefront reads plus order creation only.

Add your allowed origins

Set the domains your storefront runs on so browser requests are accepted. Server-to-server calls don't need this, but browser calls do.

Pull catalog, wire checkout, subscribe to webhooks

Read products and inventory, render your store, post orders at checkout with an idempotency key, and point a webhook URL at your app. Each of these has a worked example in the reference below.

Full Storefront API reference

Endpoints, authentication, CORS, checkout, webhook signing, rate limits, and errors — plus a live interactive API explorer you can call against your own account.

Building something custom and want a hand? Email support or book a demo.