Starter templates
The Lifepeaks storefront starter provides a partner application with five storefront templates. The shared application owns API calls, server-only secrets, durable idempotency, webhook verification, and canonical order reconciliation. Templates share the same checkout and security behavior.
Get started
The starter repository is currently private. Ask Lifepeaks for access, then clone it and run the generator from its repository root. Your API key is issued during partner onboarding; the generator never creates it or the webhook secret. Approve your storefront's return origin yourself, as described in Approve your return URL.
git clone https://github.com/Lifepeaks/lifepeaks-storefront-starter.git
cd lifepeaks-storefront-starter
bun run create:storefront -- --template restaurant --out ../my-lifepeaks-storefront
cd ../my-lifepeaks-storefront
bun install
cp .env.example .env
chmod 0600 .env
# Fill .env with your API key and webhook secret.
bun run doctor
bun run check
bun run dev
Open the local URL printed by bun run dev. Replace restaurant with hotel,
spa-wellness, retail, or experience to start with another industry template. The generated
package also supports the non-watching local server bun run start.
Customization layers
The generator copies application code into the new repository. Customize it in layers:
- Edit
storefront.manifest.jsonfor brand, copy, locale, buyer guidance, and display choices.page.locationsdefines the visible location options andpage.designsdefines labels and images for visible designs.amountPresetsare display suggestions only: positive whole numbers in the smallest unit of the currency, where50000is DKK 500.00. - Replace project-local files in
public/assetsand update their/assetsreferences in the manifest. - Change the
--lp-*custom properties insrc/ui/tokens/tokens.cssfor global theme values. - Edit the owned component copies under
src/uifor structural or component-level changes. The starter already contains these copies, so users do not need access to the private component registry.
Generated projects contain editable component copies. Updates are not applied automatically. A separate Lifepeaks component registry exists for teams that want to pull refreshed components, and access to it is granted on request — note that installing over a component replaces your edits to it.
Server-authoritative commerce
Manifest values never become commerce authority. The Lifepeaks catalog supplies currency,
amount limits, pricing type, quantity limits, and delivery methods. The current starter
supports only DKK, requires variable pricing, sends every card by e-mail, and always
submits quantity one even when the catalog maximum is higher. Those are limits of the
starter, not of the API: the catalog publishes postal delivery and the order route
accepts it. The server obtains the authoritative
quote, refreshes it when inputs change or it expires, and refuses an expired quote.
Checkout redirects to the Lifepeaks-hosted QuickPay page. Canonical order reads and signed,
deduplicated webhooks remain authoritative after the browser returns.
Keep catalog, quote, checkout, order, and webhook calls in the server adapter. The manifest cannot change payable totals, fees, commission, merchant, callback, capture, idempotency, fulfillment, API-key, or webhook-secret policy.
Extending the storefront
The five templates do not include a cart, quantity controls, add-ons, greetings, uploads, or alternate delivery methods. To add these features, follow the delivery and personalization contracts and implement the corresponding server validation, idempotency, and tests.
Production environment
The required runtime fields are LIFEPEAKS_API_BASE_URL (normally
https://api.lifepeaks.dk), LIFEPEAKS_API_KEY, LIFEPEAKS_COMPANY_ID, and the HTTPS
PARTNER_PUBLIC_URL.
bun run doctor also requires LIFEPEAKS_APPROVED_RETURN_ORIGIN to equal the public
URL, a current LIFEPEAKS_WEBHOOK_SECRET, and LIFEPEAKS_RUNTIME_SCOPES set to exactly these scopes:
products:read,pickup_points:read,greeting_images:write,quotes:create,orders:create,orders:read,checkout:create
The scope check validates this configuration value; it does not inspect the key's actual permissions. Verify those separately with GET /v2/me.
LIFEPEAKS_WEBHOOK_SECRET is the current secret.
LIFEPEAKS_WEBHOOK_PREVIOUS_SECRET is optional during rotation; keep both values only
for the overlap window. Other optional fields are
LIFEPEAKS_COMPANY_SLUG for an assigned agency tenant, PARTNER_DB_PATH (default
./var/storefront.sqlite), PARTNER_HOST (default 127.0.0.1), and PARTNER_PORT
(default 4310). LIFEPEAKS_API_HOST_HEADER is local-only and must not be used with
https://api.lifepeaks.dk. Production deployments need HTTPS, server-only secret
storage, and durable storage for the database path.
Run bun run doctor after configuration changes. It checks required secrets and origins without printing their values. Run the starter's full check command before deployment:
bun run check
Available templates
Every current template checks out the same product: gift_card_value, a variable-value gift card, and sends it by e-mail. The template does not create a new Lifepeaks product type. The API sells the company's experiences through the same quote and order routes, so adding experience lines to a starter is a change in your own code rather than a different integration — see Endpoints — Quote and order lines.
| Template | Customer framing | Guide |
|---|---|---|
| Restaurant | Dining gift value | Restaurant |
| Hotel | Stay gift value | Hotel |
| Spa & wellness | Wellness gift value | Spa & wellness |
| Retail | Store gift value | Retail |
| Experience | Experience gift value | Experience |
Capability boundaries
Event tickets and special offers are sold through the API, as the event_ticket and special_offer product families. No starter template presents them. The templates sell variable-value gift cards. To add tickets or offers, read the families in Endpoints — The product catalog and price them with POST /v2/quotes like any other line. GET /v2/events remains a reporting route and is not a checkout contract.
Agency, marketplace, POS, and PMS models require Lifepeaks review because tenancy, liabilities, and payment responsibilities differ. Their availability is negotiated and entitlement-gated.
Non-Lifepeaks settlement is negotiated and entitlement-gated. POST /v2/orders/{order_id}/settle requires a dedicated scope plus an active commercial entitlement for the tenant, credential, and settlement mode; it is disabled by default. Do not design a public integration around it until Lifepeaks confirms the contract.
Physical delivery, inventory, booking, capacity, fixed packages, and ticket issuance are not implied by a template's copy or imagery. Integrate those concerns in your own system only when you have a separate source of truth and a documented Lifepeaks contract.
Production checklist
- Use HTTPS for the storefront, return URL, and webhook endpoint.
- Keep the Lifepeaks key and webhook secret in managed server-side secrets.
- Persist operation keys, partner references,
po_…IDs, and webhook event IDs in a transactional database. - Apply rate limits and request-size limits at the public partner edge.
- Allow only your exact frontend origin to call partner checkout endpoints.
- Log Lifepeaks resource IDs and idempotency keys, never credentials or recipient data.
- Poll canonical order state on return and consume signed webhooks in the background.
- Test successful, cancelled, failed, expired-session, lost-callback, and duplicate-delivery paths.
Continue with Headless checkout for the request sequence and Signed webhooks for the receiver contract.