Carts
Cart lines, destination and delivery selection (shopping-cart).
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.
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 a cart
Relays shopping-cart GET /carts/{cartId} with its quote, selections and estimate.
Add a line to the cart
Relays shopping-cart POST /carts/{cartId}/lines with a minted Idempotency-Key.
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.
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.
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.
Quote delivery offers for the cart
Relays shopping-cart POST /carts/{cartId}/delivery-quotes, which calls delivery-promise synchronously (command budget).
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.