Documentation

Commerce overview

The Storefront module — products, carts, orders, checkout, and everything around them.

The Storefront module is the e-commerce surface of AppEngine. Every endpoint lives under /storefront/*. Browsing endpoints are public; everything that touches an order or a customer record uses the standard JWT + orgid headers.

Scope

A single module covers the full purchase lifecycle plus the operational tooling around it:

  • Catalog — products, variants, categories, brands, attributes, collections.
  • Pricing — base prices, customer-group tiers, automatic discounts, coupons.
  • Cart — anonymous and authenticated carts with line items and a single update endpoint.
  • Checkout — Stripe (intents, subscriptions, checkout sessions) and PayPal.
  • Orders — full lifecycle from new through processing, shipped, delivered, completed, plus refund, cancel, and hold transitions.
  • Inventory — SKU stock per location, transfers, low-stock alerts, reservations.
  • Shipping & tax — rate quotes, address verification, real-time carrier rates, tax-by-jurisdiction.
  • Discounts & gift cards — coupon validation, automatic promotions, gift-card balance and redemption.
  • Returns — RMA flow and refund posting.
  • Subscriptions & rentals — recurring billing and time-bound bookings.
  • Invoices — B2B invoicing tied to orders.

Concepts

ConceptOwnsWhere it lives
ProductSKU, name, description, images, base price, attributesstorefront/products, storefront/product/:id
VariantA purchasable child of a product (size, color, etc.)Embedded in the product variations array
Category / BrandGrouping for browse and filteringstorefront/categories, storefront/brands/:brand?
CartSet of line items keyed by cartid, scoped to a customer or gueststorefront/cart/get/:authorid/:cartid
LineItemsku, quantity, unitPrice, optionsInside the cart payload
OrderCart converted at checkout; carries lifecycle state and trackingstorefront/order/get/:author/:orderNumber
DiscountCoupon, automatic rule, or promotionstorefront/discounts/*
GiftCardSerial-tracked stored valuestorefront/giftcards/*
InventoryStock-on-hand per SKU per locationstorefront/inventory/*
SubscriptionRecurring order tied to a Stripe subscriptionstorefront/subscriptions/get/:author
RentalTime-bound product reservationMixed with cart via itemType: "rental"
ReturnRMA against a fulfilled orderstorefront/returns/*
InvoiceDocument representing payment duestorefront/invoice/*

What goes where

The base-app reference site uses every endpoint in this module. The canonical client-side wrapper is src/lib/storefront-api.ts — copy from it rather than writing your own from scratch.

Multi-channel

The Storefront module is the system of record. The Sales Channel module syncs the same catalog out to Amazon, eBay, Shopify, WooCommerce and aggregates orders back. You can ignore Sales Channel entirely until you need a second channel.

Public vs authenticated

Browse, cart-read, and gift-card-balance are public — @PublicRoute() on the controller. Everything that mutates an order, processes a payment, or touches a customer record is JWT-gated. Cart updates work for both anonymous (authorid = a generated guest id) and authenticated customers; the cart merges on sign-in.