Skip to content

Routes ​

Complete route table for the Maho Storefront Worker.

Catalog Routes (Edge Cached) ​

Server-side rendered HTML pages, cached at the Cloudflare edge. After deploy, the cache is purged and prewarmed automatically.

RouteMethodDescriptionEdge TTL
/GETHomepage7 days
/blogGETBlog listing7 days
/blog/category/:slugGETBlog category7 days
/blog/:slugGETBlog post7 days
/page/:identifierGETCMS page by identifier7 days
/:parent/:childGETSubcategory (e.g. /women/dresses)7 days
/:slugGETCategory, product, CMS page, or blog post7 days

Browser caching: max-age=60, stale-while-revalidate=86400 -- browser shows cached page instantly and revalidates in the background. The freshness controller patches any stale content in-place.

URL Resolution ​

For /:slug routes, the Worker resolves the entity type:

  1. Check KV for {store}:category:{slug} -- Category page
  2. Check KV for {store}:product:{slug} -- Product page
  3. Check KV for {store}:cms:{slug} -- CMS page
  4. Check KV for {store}:blog:{slug} -- Blog post
  5. API URL resolver fallback -- Fetch, cache in KV, and render
  6. None found -- 404 page

Dynamic Routes (Never Cached) ​

User-specific pages that always hit the Worker handler.

RouteMethodDescription
/cartGETShopping cart
/checkoutGETCheckout flow
/order/successGETOrder success page
/accountGETAccount dashboard
/loginGETLogin page
/registerGETRegistration page
/forgot-passwordGETPassword reset request
/reset-passwordGETPassword reset form
/searchGETSearch results
/contactsGETContact form

Client-Side API Proxy ​

