Skip to content
Progare

Developer basics

Authentication

Storefront endpoints use one of four kinds of access. Each endpoint in these guides is labelled with the one it needs.

AccessHow to send itUsed for
PublicNothingCatalog, content, SEO, blog, reviews, enquiries, newsletter, tracking.
Cart sessionX-Cart-Session: <id>Guest carts, checkout, wishlist-style lists for signed-out shoppers.
Shopper tokenAuthorization: Bearer <token>Signed-in shopper: account, orders, addresses, loyalty, subscriptions.
API keyx-api-key: <key>Server-to-server form submissions from an external website.

Cart sessions

Guests don’t have an account, so their cart is keyed by a session ID that you generate and keep on the device — for example in localStorage. Send it as X-Cart-Session on every cart and checkout call. Any unique, hard-to-guess string works:

ts
function cartSession(): string {
  let id = localStorage.getItem("cart-session");
  if (!id) {
    id = crypto.randomUUID();
    localStorage.setItem("cart-session", id);
  }
  return id;
}

When a guest signs in, call POST /storefront/{storeSlug}/cart/merge with both the token and the session header to move their guest cart into their account.

Shopper tokens

Logging a shopper in returns an accessToken — a JWT valid for 7 days and tied to one store. Send it as a Bearer token. Endpoints marked optional auth (cart, checkout) work for guests and attach the order to the shopper when a token is present. When a call returns 401, sign the shopper in again. See Shopper accounts.

bash
curl "https://api.progare.com/storefront/mahi-studio/account/orders" \
  -H "Authorization: Bearer eyJhbGciOi…"

API keys

API keys let an external website post enquiries and form notifications into a store from its server. They’re issued per merchant account — email hello@progare.com from the store owner’s address to request one.

Calling from the browser

Browser requests are subject to CORS. If your frontend runs on its own domain and calls the API directly from the browser, ask us to allow your origin, or proxy calls through your own server. Server-side requests (Next.js server components, a backend, a mobile app) aren’t affected. The assistant widget endpoints accept any origin.

Something unclear or out of date? Tell us