openapi: 3.0.3 info: title: Storefront BFF API version: 0.1.0 contact: name: storefront-bff maintainers url: https://github.com/IQVO/storefront-bff description: >- 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); 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. servers: - url: /api/storefront tags: - name: Catalog description: Product search, category tree, product page and delivery dates (product-discovery, delivery-promise, pricing). - name: Carts description: Cart lines, destination and delivery selection (shopping-cart). - name: Checkout description: The purchase saga (checkout). - name: Orders description: Order history, tracking and cancellation (customer-ordering, joined with checkout totals). - name: Account description: Shopper registration, e-mail lookup and saved addresses (customer-ordering). paths: /products: get: tags: [Catalog] operationId: searchProducts summary: Search products description: 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}. parameters: - {name: q, in: query, required: false, schema: {type: string}} - {name: categoryId, in: query, required: false, schema: {type: string}} - {name: inStock, in: query, required: false, schema: {type: boolean}} - {name: priceMin, in: query, required: false, schema: {type: integer, format: int64, minimum: 0}} - {name: priceMax, in: query, required: false, schema: {type: integer, format: int64, minimum: 0}} - {name: sort, in: query, required: false, schema: {type: string, enum: [relevance, price-asc, price-desc, title]}} - $ref: '#/components/parameters/Limit' - $ref: '#/components/parameters/Cursor' responses: '200': description: One page of products, with the provider's facets and category suggestions. content: application/json: schema: {$ref: '#/components/schemas/ProductPage'} '400': {$ref: '#/components/responses/BadRequest'} '422': {$ref: '#/components/responses/Problem'} '503': {$ref: '#/components/responses/Problem'} '504': {$ref: '#/components/responses/Problem'} /categories: get: tags: [Catalog] operationId: listCategories summary: Get the category tree for department navigation description: >- 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. x-pagination-exempt: view responses: '200': {$ref: '#/components/responses/Json'} '503': {$ref: '#/components/responses/Problem'} '504': {$ref: '#/components/responses/Problem'} /products/{id}: get: tags: [Catalog] operationId: getProduct summary: Get one product view description: Relays product-discovery GET /products/{catalogItemId}, the full ProductView for the product page. parameters: - $ref: '#/components/parameters/Id' responses: '200': {$ref: '#/components/responses/Json'} '404': {$ref: '#/components/responses/Problem'} '422': {$ref: '#/components/responses/Problem'} '503': {$ref: '#/components/responses/Problem'} '504': {$ref: '#/components/responses/Problem'} /products/{id}/delivery-date-quotes: post: tags: [Catalog] operationId: quoteProductDeliveryDates summary: Delivery dates and charges for one unit of a product description: >- 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. parameters: - $ref: '#/components/parameters/Id' - $ref: '#/components/parameters/IdempotencyKey' requestBody: required: true content: application/json: schema: {$ref: '#/components/schemas/DeliveryDatesRequest'} responses: '200': description: One entry per quoted tier, plus the tiers the network cannot serve. headers: {Idempotency-Replayed: {$ref: '#/components/headers/IdempotencyReplayed'}} content: application/json: schema: {$ref: '#/components/schemas/DeliveryDates'} '400': {$ref: '#/components/responses/BadRequest'} '409': {$ref: '#/components/responses/Conflict'} '422': {$ref: '#/components/responses/Problem'} '413': {$ref: '#/components/responses/PayloadTooLarge'} '503': {$ref: '#/components/responses/Problem'} '504': {$ref: '#/components/responses/Problem'} /carts: post: tags: [Carts] operationId: createCart summary: Create a cart description: Relays shopping-cart POST /carts and stores the new cart id in the sf_state cookie. An empty body adopts the cookie's shopper. parameters: - $ref: '#/components/parameters/IdempotencyKey' requestBody: required: false content: application/json: schema: {$ref: '#/components/schemas/Passthrough'} responses: '201': description: The created cart; sets the sf_state cookie. headers: Set-Cookie: {$ref: '#/components/headers/SetCookie'} Idempotency-Replayed: {$ref: '#/components/headers/IdempotencyReplayed'} content: application/json: schema: {$ref: '#/components/schemas/Passthrough'} '400': {$ref: '#/components/responses/BadRequest'} '409': {$ref: '#/components/responses/Conflict'} '422': {$ref: '#/components/responses/Problem'} '413': {$ref: '#/components/responses/PayloadTooLarge'} '503': {$ref: '#/components/responses/Problem'} '504': {$ref: '#/components/responses/Problem'} get: tags: [Carts] operationId: listCarts summary: List carts of a shopper description: 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. parameters: - {name: shopperId, in: query, required: false, schema: {type: string}} - {name: state, in: query, required: false, schema: {type: string}} - $ref: '#/components/parameters/Limit' - $ref: '#/components/parameters/Cursor' responses: '200': description: One page of the shopper's carts. content: application/json: schema: {$ref: '#/components/schemas/CartPage'} '400': {$ref: '#/components/responses/BadRequest'} '422': {$ref: '#/components/responses/Problem'} '503': {$ref: '#/components/responses/Problem'} '504': {$ref: '#/components/responses/Problem'} /carts/{id}: get: tags: [Carts] operationId: getCart summary: Get a cart description: Relays shopping-cart GET /carts/{cartId} with its quote, selections and estimate. parameters: - $ref: '#/components/parameters/Id' responses: '200': {$ref: '#/components/responses/Json'} '404': {$ref: '#/components/responses/Problem'} '422': {$ref: '#/components/responses/Problem'} '503': {$ref: '#/components/responses/Problem'} '504': {$ref: '#/components/responses/Problem'} /carts/{id}/lines: post: tags: [Carts] operationId: addCartLine summary: Add a line to the cart description: Relays shopping-cart POST /carts/{cartId}/lines with a minted Idempotency-Key. parameters: - $ref: '#/components/parameters/Id' - $ref: '#/components/parameters/IdempotencyKey' requestBody: required: true content: application/json: schema: {$ref: '#/components/schemas/Passthrough'} responses: '200': {$ref: '#/components/responses/JsonCommand'} '400': {$ref: '#/components/responses/BadRequest'} '404': {$ref: '#/components/responses/Problem'} '409': {$ref: '#/components/responses/Conflict'} '422': {$ref: '#/components/responses/Problem'} '413': {$ref: '#/components/responses/PayloadTooLarge'} '503': {$ref: '#/components/responses/Problem'} '504': {$ref: '#/components/responses/Problem'} /carts/{id}/lines/{item}: patch: tags: [Carts] operationId: setCartLineQuantity summary: Change the quantity of a cart line description: Relays shopping-cart PUT /carts/{cartId}/lines/{catalogItemId} (replace the line quantity). A PATCH, so it requires an Idempotency-Key. parameters: - $ref: '#/components/parameters/Id' - $ref: '#/components/parameters/Item' - $ref: '#/components/parameters/IdempotencyKey' requestBody: required: true content: application/json: schema: {$ref: '#/components/schemas/Passthrough'} responses: '200': {$ref: '#/components/responses/JsonCommand'} '400': {$ref: '#/components/responses/BadRequest'} '404': {$ref: '#/components/responses/Problem'} '409': {$ref: '#/components/responses/Conflict'} '422': {$ref: '#/components/responses/Problem'} '413': {$ref: '#/components/responses/PayloadTooLarge'} '503': {$ref: '#/components/responses/Problem'} '504': {$ref: '#/components/responses/Problem'} delete: tags: [Carts] operationId: removeCartLine summary: Remove a cart line description: 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. parameters: - $ref: '#/components/parameters/Id' - $ref: '#/components/parameters/Item' responses: '200': {$ref: '#/components/responses/JsonCommand'} '404': {$ref: '#/components/responses/Problem'} '409': {$ref: '#/components/responses/Problem'} '422': {$ref: '#/components/responses/Problem'} '503': {$ref: '#/components/responses/Problem'} '504': {$ref: '#/components/responses/Problem'} /carts/{id}/destination: put: tags: [Carts] operationId: setCartDestination summary: Set the destination postal prefix description: 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. parameters: - $ref: '#/components/parameters/Id' requestBody: required: true content: application/json: schema: {$ref: '#/components/schemas/Passthrough'} responses: '200': {$ref: '#/components/responses/JsonCommand'} '400': {$ref: '#/components/responses/BadRequest'} '404': {$ref: '#/components/responses/Problem'} '409': {$ref: '#/components/responses/Problem'} '422': {$ref: '#/components/responses/Problem'} '413': {$ref: '#/components/responses/PayloadTooLarge'} '503': {$ref: '#/components/responses/Problem'} '504': {$ref: '#/components/responses/Problem'} /carts/{id}/delivery-quotes: post: tags: [Carts] operationId: quoteCartDelivery summary: Quote delivery offers for the cart description: Relays shopping-cart POST /carts/{cartId}/delivery-quotes, which calls delivery-promise synchronously (command budget). parameters: - $ref: '#/components/parameters/Id' - $ref: '#/components/parameters/IdempotencyKey' responses: '200': {$ref: '#/components/responses/JsonCommand'} '400': {$ref: '#/components/responses/BadRequest'} '404': {$ref: '#/components/responses/Problem'} '409': {$ref: '#/components/responses/Conflict'} '422': {$ref: '#/components/responses/Problem'} '503': {$ref: '#/components/responses/Problem'} '504': {$ref: '#/components/responses/Problem'} /carts/{id}/delivery-selection: put: tags: [Carts] operationId: selectCartDelivery summary: Select a delivery offer for a shipment group description: 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. parameters: - $ref: '#/components/parameters/Id' requestBody: required: true content: application/json: schema: {$ref: '#/components/schemas/Passthrough'} responses: '200': {$ref: '#/components/responses/JsonCommand'} '400': {$ref: '#/components/responses/BadRequest'} '404': {$ref: '#/components/responses/Problem'} '409': {$ref: '#/components/responses/Problem'} '422': {$ref: '#/components/responses/Problem'} '413': {$ref: '#/components/responses/PayloadTooLarge'} '503': {$ref: '#/components/responses/Problem'} '504': {$ref: '#/components/responses/Problem'} /checkout: post: tags: [Checkout] operationId: openCheckout summary: Open a checkout session for the cart description: >- 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. parameters: - $ref: '#/components/parameters/IdempotencyKey' requestBody: required: true content: application/json: schema: {$ref: '#/components/schemas/OpenCheckoutRequest'} responses: '201': description: The opened session; sets the sf_state cookie. headers: Set-Cookie: {$ref: '#/components/headers/SetCookie'} Idempotency-Replayed: {$ref: '#/components/headers/IdempotencyReplayed'} content: application/json: schema: {$ref: '#/components/schemas/Passthrough'} '400': {$ref: '#/components/responses/BadRequest'} '409': {$ref: '#/components/responses/Conflict'} '422': {$ref: '#/components/responses/Problem'} '413': {$ref: '#/components/responses/PayloadTooLarge'} '503': {$ref: '#/components/responses/Problem'} '504': {$ref: '#/components/responses/Problem'} /checkout/{id}: get: tags: [Checkout] operationId: getCheckout summary: Get a checkout session description: Relays checkout GET /checkout-sessions/{sessionId}. The page polls it while a placement is in doubt (202 from confirmations). parameters: - $ref: '#/components/parameters/Id' responses: '200': {$ref: '#/components/responses/Json'} '404': {$ref: '#/components/responses/Problem'} '422': {$ref: '#/components/responses/Problem'} '503': {$ref: '#/components/responses/Problem'} '504': {$ref: '#/components/responses/Problem'} /checkout/{id}/confirmations: post: tags: [Checkout] operationId: confirmCheckout summary: Confirm the session with a payment method token description: >- 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. parameters: - $ref: '#/components/parameters/Id' - $ref: '#/components/parameters/IdempotencyKey' requestBody: required: true content: application/json: schema: {$ref: '#/components/schemas/ConfirmCheckoutRequest'} responses: '200': {$ref: '#/components/responses/JsonCommand'} '202': {$ref: '#/components/responses/JsonCommand'} '400': {$ref: '#/components/responses/BadRequest'} '404': {$ref: '#/components/responses/Problem'} '409': {$ref: '#/components/responses/Conflict'} '422': {$ref: '#/components/responses/Problem'} '413': {$ref: '#/components/responses/PayloadTooLarge'} '503': {$ref: '#/components/responses/Problem'} '504': {$ref: '#/components/responses/Problem'} /orders: get: tags: [Orders] operationId: listOrders summary: List the shopper's orders description: 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. parameters: - {name: shopperId, in: query, required: false, schema: {type: string}} - $ref: '#/components/parameters/Limit' - $ref: '#/components/parameters/Cursor' responses: '200': description: One page of the shopper's orders. content: application/json: schema: {$ref: '#/components/schemas/OrderPage'} '400': {$ref: '#/components/responses/BadRequest'} '404': {$ref: '#/components/responses/Problem'} '422': {$ref: '#/components/responses/Problem'} '503': {$ref: '#/components/responses/Problem'} '504': {$ref: '#/components/responses/Problem'} /orders/{id}: get: tags: [Orders] operationId: getOrder summary: Get an order with tracking and checkout totals description: >- 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. parameters: - $ref: '#/components/parameters/Id' responses: '200': {$ref: '#/components/responses/Json'} '404': {$ref: '#/components/responses/Problem'} '422': {$ref: '#/components/responses/Problem'} '503': {$ref: '#/components/responses/Problem'} '504': {$ref: '#/components/responses/Problem'} /orders/{id}/cancellations: post: tags: [Orders] operationId: cancelOrder summary: Request the cancellation of an order description: Relays customer-ordering POST /orders/{orderId}/cancellations. Refused upstream (409 cancel-after-lock) once a group is locked. parameters: - $ref: '#/components/parameters/Id' - $ref: '#/components/parameters/IdempotencyKey' requestBody: required: true content: application/json: schema: {$ref: '#/components/schemas/CancelOrderRequest'} responses: '200': {$ref: '#/components/responses/JsonCommand'} '400': {$ref: '#/components/responses/BadRequest'} '404': {$ref: '#/components/responses/Problem'} '409': {$ref: '#/components/responses/Conflict'} '422': {$ref: '#/components/responses/Problem'} '413': {$ref: '#/components/responses/PayloadTooLarge'} '503': {$ref: '#/components/responses/Problem'} '504': {$ref: '#/components/responses/Problem'} /shoppers: post: tags: [Account] operationId: registerShopper summary: Register a shopper description: 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. parameters: - $ref: '#/components/parameters/IdempotencyKey' requestBody: required: true content: application/json: schema: {$ref: '#/components/schemas/Passthrough'} responses: '201': description: The registered shopper; sets the sf_state cookie. headers: Set-Cookie: {$ref: '#/components/headers/SetCookie'} Idempotency-Replayed: {$ref: '#/components/headers/IdempotencyReplayed'} content: application/json: schema: {$ref: '#/components/schemas/Passthrough'} '400': {$ref: '#/components/responses/BadRequest'} '409': {$ref: '#/components/responses/Conflict'} '422': {$ref: '#/components/responses/Problem'} '413': {$ref: '#/components/responses/PayloadTooLarge'} '503': {$ref: '#/components/responses/Problem'} '504': {$ref: '#/components/responses/Problem'} /sessions: post: tags: [Account] operationId: createSession summary: Start a session by e-mail lookup description: >- 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. parameters: - $ref: '#/components/parameters/IdempotencyKey' requestBody: required: true content: application/json: schema: {$ref: '#/components/schemas/CreateSessionRequest'} responses: '200': description: The shopper; sets the sf_state cookie. headers: Set-Cookie: {$ref: '#/components/headers/SetCookie'} Idempotency-Replayed: {$ref: '#/components/headers/IdempotencyReplayed'} content: application/json: schema: {$ref: '#/components/schemas/Passthrough'} '400': {$ref: '#/components/responses/BadRequest'} '404': {$ref: '#/components/responses/Problem'} '422': {$ref: '#/components/responses/Problem'} '409': {$ref: '#/components/responses/Conflict'} '413': {$ref: '#/components/responses/PayloadTooLarge'} '503': {$ref: '#/components/responses/Problem'} '504': {$ref: '#/components/responses/Problem'} /me: get: tags: [Account] operationId: getMe summary: Get the cookie's shopper description: Relays customer-ordering GET /shoppers/{shopperId} for the shopper in the cookie; 422 session-required without one. responses: '200': {$ref: '#/components/responses/Json'} '404': {$ref: '#/components/responses/Problem'} '422': {$ref: '#/components/responses/Problem'} '503': {$ref: '#/components/responses/Problem'} '504': {$ref: '#/components/responses/Problem'} /me/addresses: post: tags: [Account] operationId: addMyAddress summary: Save an address for the cookie's shopper description: Relays customer-ordering POST /shoppers/{shopperId}/addresses. The address passes through; it is never stored or logged here. parameters: - $ref: '#/components/parameters/IdempotencyKey' requestBody: required: true content: application/json: schema: {$ref: '#/components/schemas/Passthrough'} responses: '201': {$ref: '#/components/responses/JsonCommand'} '400': {$ref: '#/components/responses/BadRequest'} '404': {$ref: '#/components/responses/Problem'} '409': {$ref: '#/components/responses/Conflict'} '422': {$ref: '#/components/responses/Problem'} '413': {$ref: '#/components/responses/PayloadTooLarge'} '503': {$ref: '#/components/responses/Problem'} '504': {$ref: '#/components/responses/Problem'} components: parameters: Id: name: id in: path required: true description: An upstream resource id (letters, digits, dot, underscore, dash; the first character a letter or digit; at most 128 characters). A malformed id answers 422 validation-failed before any upstream call. # pattern mirrors composition.ValidID schema: {type: string, minLength: 1, maxLength: 128, pattern: '^[A-Za-z0-9][A-Za-z0-9._-]*$'} Item: name: item in: path required: true description: A catalogue item id (same shape as the id parameter; malformed answers 422 validation-failed). schema: {type: string, minLength: 1, maxLength: 128, pattern: '^[A-Za-z0-9][A-Za-z0-9._-]*$'} IdempotencyKey: name: Idempotency-Key in: header required: true description: >- The page's key for one user submit: a fresh crypto.randomUUID() per submit, reused on retry. The BFF forwards to the upstream command a key minted from (route, subject, this key); the provider replays a retry and answers 409 idempotency-key-reused when the same key carries a different request. Missing: 400 idempotency-key-required; longer than 128 characters or not visible ASCII: 400 idempotency-key-invalid. schema: {type: string, minLength: 1, maxLength: 128} Limit: name: limit in: query required: false description: Page size (default 100). Validated at the edge (an integer 1-500, present once and non-empty, else 400 invalid-limit) and relayed. schema: {type: integer, minimum: 1, maximum: 500, default: 100} Cursor: name: cursor in: query required: false description: The opaque nextCursor of the previous page, relayed to the provider unchanged (400 invalid-cursor from the provider when it is not one of its tokens). schema: {type: string} headers: SetCookie: description: The sf_state cookie (HttpOnly, SameSite=Lax, path /api/storefront, Max-Age 30 days, Secure when COOKIE_SECURE is set). State, not authentication. schema: {type: string} IdempotencyReplayed: description: Present, with the value true, only when the answer is a replay of a stored one (any upstream write hop of the composition was replayed). schema: {type: string, enum: ["true"]} responses: Json: description: The upstream answer, relayed unchanged. content: application/json: schema: {$ref: '#/components/schemas/Passthrough'} JsonCommand: description: The upstream answer to a keyed command, relayed unchanged. headers: Idempotency-Replayed: {$ref: '#/components/headers/IdempotencyReplayed'} content: application/json: schema: {$ref: '#/components/schemas/Passthrough'} BadRequest: description: >- A 400 problem: idempotency-key-required, idempotency-key-invalid, unknown-query-parameter, invalid-limit, invalid-cursor (relayed from the provider) or malformed-request (a NUL character in the query string or body, or an unreadable body). content: application/problem+json: schema: {$ref: '#/components/schemas/Problem'} examples: idempotency-key-required: value: {type: /problems/idempotency-key-required, title: Idempotency-Key header is required, status: 400} unknown-query-parameter: value: {type: /problems/unknown-query-parameter, title: Unknown query parameter, status: 400, detail: unknown query parameter after} Conflict: description: >- A 409 problem relayed from the provider: a business conflict, or idempotency-key-reused when the same Idempotency-Key was sent with a different request (method, path or body). The BFF passes it through unchanged. content: application/problem+json: schema: {$ref: '#/components/schemas/Problem'} examples: idempotency-key-reused: value: {type: /problems/idempotency-key-reused, title: Idempotency-Key reused with a different request, status: 409} PayloadTooLarge: description: 'A 413 payload-too-large problem from the edge: the request body is over 1 MiB (checked before any upstream call).' content: application/problem+json: schema: {$ref: '#/components/schemas/Problem'} Problem: description: >- An RFC 9457 problem. Upstream problems are relayed unchanged; the edge adds validation-failed, session-required, malformed-request, payload-too-large, upstream-unavailable (503), gateway-timeout (504), route-not-allowed (500), internal-error (500) and client-closed-request (499, the caller went away). Any route also answers 404 resource-not-found for a path it does not serve (or one containing NUL) and 405 method-not-allowed for a wrong method. content: application/problem+json: schema: {$ref: '#/components/schemas/Problem'} schemas: Passthrough: type: object description: A JSON document owned by the upstream contract; the BFF does not interpret it. additionalProperties: true ProductPage: type: object description: product-discovery's search page, relayed unchanged. required: [items] properties: items: {type: array, items: {$ref: '#/components/schemas/Passthrough'}} facets: {$ref: '#/components/schemas/Passthrough'} categorySuggestions: {type: array, items: {$ref: '#/components/schemas/Passthrough'}} nextCursor: {type: string, description: Absent on the last page.} CartPage: type: object description: shopping-cart's carts page, relayed unchanged. required: [items] properties: items: {type: array, items: {$ref: '#/components/schemas/Passthrough'}} nextCursor: {type: string, description: Absent on the last page.} OrderPage: type: object description: customer-ordering's orders page, relayed unchanged. required: [items] properties: items: {type: array, items: {$ref: '#/components/schemas/Passthrough'}} nextCursor: {type: string, description: Absent on the last page.} Problem: type: object description: RFC 9457 problem details. required: [type, title, status] properties: type: {type: string, format: uri-reference, description: 'Problem type, for example /problems/validation-failed.'} title: {type: string} status: {type: integer, minimum: 400, maximum: 599} detail: {type: string} DeliveryDatesRequest: type: object required: [postalPrefix] additionalProperties: false properties: postalPrefix: type: string minLength: 1 maxLength: 10 pattern: '^[0-9A-Za-z -]+$' description: A postal prefix, never a full address. Letters, digits, space and hyphen only, not blank; anything else answers 422 validation-failed. DeliveryDates: type: object required: [postalPrefix, tiers, unavailable] properties: postalPrefix: {type: string} tiers: type: array items: type: object required: [tier, deliverByEarliest, deliverByLatest, offerExpiresAt] properties: tier: {type: string, enum: [SAME_DAY, NEXT_DAY, TWO_DAY, STANDARD]} deliverByEarliest: {type: string, format: date-time} deliverByLatest: {type: string, format: date-time} timeZone: type: string description: >- IANA time zone of the destination (for example America/Chicago), relayed from the delivery-promise quoted window. Read the window instants as local days and hours in this zone; absent for windows quoted without one, read those as UTC. example: America/Chicago offerExpiresAt: {type: string, format: date-time} charge: {$ref: '#/components/schemas/Passthrough'} freeOver: {$ref: '#/components/schemas/Passthrough'} unavailable: type: array items: {$ref: '#/components/schemas/Passthrough'} OpenCheckoutRequest: type: object required: [shipToAddressId] additionalProperties: false properties: cartId: {type: string, description: "Defaults to the cookie's cart."} shipToAddressId: {type: string, description: "A saved address id held by customer-ordering; never the address."} ConfirmCheckoutRequest: type: object required: [paymentMethodToken] additionalProperties: false properties: paymentMethodToken: {type: string, minLength: 1, maxLength: 256, description: "The PSP token from the hosted fields; never a card number."} CancelOrderRequest: type: object required: [reason] additionalProperties: false properties: reason: {type: string, minLength: 1, maxLength: 200} CreateSessionRequest: type: object required: [email] additionalProperties: false properties: email: {type: string, minLength: 1, maxLength: 254}