Skip to main content

Catalog

Product search, category tree, product page and delivery dates (product-discovery, delivery-promise, pricing).

📄️Introduction

The only storefront edge (/api/storefront). A backend-for-frontend that composes the storefront contexts (product-discovery, shopping-cart, checkout, customer-ordering, pricing) and the network's delivery-promise quote. It has no domain model, no database and no Kafka. Each route is a thin composition over an upstream REST API; upstream answers, including their RFC 9457 problem details, are relayed unchanged. Every POST and PATCH requires the page's Idempotency-Key (a fresh one per user submit, reused on retry), except the safe batch estimate POST /delivery-estimates, which stores nothing and ignores a key if sent; the BFF stores nothing and forwards to each upstream command a key minted from (route, subject, page key), so the provider replays a retry (relayed with Idempotency-Replayed: true) and answers 409 idempotency-key-reused when the same key carries a different request, which the BFF relays unchanged. Lists answer {items, nextCursor} and take limit and cursor. Cart, shopper and last checkout ids live in the sf_state cookie: state, NOT authentication, and there is no authentication anywhere. Saved addresses pass through without being stored or logged, request and response bodies are never logged, and only PSP payment-method tokens are accepted, never card data. Every route has a time budget (2 s queries, 5 s commands, 15 s checkout confirm); an expired budget answers 504 and is never retried.

📄️Start a session by e-mail lookup

Looks the shopper up with customer-ordering GET /shoppers?email=. There is no password and no authentication; the cookie only remembers which shopper the page acts for. A POST, so it requires an Idempotency-Key; the lookup is a GET upstream, so no upstream key is forwarded and in practice the answer never carries Idempotency-Replayed and never answers 409 (both are declared only because the fleet REST guideline requires them on every keyed POST). Without a body of {email} (at most 254 characters, no other field) the answer is 422 validation-failed.

📄️Advisory delivery estimates for the items of a listing page

Called by the browser for a product listing (search results): one call for up to 50 items, each catalogItemId once, each with a quantity of 1 to 999. Relays delivery-promise POST /delivery-estimates for the postal prefix and returns its answer unchanged: one estimate per item in request order, with the best option per classic tier (SAME_DAY, NEXT_DAY, TWO_DAY, STANDARD) or the constraint that blocks the tier. The BFF never requests the CONSOLIDATED tier here (the request has no tiers field). An estimate is ADVISORY: it is not an offer, carries no offer id, cannot back a promise and reserves no capacity; the quote of the product page or of checkout is what the shopper promises against. The estimate window is {start, end, timeZone}, which a quote calls {earliest, latest, timeZone}. It is a safe POST: nothing is stored here or upstream, so no Idempotency-Key is required and one that is sent is ignored (delivery-promise ADR 0019, BFF ADR 0007). An invalid request answers 422 validation-failed before any upstream call; an upstream problem is relayed unchanged.