Skip to main content

Module types

Module types 

Source
Expand description

Serde shapes for the basket API.

Every field here was observed on a live response, not read from documentation – there isn’t any. Structs are therefore deliberately permissive: unknown fields are ignored and almost everything is defaulted, so a K-Ruoka deploy that adds or drops a field degrades the output rather than failing the call.

Structs§

AmountInfo
Basket
The raw basket, as returned by /kr-api/basket/active and by every successful PATCH /kr-api/basket/by-id/{id}.
BasketItem
Brand
CartItemView
CartView
LocalizedName
MobileScan
MobileScanPricing
NewItem
NormalPrice
OfferProduct
OfferUnit
PersonalOffer
PersonalOfferNormalPricing
PersonalOfferPricing
PersonalOfferProduct
PersonalOfferProductView
PersonalOfferView
PersonalOffersResponse
POST /kr-api/tos-offers – OmaPlussa-edut, the account’s personalised offers. “tos” is K-Ruoka’s own term, seen throughout the frontend (tosOffers, isTargetingOffersAllowed); not modelled here since nothing surfaces it.
PersonalOffersView
PriceSummary
Pricing
ProductDetails
Only the one key we need. The full blob is several KB of nutrition data, images and category trees.
ProductHit
ProductSearchResponse
POST /kr-api/v2/product-search/{term}. Only the fields the tool surfaces are modelled; the response also carries aggregations, brands and suggestions.
ProductSearchView
ProductView
SearchProduct
Store
StoreHit
StoreSearchResponse
POST /kr-api/stores/search, which takes its query in a JSON body rather than the path or query string like product search does.
StoreSearchView
StoreView
UnitPrice
UserInfo
Empty strings throughout on an anonymous session; populated once logged in. This is the only reliable signal of whether the basket belongs to an account, because an anonymous caller gets a perfectly valid basket rather than a 401.

Enums§

BasketEvent
A cart mutation. PATCH /kr-api/basket/by-id/{id} always takes an array of these, even for a single change.

Constants§

DEFAULT_UNIT
K-Ruoka amounts always carry a unit. kpl (“pieces”) is overwhelmingly the common one, including for goods that are priced by weight.