Skip to content
Progare

Integrations

Build a custom storefront

Progare’s hosted templates cover most stores. When you need a fully custom design or a native app, build your own frontend on the same API — the merchant keeps managing products, orders and content in their dashboard.

How Progare’s own storefront works

There’s no per-store code. One storefront app serves every store, and works out which store to render from the request’s domain. You can use exactly the same approach:

  1. Read the request’s host (e.g. mybrand.com).
  2. Resolve it to a store slug.
  3. Fetch content and catalog for that slug, and render.

Resolve a domain to a store

GET/stores/resolve-host?host=mybrand.comPublic
Matches a connected custom domain (with or without www.) or a Progare subdomain. Returns null if no live store uses that host.
json
{
  "slug": "mahi-studio",
  "storeName": "Mahi Studio",
  "templateSlug": "boutique-rose",
  "themeTokens": { "color-primary": "#551F35", "font-heading": "…" },
  "layoutVariant": "classic"
}

If your frontend serves only one store, skip this and hard-code the slug in an environment variable.

Templates

GET/templatesPublic
All published templates with their themeTokens (colors and fonts as CSS custom properties).
GET/templates/{slug}Public

Apply themeTokens as CSS variables to reuse a template’s palette in your own design.

Build it step by step

  1. Set up the store

    The merchant creates the store and adds products in the dashboard as usual. Note the store slug, and create a test store for development.

  2. Render pages server-side

    Fetch /content/site for the header and footer, /content/home for the home page, and /products, /products/{slug} and /categories for the shop. Cache them — for example with Next.js revalidation — since content changes rarely.

    ts
    const API = process.env.PROGARE_API_URL ?? "https://api.progare.com";
    const SLUG = process.env.PROGARE_STORE_SLUG!;
    
    export async function getProduct(slug: string) {
      const res = await fetch(`${API}/storefront/${SLUG}/products/${slug}`, {
        next: { revalidate: 300 },
      });
      if (res.status === 404) return null;
      if (!res.ok) throw new Error(`Progare API ${res.status}`);
      return res.json();
    }
  3. Add SEO

    Use the SEO endpoints for meta tags and sitemap.xml, and check /seo/redirect before returning a 404 so the merchant’s redirects keep working.

  4. Add cart, checkout and accounts

    Follow Cart & checkout and Shopper accounts. Keep the cart session and shopper token on the device.

  5. Go live

    Point the domain at your own hosting. If the merchant previously connected it to Progare, they should remove it from their Progare store first.

Something unclear or out of date? Tell us