Use when the user wants to shop for groceries at Selver, build a Selver shopping cart, search for products on Selver.ee, or create a shareable Selver cart link.
Build a Selver.ee grocery cart through conversation.
selver-search.shselver-create-cart.sh (do this once, reuse the cart ID)selver-add-items.sh (batch all items in one call)selver-share-cart.shAlways confirm product choices with the user before adding to cart. If a search returns multiple close matches, ask which one they want.
Note: The share link merges into the user's existing Selver cart in the browser. Advise the user to clear their selver.ee cart first if they want a clean start.
All scripts are in the scripts/ directory relative to this file.
Search for products by keyword.
selver-search.sh <term> [noOfResults]
term — search query (e.g. "piim", "leib", "Kalev šokolaad")noOfResults — optional, defaults to 6Returns JSON with product results. Each result has: name, sku, salePrice, currency, url, image.
Create a new guest cart. No arguments.
selver-create-cart.sh
Returns the cart ID string. Save this — you need it for adding items and sharing.
Add one or more items to a cart.
selver-add-items.sh <cartId> <sku1:qty1> [sku2:qty2] ...
cartId — the cart ID from selver-create-cart.shsku:qty pairs — product SKU and quantity separated by colonReturns the API response with cart contents.
Generate a shareable link for a cart.
selver-share-cart.sh <cartId>
Returns the full URL that opens a pre-filled cart on selver.ee.