Account
Shopper registration, e-mail lookup and saved addresses (customer-ordering).
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.
Account
Account
Add a line to the cart
Relays shopping-cart POST /carts/{cartId}/lines with a minted Idempotency-Key.
Save an address for the cookie's shopper
Relays customer-ordering POST /shoppers/{shopperId}/addresses. The address passes through; it is never stored or logged here.
Request the cancellation of an order
Relays customer-ordering POST /orders/{orderId}/cancellations. Refused upstream (409 cancel-after-lock) once a group is locked.
Carts
Carts
Catalog
Catalog
Checkout
Checkout
Confirm the session with a payment method token
Relays checkout POST /checkout-sessions/{sessionId}/confirmations with the PSP token (never a card number: card-shaped fields and a token that is a card number are refused with 422 before any upstream call). Uses the long confirm budget. 200 carries a definitive session, 202 an in-doubt placement to poll.
Create a cart
Relays shopping-cart POST /carts and stores the new cart id in the sf_state cookie. An empty body adopts the cookie's shopper.
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.
Get a cart
Relays shopping-cart GET /carts/{cartId} with its quote, selections and estimate.
Get a checkout session
Relays checkout GET /checkout-sessions/{sessionId}. The page polls it while a placement is in doubt (202 from confirmations).
Get the cookie's shopper
Relays customer-ordering GET /shoppers/{shopperId} for the shopper in the cookie; 422 session-required without one.
Get an order with tracking and checkout totals
The customer-ordering order, plus its tracking under tracking and, when the cookie's last checkout placed this order, the checkout totals under totals. Tracking and totals are best effort and absent when their upstream fails; the order itself is required. The order and tracking bodies are relayed with every field, including each group's optional promise window timeZone.
Get one product view
Relays product-discovery GET /products/{catalogItemId}, the full ProductView for the product page.
List carts of a shopper
Relays shopping-cart GET /carts with shopperId, state, limit and cursor. The shopper defaults to the cookie's. An undeclared parameter answers 400 unknown-query-parameter.
Get the category tree for department navigation
Relays product-discovery GET /categories unchanged: the category tree with purchasable counts, shaped {version, categories: [{categoryId, parentId (null on a root), name, path, purchasableCount}]}. It takes no parameters; anything in the query string is dropped. The page uses it to show department names for the categoryId filter of GET /products. The tree is one bounded navigation document, not a resource collection.
List the shopper's orders
Relays customer-ordering GET /orders with shopperId, limit and cursor (each group's optional promise window timeZone included). The shopper defaults to the cookie's; without either the answer is 422 session-required. An undeclared parameter answers 400 unknown-query-parameter.
Open a checkout session for the cart
Relays checkout POST /checkout-sessions. The cart (default: the cookie's) and the shopper (the cookie's, required) are filled in; the saved address is only a shipToAddressId. Stores the session id in the sf_state cookie.
Orders
Orders
Quote delivery offers for the cart
Relays shopping-cart POST /carts/{cartId}/delivery-quotes, which calls delivery-promise synchronously (command budget).
Delivery dates and charges for one unit of a product
Called by the browser after the product page rendered. Quotes one line (quantity 1) with delivery-promise POST /delivery-quotes for the postal prefix and joins the per-tier delivery charge from the current pricing charge schedule. A missing charge schedule only leaves the charge out. On a timeout the page keeps its enter-a-postal-code text. Each tier carries the quoted window's destination timeZone when delivery-promise sent one.
Register a shopper
Relays customer-ordering POST /shoppers. The body, including saved addresses, passes through untouched and is never stored or logged. Stores the shopper id in the sf_state cookie.
Remove a cart line
Relays shopping-cart DELETE /carts/{cartId}/lines/{catalogItemId}. No Idempotency-Key is required; when the page sends a valid one it is forwarded upstream minted like any command key (and Idempotency-Replayed may be set). A malformed one is not checked here.
Search products
Relays product-discovery GET /products with the search filters q, categoryId, inStock, priceMin, priceMax, sort and the page parameters limit and cursor. An undeclared parameter answers 400 unknown-query-parameter; the answer is the provider's page {items, facets, categorySuggestions, nextCursor}.
Select a delivery offer for a shipment group
Relays shopping-cart PUT /carts/{cartId}/delivery-selection. No Idempotency-Key is required; when the page sends a valid one it is forwarded upstream minted like any command key (and Idempotency-Replayed may be set). A malformed one is not checked here.
Set the destination postal prefix
Relays shopping-cart PUT /carts/{cartId}/destination. Clears the current delivery quote. No Idempotency-Key is required; when the page sends a valid one it is forwarded upstream minted like any command key (and Idempotency-Replayed may be set). A malformed one is not checked here.
Change the quantity of a cart line
Relays shopping-cart PUT /carts/{cartId}/lines/{catalogItemId} (replace the line quantity). A PATCH, so it requires an Idempotency-Key.