All /api/* requests are proxied to the Maho backend API. The Worker adds store code headers and CORS headers. If MAHO_API_BASIC_AUTH is set (for dev/staging sites behind nginx basic auth), it's forwarded too -- this is not needed in production where the API is publicly accessible. The routes below are the actual Maho API Platform endpoints that the storefront JS controllers call.

Cart (Guest) ​

RouteMethodDescription
/api/guest-cartsPOSTCreate a guest cart
/api/guest-carts/{maskedId}GETGet cart with items and prices
/api/guest-carts/{maskedId}/itemsPOSTAdd item to cart
/api/guest-carts/{maskedId}/items/{itemId}PUTUpdate item qty
/api/guest-carts/{maskedId}/items/{itemId}DELETERemove item
/api/guest-carts/{maskedId}/couponPUTApply coupon code
/api/guest-carts/{maskedId}/couponDELETERemove coupon
/api/guest-carts/{maskedId}/giftcardPOSTApply gift card
/api/guest-carts/{maskedId}/giftcard/{code}DELETERemove gift card
/api/guest-carts/{maskedId}/estimate-shippingPOSTGet shipping rates for address
/api/guest-carts/{maskedId}/shipping-informationPOSTSet shipping method + address
/api/guest-carts/{maskedId}/payment-methodsGETGet available payment methods

Orders ​

RouteMethodDescription
/api/ordersPOSTPlace order
/api/orders/{incrementId}/verifyGETVerify order for success page

Authentication ​

RouteMethodDescription
/api/auth/tokenPOSTCustomer login (email + password)
/api/auth/forgot-passwordPOSTRequest password reset email
/api/auth/reset-passwordPOSTReset password with token
/api/auth/refreshPOSTRefresh JWT token

Customer Account ​

RouteMethodDescription
/api/customersPOSTCreate new account
/api/customers/meGETGet current customer profile
/api/customers/mePUTUpdate customer profile
/api/customers/me/passwordPOSTChange password
/api/customers/me/ordersGETOrder history
/api/customers/me/addressesGET, POSTList / create addresses
/api/customers/me/addresses/{id}GET, PUT, DELETEManage address
/api/customers/me/wishlistGET, POSTWishlist items
/api/customers/me/wishlist/syncPOSTSync wishlist product IDs
/api/customers/me/wishlist/{id}DELETERemove wishlist item
/api/customers/me/reviewsGETCustomer's reviews

Catalog (Read) ​

RouteMethodDescription
/api/productsGETProduct listing (with filters)
/api/products/{id}GETProduct detail
/api/categoriesGETCategory tree
/api/categories/{id}GETSingle category
/api/layered-filtersGETAvailable filter options for category
/api/products/{id}/reviewsGET, POSTProduct reviews

Content ​

RouteMethodDescription
/api/cms-pagesGETCMS pages
/api/cms-pages/{id}GETSingle CMS page
/api/cms-blocksGETCMS blocks
/api/cms-blocks/{id}GETSingle CMS block
/api/blog-postsGETBlog posts
/api/blog-posts/{id}GETSingle blog post
/api/blog-categoriesGETBlog categories

Gift Cards ​

RouteMethodDescription
/api/guest-carts/{maskedId}/giftcardPOSTApply gift card to cart
/api/guest-carts/{maskedId}/giftcard/{code}DELETERemove gift card from cart

Other ​

RouteMethodDescription
/api/store-configGETStore configuration
/api/countriesGETCountries and regions
/api/url-resolverGETResolve URL to entity type
/api/newsletter/subscribePOSTSubscribe to newsletter
/api/newsletter/unsubscribePOSTUnsubscribe from newsletter

Extension Endpoints ​

These are provided by optional Maho modules, not the core. They appear when the corresponding module is installed and configured.

RouteMethodModuleDescription
/api/customers/social-authPOSTMageAustralia_SocialLoginSocial login (Google/Apple/Facebook)
/api/payments/stripe/configGETMageAustralia_StripeStripe publishable key
/api/payments/stripe/payment-intentsPOSTMageAustralia_StripeCreate Stripe PaymentIntent

Storefront-Only Endpoints ​

These are handled by the Worker directly, not proxied to the backend.

RouteMethodDescription
/api/cart-recommendationsGETCross-sell product recommendations for cart
/api/payments/stripe/payment-intentsPOSTCreates Stripe PaymentIntent directly (requires MageAustralia_Stripe)

Embed Widget ​

RouteMethodDescription
/embed.jsGETEmbeddable product widget script
/embed/productsGETProduct data API for embed widgets
/embed-demoGETEmbed widget demo page

See the Embed Widget guide for the full integration (script attributes, programmatic API, checkout, theming).

Internal / Admin ​

RouteMethodAuthDescription
/syncPOSTBearerFull data sync (all entities)
/sync/:typePOSTBearerPartial sync (config, categories, products, etc.)
/cache/warm-urlsGETBearerList all URLs for cache prewarming
/cache/updatePOSTBearerUpdate specific KV entries
/cache/purgePOSTBearerPurge edge cache for URLs
/cache/deletePOSTBearerDelete KV keys
/cache/keysGETBearerList KV keys by prefix
/freshness/should-checkGETNoneEdge-throttled freshness check gate
/freshnessPOSTNoneClient reports stale data, updates KV
/pulseGETNoneData version hash (for cache busting)
/dev/loginPOSTPasswordDev password gate login
/dev/logoutGETSessionDev session logout
/dev/previewPOSTSessionToggle dev preview mode
/dev/configPOSTBearerSet password gate / storefront password
/dev/tokensGET, POST, DELETEBearerManage dev access tokens
/adminGETNoneRedirect to Maho admin panel

Static Assets ​

RouteMethodCacheDescription
/styles.cssGET1 year (immutable)UnoCSS bundle (versioned via ?v=)
/controllers.jsGET1 year (immutable)esbuild JS bundle (versioned via ?v=)
/plugins/:nameGET24 hoursPayment plugin scripts
/media/*GET1 year (immutable)Product/media images proxied from backend

Agent-Readiness Endpoints ​

Served by the storefront for AI agents, crawlers, and discovery tooling. See Agent Readiness for full details on each endpoint.

RouteMethodCacheDescription
/llms.txtGET1 hourCurated reading list (llmstxt.org format), generated from KV
/robots.txtGET1 hourStorefront-owned, with Content Signals (search=yes, ai-input=yes, ai-train=no)
/sitemap.xmlGET1 hourGenerated from KV (categories + products + CMS + blog) with <lastmod> from each entity's updatedAt
/.well-known/api-catalogGET1 hourRFC 9727 linkset pointing at OpenAPI + OAuth + MCP discovery
/.well-known/oauth-authorization-serverGET1 hourRFC 8414 OAuth 2.0 Authorization Server Metadata
/.well-known/mcp/server-card.jsonGET1 hourMCP discovery card (currently status: "planned")
/mcpALL5 minStub until the dedicated MCP Worker ships — returns 503 + structured "coming soon"

Every HTML response also carries Link: </.well-known/api-catalog>; rel="api-catalog". Any catalogue page accepts Accept: text/markdown or the /index.md / .md path suffix to return a token-cheap markdown rendering instead of HTML.

Source: src/index.tsx, src/agents/*.ts