### Install migros-api-wrapper using npm Source: https://github.com/aliyss/migros-api-wrapper/blob/master/README.md This command installs the migros-api-wrapper package as a project dependency using npm. It is the first step to integrate the wrapper into your project. ```bash npm install --save migros-api-wrapper ``` -------------------------------- ### TypeScript Usage Example: Product Search and Account Security Source: https://github.com/aliyss/migros-api-wrapper/blob/master/README.md This TypeScript example demonstrates how to use the migros-api-wrapper. It shows how to perform a product search using a guest token and how to retrieve security options for a Migros API account, which requires login cookies. ```typescript import { MigrosAPI, ILoginCookies } from "migros-api-wrapper"; main(); async function main() { // Search for products matching a certain string. const guestInfo = await MigrosAPI.account.oauth2.getGuestToken(); const responseProductSearch = await MigrosAPI.products.productSearch.searchProduct({ query: "cooking salt", }, { leshopch: guestInfo.token }) console.log(responseProductSearch) // Certain API Calls need cookies to be accessed. // For more accessible options and automatic logins check the IamQuiteHungry Repository: https://github.com/Aliyss/IAmQuiteHungry const loginCookies: ILoginCookies = { __VCAP_ID__: "", MDID: "", JSESSIONID: "", CSRF: "", MLRM: "", MTID: "", hl: "", TS012f1684: "" } // Get security options of your MigrosAPI Account const securityOptions = await MigrosAPI.account.security.getOptions(loginCookies) console.log(securityOptions) } ``` -------------------------------- ### Get Recipe Products Source: https://context7.com/aliyss/migros-api-wrapper/llms.txt Retrieves Migros product IDs associated with a recipe's ingredients for shopping integration. This endpoint does not require authentication. ```APIDOC ## GET /migusto/recipeProducts ### Description Retrieves Migros product IDs associated with a recipe's ingredients for shopping integration. ### Method GET ### Endpoint /migusto/recipeProducts ### Query Parameters - **id** (string) - Required - Recipe ID from recipe search. - **language** (string) - Optional - Language code for the recipe (e.g., 'de'). - **limit** (number) - Optional - Maximum number of products to return. - **offset** (number) - Optional - Number of products to skip. ### Response #### Success Response (200) - **productIds** (array) - An array of Migros product IDs matching the recipe ingredients. ### Response Example { "productIds": [ "11111", "22222", "33333" ] } ``` -------------------------------- ### Get Security Options (Authenticated) Source: https://context7.com/aliyss/migros-api-wrapper/llms.txt Retrieves account security settings for an authenticated Migros account. Requires valid login cookies obtained through a browser session. ```APIDOC ## GET /account/security/options ### Description Retrieves account security settings for an authenticated Migros account. Requires valid login cookies. ### Method GET ### Endpoint /account/security/options ### Request Body - **loginCookies** (object) - Required - Object containing valid login cookies. - **__VCAP_ID__** (string) - Required - VCAP ID cookie. - **MDID** (string) - Required - MDID cookie. - **JSESSIONID** (string) - Required - JSESSIONID cookie. - **INGRESSCOOKIE** (string) - Required - Ingress cookie. - **CSRF** (string) - Required - CSRF token. - **MLRM** (string) - Required - MLRM cookie. - **MTID** (string) - Required - MTID cookie. - **hl** (string) - Optional - Language preference. - **TS012f1684** (string) - Required - TS value cookie. ### Response #### Success Response (200) - **twoFactorAuthentication** (boolean) - Status of two-factor authentication. - **deviceLoginNotifications** (boolean) - Status of device login notifications. - **securityPreferences** (object) - User-defined security preferences. ### Response Example { "twoFactorAuthentication": true, "deviceLoginNotifications": false, "securityPreferences": { "passwordChangeRequired": false } } ``` -------------------------------- ### Get Recipe Details with Migros API Source: https://context7.com/aliyss/migros-api-wrapper/llms.txt Retrieves detailed information for a specific recipe from Migusto using its URL slug. This includes ingredients, instructions, cooking times, and nutritional data. The function supports multiple languages. ```typescript import { MigrosAPI } from "migros-api-wrapper"; async function getRecipeDetails() { const recipeOptions = { slug: "spaghetti-bolognese", // Recipe URL slug language: "de", // Language.DE (de, en, fr, it) }; const recipe = await MigrosAPI.migusto.recipeDetails(recipeOptions); console.log("Recipe:", recipe.name); console.log("Rating:", recipe.aggregateRating.ratingValue, "/5"); console.log("Reviews:", recipe.aggregateRating.reviewCount); console.log("Total time:", recipe.totalTime); console.log("Servings:", recipe.recipeYield); console.log("Category:", recipe.recipeCategory); console.log("\nIngredients:"); recipe.recipeIngredients.forEach((ingredient) => { console.log(`- ${ingredient}`); }); console.log("\nInstructions:"); recipe.recipeInstructions.forEach((step, index) => { console.log(`${index + 1}. ${step}`); }); } getRecipeDetails(); ``` -------------------------------- ### Get Product Details using TypeScript Source: https://context7.com/aliyss/migros-api-wrapper/llms.txt Retrieves detailed information for specific products identified by their UIDs. This function requires a guest token and allows specifying store type, region, and warehouse ID. The response contains comprehensive product data including pricing, nutritional information, and availability. ```typescript import { MigrosAPI } from "migros-api-wrapper"; async function getProductDetails() { const guestInfo = await MigrosAPI.account.oauth2.getGuestToken(); // Get details for specific products by UID const productDetailOptions = { uids: ["100100300000", "100100400000"], storeType: "OFFLINE", // StoreType.OFFLINE region: "national", // Region.NATIONAL warehouseId: 1, }; const response = await MigrosAPI.products.productDisplay.getProductDetails( productDetailOptions, { leshopch: guestInfo.token } ); console.log("Product details:", response); // Returns detailed product information including: // - Name, description, brand // - Price and offers // - Nutritional information // - Availability status } getProductDetails(); ``` -------------------------------- ### Get Cumulus Receipt Details (Authenticated) Source: https://context7.com/aliyss/migros-api-wrapper/llms.txt Retrieves detailed receipt information, including individual items, prices, and payment details for a specific transaction. Requires Cumulus cookies. ```APIDOC ## GET /account/cumulus/receipt/{transactionId} ### Description Retrieves detailed receipt information including individual items, prices, and payment details. ### Method GET ### Endpoint /account/cumulus/receipt/{transactionId} ### Path Parameters - **transactionId** (string) - Required - The unique identifier of the transaction. ### Query Parameters - **fallbackLanguage** (string) - Optional - Language code for fallback if primary language is not available (e.g., 'de'). - **rawHtml** (boolean) - Optional - If true, returns raw HTML of the receipt; otherwise, returns a parsed object. Defaults to false. ### Request Body - **cumulusCookies** (object) - Required - Object containing valid Cumulus cookies. - **JSESSIONID** (string) - Required - JSESSIONID cookie. - **INGRESSCOOKIE** (string) - Required - Ingress cookie. - **CSRF** (string) - Required - CSRF token. - **__VCAP_ID__** (string) - Required - VCAP ID cookie. ### Response #### Success Response (200) - **receipt** (object | string) - Either a parsed receipt object or raw HTML string if `rawHtml` is true. - **store** (object) - **outlet** (string) - Name of the store outlet. - **total** (object) - **currency** (string) - Currency of the total amount. - **value** (number) - Total amount of the transaction. - **payment** (object) - **type** (string) - Payment method used. - **cumulus** (object) - **points** (object) - **received** (number) - Cumulus points received for this transaction. - **articles** (array) - List of purchased items. - **product** (string) - Name of the product. - **count** (number) - Quantity of the product. - **price** (object) - **single** (number) - Price per unit. - **total** (number) - Total price for this item. ### Response Example (Parsed Object) { "store": { "outlet": "Migros Bahnhofstrasse" }, "total": { "currency": "CHF", "value": 35.50 }, "payment": { "type": "Cumulus" }, "cumulus": { "points": { "received": 15 } }, "articles": [ { "product": "Bio-Apfel", "count": 5, "price": { "single": 0.80, "total": 4.00 } }, { "product": "Vollkornbrot", "count": 1, "price": { "single": 4.50, "total": 4.50 } } ] } ``` -------------------------------- ### Get Cumulus Receipts (Authenticated) Source: https://context7.com/aliyss/migros-api-wrapper/llms.txt Retrieves a list of purchase receipts for a specified date range from the Cumulus account. Requires Cumulus cookies. ```APIDOC ## GET /account/cumulus/receipts ### Description Retrieves a list of purchase receipts for a date range from the Cumulus account. ### Method GET ### Endpoint /account/cumulus/receipts ### Query Parameters - **dateFrom** (Date) - Required - Start date for the receipt search. - **dateTo** (Date) - Required - End date for the receipt search. ### Request Body - **cumulusCookies** (object) - Required - Object containing valid Cumulus cookies. - **JSESSIONID** (string) - Required - JSESSIONID cookie. - **INGRESSCOOKIE** (string) - Required - Ingress cookie. - **CSRF** (string) - Required - CSRF token. - **__VCAP_ID__** (string) - Required - VCAP ID cookie. ### Response #### Success Response (200) - **receipts** (array) - A list of receipt summaries. - **transactionId** (string) - Unique identifier for the transaction. - **date** (string) - Date of the transaction. - **store** (string) - Name of the store where the purchase was made. - **total** (number) - Total amount of the transaction. ### Response Example { "receipts": [ { "transactionId": "12345678", "date": "2024-01-15T10:30:00Z", "store": "Migros Supermarkt", "total": 55.75 }, { "transactionId": "87654321", "date": "2024-01-20T14:00:00Z", "store": "Migros Do it + Garden", "total": 120.50 } ] } ``` -------------------------------- ### Get Cumulus Statistics (Authenticated) Source: https://context7.com/aliyss/migros-api-wrapper/llms.txt Retrieves Cumulus loyalty program statistics for an authenticated account, including points balance and history. Requires valid login cookies. ```APIDOC ## GET /account/cumulus/stats ### Description Retrieves Cumulus loyalty program statistics for an authenticated account including points balance and history. ### Method GET ### Endpoint /account/cumulus/stats ### Request Body - **loginCookies** (object) - Required - Object containing valid login cookies. - **__VCAP_ID__** (string) - Required - VCAP ID cookie. - **MDID** (string) - Required - MDID cookie. - **JSESSIONID** (string) - Required - JSESSIONID cookie. - **INGRESSCOOKIE** (string) - Required - Ingress cookie. - **CSRF** (string) - Required - CSRF token. - **MLRM** (string) - Required - MLRM cookie. - **MTID** (string) - Required - MTID cookie. - **hl** (string) - Optional - Language preference. - **TS012f1684** (string) - Required - TS value cookie. ### Response #### Success Response (200) - **pointsBalance** (number) - Current Cumulus points balance. - **pointsEarnedPeriod** (number) - Points earned in the current period. - **historicalData** (object) - Object containing historical Cumulus data. ### Response Example { "pointsBalance": 1500, "pointsEarnedPeriod": 250, "historicalData": { "lastYear": 1200, "allTime": 5000 } } ``` -------------------------------- ### Get Product Cards using TypeScript Source: https://context7.com/aliyss/migros-api-wrapper/llms.txt Fetches product card information suitable for catalog views. It uses product UIDs and offer filters, including store type, region, and a specific date for ongoing offers. This function requires a guest token and returns data for displaying products in a summarized card format. ```typescript import { MigrosAPI } from "migros-api-wrapper"; async function getProductCards() { const guestInfo = await MigrosAPI.account.oauth2.getGuestToken(); const productCardsOptions = { productFilter: { uids: [100100300000, 100100400000], // Product UIDs as numbers }, offerFilter: { storeType: "OFFLINE", region: "national", ongoingOfferDate: new Date().toISOString().split("T")[0] + "T00:00:00", }, }; const response = await MigrosAPI.products.productDisplay.getProductCards( productCardsOptions, { leshopch: guestInfo.token } ); console.log("Product cards:", response); // Returns card display data for each product } getProductCards(); ``` -------------------------------- ### Get Migros Recipe Products by ID Source: https://context7.com/aliyss/migros-api-wrapper/llms.txt Retrieves Migros product IDs associated with a recipe's ingredients using the recipe ID. This function requires the recipe ID, language, and optional limit/offset parameters. The output is an array of product IDs that can be used to fetch further product details. ```typescript import { MigrosAPI } from "migros-api-wrapper"; async function getRecipeProducts() { const productOptions = { id: "12345", // Recipe ID from recipe search language: "de", limit: 20, offset: 0, }; const response = await MigrosAPI.migusto.recipeProducts(productOptions); console.log("Product IDs for recipe:", response.productIds); // Returns array of Migros product IDs matching recipe ingredients // Can be used with getProductCards or getProductDetails for shopping list } getRecipeProducts(); ``` -------------------------------- ### Get Authenticated Migros Account Security Options Source: https://context7.com/aliyss/migros-api-wrapper/llms.txt Retrieves account security settings for an authenticated Migros account. This function requires valid login cookies obtained from a browser session. The output includes details about two-factor authentication and device login notifications. ```typescript import { MigrosAPI, ILoginCookies } from "migros-api-wrapper"; async function getSecurityOptions() { // Login cookies must be obtained through browser session const loginCookies: ILoginCookies = { __VCAP_ID__: "your-vcap-id", MDID: "your-mdid", JSESSIONID: "your-session-id", INGRESSCOOKIE: "your-ingress-cookie", CSRF: "your-csrf-token", MLRM: "your-mlrm", MTID: "your-mtid", hl: "en", TS012f1684: "your-ts-value", }; const securityOptions = await MigrosAPI.account.security.getOptions(loginCookies); console.log("Security settings:", securityOptions); // Returns account security configuration including: // - Two-factor authentication status // - Device login notifications // - Security preferences } ``` -------------------------------- ### Get Product Availability with Migros API Source: https://context7.com/aliyss/migros-api-wrapper/llms.txt Checks the availability of specific products at given store locations using product IDs and cost center IDs. This function requires authentication and returns the stock status for each specified store. ```typescript import { MigrosAPI } from "migros-api-wrapper"; async function checkProductSupply() { const guestInfo = await MigrosAPI.account.oauth2.getGuestToken(); const supplyOptions = { pids: "100100300000", // Product ID costCenterIds: ["1", "2", "3"], // Store cost center IDs }; const response = await MigrosAPI.products.productStock.getProductSupply( supplyOptions, { leshopch: guestInfo.token } ); console.log("Availability:", response); // Returns availability status for each store } checkProductSupply(); ``` -------------------------------- ### Get Guest Token using TypeScript Source: https://context7.com/aliyss/migros-api-wrapper/llms.txt Obtains a guest authentication token required for accessing public Migros APIs. This token is essential for unauthenticated requests like product searches and retrieving store information. The function logs the obtained token to the console. ```typescript import { MigrosAPI } from "migros-api-wrapper"; async function getGuestToken() { // Obtain a guest token for unauthenticated API access const guestInfo = await MigrosAPI.account.oauth2.getGuestToken(); console.log("Guest Token:", guestInfo.token); // Output: Guest Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... return guestInfo.token; } getGuestToken(); ``` -------------------------------- ### Get Authenticated Migros Cumulus Statistics Source: https://context7.com/aliyss/migros-api-wrapper/llms.txt Retrieves Cumulus loyalty program statistics for an authenticated account. This function requires valid login cookies. The output includes the current points balance and historical data for the loyalty program. ```typescript import { MigrosAPI, ILoginCookies } from "migros-api-wrapper"; async function getCumulusStats() { const loginCookies: ILoginCookies = { __VCAP_ID__: "your-vcap-id", MDID: "your-mdid", JSESSIONID: "your-session-id", INGRESSCOOKIE: "your-ingress-cookie", CSRF: "your-csrf-token", MLRM: "your-mlrm", MTID: "your-mtid", hl: "en", TS012f1684: "your-ts-value", }; const stats = await MigrosAPI.account.cumulus.getCumulusStats(loginCookies); console.log("Cumulus stats:", stats); // Returns Cumulus account statistics including: // - Current points balance // - Points earned this period // - Historical data } ``` -------------------------------- ### Get User Info with OAuth2 Token (TypeScript) Source: https://context7.com/aliyss/migros-api-wrapper/llms.txt Retrieves user profile information by making a request to the getUserInfo endpoint using an OAuth2 bearer token. It returns user details such as name, email, Cumulus membership information, and account preferences. ```typescript import { MigrosAPI } from "migros-api-wrapper"; async function getUserInfo() { // OAuth2 token obtained through login flow const cumulusToken = "your-oauth2-bearer-token"; const userInfo = await MigrosAPI.account.oauth2.getUserInfo(cumulusToken); console.log("User info:", userInfo.body); // Returns user profile data including: // - Name, email // - Cumulus membership details // - Account preferences } getUserInfo(); ``` -------------------------------- ### Get Authenticated Migros Cumulus Receipts by Date Range Source: https://context7.com/aliyss/migros-api-wrapper/llms.txt Retrieves a list of purchase receipts from the Cumulus account within a specified date range. This function requires Cumulus cookies and date parameters (dateFrom, dateTo). The output is a list of receipt summaries containing transaction IDs. ```typescript import { MigrosAPI, ICumulusCookies, ICumulusReceiptsOptions } from "migros-api-wrapper"; async function getCumulusReceipts() { // Cumulus cookies from authenticated browser session const cumulusCookies: ICumulusCookies = { JSESSIONID: "your-session-id", INGRESSCOOKIE: "your-ingress-cookie", CSRF: "your-csrf-token", __VCAP_ID__: "your-vcap-id", }; const receiptsOptions: ICumulusReceiptsOptions = { dateFrom: new Date("2024-01-01"), dateTo: new Date("2024-01-31"), }; const receipts = await MigrosAPI.account.cumulus.getCumulusReceipts( receiptsOptions, cumulusCookies ); console.log("Receipts found:", receipts); // Returns list of receipt summaries with transaction IDs } ``` -------------------------------- ### Get Authenticated Migros Cumulus Receipt Details by Transaction ID Source: https://context7.com/aliyss/migros-api-wrapper/llms.txt Retrieves detailed information for a specific Cumulus receipt using its transaction ID. This function requires Cumulus cookies and receipt options, including the transaction ID and a fallback language. It can return either a parsed receipt object or raw HTML. ```typescript import { MigrosAPI, ICumulusCookies, ICumulusReceiptOptions } from "migros-api-wrapper"; async function getReceiptDetails() { const cumulusCookies: ICumulusCookies = { JSESSIONID: "your-session-id", INGRESSCOOKIE: "your-ingress-cookie", CSRF: "your-csrf-token", __VCAP_ID__: "your-vcap-id", }; const receiptOptions: ICumulusReceiptOptions = { transactionId: "12345678", fallbackLanguage: "de", }; // Get parsed receipt object const receipt = await MigrosAPI.account.cumulus.getCumulusReceipt( receiptOptions, cumulusCookies, false // Set to true for raw HTML ); if (typeof receipt !== "string") { console.log("Store:", receipt.store.outlet); console.log("Total:", receipt.total.currency, receipt.total.value); console.log("Payment:", receipt.payment.type); console.log("Cumulus points:", receipt.cumulus.points.received); console.log("\nItems purchased:"); receipt.articles.forEach((article) => { console.log(`- ${article.product}: ${article.count}x ${article.price.single} = ${article.price.total}`); }); } } ``` -------------------------------- ### Search Products using TypeScript Source: https://context7.com/aliyss/migros-api-wrapper/llms.txt Searches the Migros product catalog using a query string and optional filters. It requires a guest token obtained beforehand. The function logs the number of categories found, the first category name, and the number of products returned. It also shows how to access details of the first product. ```typescript import { MigrosAPI } from "migros-api-wrapper"; import { IProductSearchBody } from "migros-api-wrapper/dist/api/onesearch-oc-seaapi/product-search"; async function searchProducts() { // First obtain a guest token const guestInfo = await MigrosAPI.account.oauth2.getGuestToken(); // Define search parameters const productSearchBody: IProductSearchBody = { query: "cooking salt", regionId: "national", // Region.NATIONAL language: "en", // Language.EN }; // Execute the search const response = await MigrosAPI.products.productSearch.searchProduct( productSearchBody, { leshopch: guestInfo.token } ); console.log("Categories found:", response.categories.length); console.log("First category:", response.categories[0].name); console.log("Products:", response.products?.length); // Access product details if (response.products && response.products.length > 0) { const product = response.products[0]; console.log("Product name:", product.name); console.log("Product price:", product.price); } } searchProducts(); ``` -------------------------------- ### Instance-Based MigrosAPI Usage (TypeScript) Source: https://context7.com/aliyss/migros-api-wrapper/llms.txt Demonstrates stateful token and cookie management by instantiating the MigrosAPI class. This allows for automatic token storage after login and seamless use of the stored token in subsequent API calls, including setting login cookies for authenticated features. ```typescript import { MigrosAPI, ILoginCookies } from "migros-api-wrapper"; async function instanceBasedUsage() { // Create an instance for stateful management const api = new MigrosAPI(); // Login and store token automatically await api.account.oauth2.loginGuestToken(); console.log("Token stored:", api.leShopToken); // Subsequent calls use stored token automatically const searchResult = await api.products.productSearch.searchProduct({ query: "milk", }); console.log("Search results:", searchResult); const stores = await api.stores.searchStores({ query: "Basel", }); console.log("Stores:", stores); // For authenticated features, set login cookies const loginCookies: ILoginCookies = { __VCAP_ID__: "value", MDID: "value", JSESSIONID: "value", INGRESSCOOKIE: "value", CSRF: "value", MLRM: "value", MTID: "value", hl: "en", TS012f1684: "value", }; api.loginCookies = loginCookies; // Authenticated calls use stored cookies const securityOptions = await api.account.security.getOptions(); console.log("Security:", securityOptions); } instanceBasedUsage(); ``` -------------------------------- ### Search Migusto Recipes with Migros API Source: https://context7.com/aliyss/migros-api-wrapper/llms.txt Searches the Migusto recipe database for recipes based on a search term and optional filters like course type, dietary preferences, and cooking time. It returns a list of matching recipes with basic details. ```typescript import { MigrosAPI } from "migros-api-wrapper"; async function searchRecipes() { const recipeSearchOptions = { language: "en", searchTerm: "pasta", limit: 24, offset: 0, uuids: [ "6dd0c7d0-80c2-461e-ab3f-f7e5fb8f4c55", // Main dish filter "af70e55b-c8a7-4bba-9ce9-02a5dd6b04e3", // Quick & easy filter ], }; const response = await MigrosAPI.migusto.recipeSearch(recipeSearchOptions); console.log("Recipes found:", response.recipes?.length); if (response.recipes) { response.recipes.forEach((recipe) => { console.log(`- ${recipe.title} (ID: ${recipe.id})`); }); } // Output example: // Recipes found: 24 // - Spaghetti Bolognese (ID: 12345) // - Pasta Carbonara (ID: 12346) } searchRecipes(); ``` -------------------------------- ### Search Current Promotions with Migros API Source: https://context7.com/aliyss/migros-api-wrapper/llms.txt Searches for products currently on promotion using the Migros API. It requires authentication via a guest token and allows filtering and sorting of results. The function returns a list of promotional products. ```typescript import { MigrosAPI } from "migros-api-wrapper"; async function searchPromotions() { const guestInfo = await MigrosAPI.account.oauth2.getGuestToken(); const promotionOptions = { period: "CURRENT", language: "en", region: "national", storeType: "OFFLINE", from: 0, until: 50, // Get first 50 promotional products sortFields: ["CATEGORYLEVEL"], sortOrder: "ASC", }; const response = await MigrosAPI.products.productDisplay.getProductPromotionSearch( promotionOptions, { leshopch: guestInfo.token } ); console.log("Promotions found:", response); // Returns products currently on promotion } searchPromotions(); ``` -------------------------------- ### Accessing API Paths and Enums (TypeScript) Source: https://context7.com/aliyss/migros-api-wrapper/llms.txt Illustrates how to access predefined API paths and utilize exported enums and types for type-safe development within the Migros API Wrapper. This includes accessing specific API endpoint URLs and using enum values for parameters like region, language, store type, and sort order. ```typescript import { MigrosAPI, migrosApiPaths, ILoginCookies, ICumulusCookies, ICumulusReceiptOptions, ICumulusReceiptsOptions } from "migros-api-wrapper"; // Available enums (import from source paths) // Region: NATIONAL, GMOS // Language: EN, DE, FR, IT // StoreType: OFFLINE // SortOrder: ASC, DESC // SortFields: CATEGORYLEVEL, etc. // API paths object for direct endpoint access console.log(migrosApiPaths["onesearch-oc-seapi"].public.v5); // https://www.migros.ch/onesearch-oc-seaapi/public/v5 console.log(migrosApiPaths.migusto.recipes.v1); // https://migusto.migros.ch/.rest/recipes/v1 console.log(migrosApiPaths.login); // https://login.migros.ch ``` -------------------------------- ### List Product Categories with Migros API Source: https://context7.com/aliyss/migros-api-wrapper/llms.txt Retrieves the hierarchical structure of product categories from the Migros API. This is useful for browsing and filtering products. It requires authentication and specifies language and region. ```typescript import { MigrosAPI } from "migros-api-wrapper"; async function listCategories() { const guestInfo = await MigrosAPI.account.oauth2.getGuestToken(); const categoryOptions = { language: "EN", regionId: "national", storeMapScope: "DEFAULT", }; const response = await MigrosAPI.products.productSearch.listCategories( { leshopch: guestInfo.token }, categoryOptions ); console.log("Categories:", response); // Returns hierarchical category structure for browsing } listCategories(); ``` -------------------------------- ### Search Stores with Migros API Source: https://context7.com/aliyss/migros-api-wrapper/llms.txt Searches for Migros store locations based on a query string, which can be a city, address, or store name. The function requires authentication and returns a list of matching stores with their details. ```typescript import { MigrosAPI } from "migros-api-wrapper"; async function searchStores() { const guestInfo = await MigrosAPI.account.oauth2.getGuestToken(); const searchOptions = { query: "Zurich", // Search by city, address, or store name }; const response = await MigrosAPI.stores.searchStores( searchOptions, { leshopch: guestInfo.token } ); console.log("Stores found:", response); // Returns store locations with addresses, opening hours, and services } searchStores(); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.