### GET /settings Source: https://docs.zapiet.com/zapiet-eats/reference/api-endpoints Retrieves the account settings and configuration for the widget. This endpoint is useful for fetching general store information and customization options. ```APIDOC ## GET /settings ### Description Retrieves the account settings and configuration for the widget. This endpoint is useful for fetching general store information and customization options. ### Method GET ### Endpoint /settings ### Parameters #### Query Parameters - **locale** (string) - Required - The current locale (e.g., "en"). - **include_restaurants** (boolean) - Optional - Whether to include restaurant data (default: false). ### Response #### Success Response (200) - **is_test_mode** (boolean) - Indicates if the store is in test mode. - **pickup_restaurants_count** (integer) - The number of pickup restaurants available. - **delivery_restaurants_count** (integer) - The number of delivery restaurants available. - **pickup_restaurants** (array) - List of pickup restaurant objects. - **delivery_restaurants** (array) - List of delivery restaurant objects. - **settings** (object) - Contains various store settings and configurations. - **translations** (array) - List of translation objects for different languages. #### Response Example ```json { "is_test_mode": false, "pickup_restaurants_count": 5, "delivery_restaurants_count": 3, "pickup_restaurants": [ { "id": 1, "name": "Downtown Branch", "address_line_1": "123 Main St", "city": "New York", "region": "NY", "is_pickup_enabled": true, "is_delivery_enabled": false } ], "delivery_restaurants": [ { "id": 2, "name": "Uptown Branch", "address_line_1": "456 Broadway", "city": "New York", "region": "NY", "is_pickup_enabled": true, "is_delivery_enabled": true } ], "settings": { "base_country": "United States", "advanced": { "show_restaurant_name": true, "show_restaurant_address": true, "address_format": "{address_line_1}, {city}", "always_show_order_note": false }, "google": { "maps_api_key": "AIzaSy...", "enable_widget_map": true }, "widget": { "google": { "maps_api_key": "AIzaSy...", "enable_widget_map": true }, "advanced": { "show_restaurant_name": true, "show_restaurant_address": true, "address_format": "{address_line_1}, {city}", "always_show_order_note": false }, "restaurant": { "select_delivery_location": true, "adjust_location_with_map": true }, "location_types": { "sort_by_type": true } }, "company_name": "My Store", "language": "en", "currency_code": "USD", "country_code": "US", "time_format": "12h", "developer": { "selectors": { "product_add_to_cart": "form[action='/cart/add']", "product_add_to_cart_text": ".add-to-cart-text" } }, "checkout_locales": { "pickup": "en", "delivery": "en", "shipping": "en" } }, "translations": [ { "id": 1, "translation_key": "front_widget", "values": { "en": "Order Now", "es": "Ordenar Ahora" } } ] } ``` ``` -------------------------------- ### GET /restaurant/{restaurant}/menu/{menu} Source: https://docs.zapiet.com/zapiet-eats/reference/api-endpoints Retrieves the details of a specific menu for a given restaurant. ```APIDOC ## GET /restaurant/{restaurant}/menu/{menu} ### Description Retrieves the details of a specific menu for a restaurant. ### Method GET ### Endpoint /restaurant/{restaurant}/menu/{menu} ### Parameters #### Path Parameters - **restaurant** (integer) - Required - The ID of the restaurant. - **menu** (integer) - Required - The ID of the menu. ### Response #### Success Response (200 OK) - **data** (object) - Contains the menu details. - **id** (integer) - The menu ID. - **name** (string) - The name of the menu. - **menu_sections** (array) - Sections within the menu. - **id** (integer) - The section ID. - **name** (string) - The name of the section. - **sort_order** (integer) - The order of the section. - **menu_section_items** (array) - Items within the section. - **id** (integer) - The item ID. - **sort_order** (integer) - The order of the item. - **product** (object) - Details of the product. - **id** (integer) - The product ID. - **name** (string) - The product name. - **title** (string) - The product title. - **variant_name** (string) - The name of the product variant. - **image_url** (string) - URL of the product image. - **variant_id** (string) - The product variant ID. - **product_id** (string) - The product ID. - **daily_limit** (integer) - Daily limit for the product. - **orderCount** (object) - Order count information. - **variant_id** (string) - The variant ID. - **remaining** (integer) - Remaining count. - **config** (object) - Configuration for the product. - **preparation_time** (integer) - Preparation time in minutes. - **allergens** (array) - List of allergens. - **dietry_restrictions** (array) - List of dietary restrictions. - **variants** (array) - Available variants of the product. - **id** (string) - Variant ID. - **limit** (integer) - Variant limit. - **title** (string) - Variant title. #### Response Example ```json { "data": { "id": 1, "name": "Lunch Menu", "menu_sections": [ { "id": 1, "name": "Starters", "sort_order": 1, "menu_section_items": [ { "id": 101, "sort_order": 1, "product": { "id": 501, "name": "Garlic Bread", "title": "Garlic Bread", "variant_name": "Regular", "image_url": "https://example.com/garlic-bread.jpg", "variant_id": "1234567890", "product_id": "9876543210", "daily_limit": 50, "orderCount": { "variant_id": "1234567890", "remaining": 45 }, "config": { "preparation_time": 15, "allergens": [ { "id": 1, "name": { "en": "Gluten" } } ], "dietry_restrictions": [ { "id": 1, "name": { "en": "Vegetarian" } } ] }, "variants": [ { "id": "1234567890", "limit": 50, "title": "Regular" } ] } } ] } ] } } ``` #### Error Response (404 Not Found) - Indicates that the specified restaurant or menu could not be found. ``` -------------------------------- ### Get Restaurant Menu API (GET /restaurant/{restaurant}/menu/{menu}) Source: https://docs.zapiet.com/zapiet-eats/reference/api-endpoints Retrieves the detailed information for a specific menu of a given restaurant. Requires the restaurant ID and menu ID as path parameters. Returns the menu details including sections, items, product information, and configuration, or a 404 error if the restaurant or menu is not found. ```json { "data": { "id": 1, "name": "Lunch Menu", "menu_sections": [ { "id": 1, "name": "Starters", "sort_order": 1, "menu_section_items": [ { "id": 101, "sort_order": 1, "product": { "id": 501, "name": "Garlic Bread", "title": "Garlic Bread", "variant_name": "Regular", "image_url": "https://example.com/garlic-bread.jpg", "variant_id": "1234567890", "product_id": "9876543210", "daily_limit": 50, "orderCount": { "variant_id": 1234567890, "remaining": 45 }, "config": { "preparation_time": 15, "allergens": [ { "id": 1, "name": { "en": "Gluten" } } ], "dietry_restrictions": [ { "id": 1, "name": { "en": "Vegetarian" } } ] }, "variants": [ { "id": 1234567890, "limit": 50, "title": "Regular" } ] } } ] } ] } } ``` -------------------------------- ### Retrieve Account Settings (GET /settings) Source: https://docs.zapiet.com/zapiet-eats/reference/api-endpoints Fetches the current account settings and widget configuration. Requires a locale and optionally accepts `include_restaurants` to also fetch restaurant data. Returns detailed settings for widget behavior and restaurant information. ```json { "is_test_mode": false, "pickup_restaurants_count": 5, "delivery_restaurants_count": 3, "pickup_restaurants": [ { "id": 1, "name": "Downtown Branch", "address_line_1": "123 Main St", "city": "New York", "region": "NY", "is_pickup_enabled": true, "is_delivery_enabled": false } ], "delivery_restaurants": [ { "id": 2, "name": "Uptown Branch", "address_line_1": "456 Broadway", "city": "New York", "region": "NY", "is_pickup_enabled": true, "is_delivery_enabled": true } ], "settings": { "base_country": "United States", "advanced": { "show_restaurant_name": true, "show_restaurant_address": true, "address_format": "{address_line_1}, {city}", "always_show_order_note": false }, "google": { "maps_api_key": "AIzaSy...", "enable_widget_map": true }, "widget": { "google": { "maps_api_key": "AIzaSy...", "enable_widget_map": true }, "advanced": { "show_restaurant_name": true, "show_restaurant_address": true, "address_format": "{address_line_1}, {city}", "always_show_order_note": false }, "restaurant": { "select_delivery_location": true, "adjust_location_with_map": true }, "location_types": { "sort_by_type": true } }, "company_name": "My Store", "language": "en", "currency_code": "USD", "country_code": "US", "time_format": "12h", "developer": { "selectors": { "product_add_to_cart": "form[action='/cart/add']", "product_add_to_cart_text": ".add-to-cart-text" } }, "checkout_locales": { "pickup": "en", "delivery": "en", "shipping": "en" } }, "translations": [ { "id": 1, "translation_key": "front_widget", "values": { "en": "Order Now", "es": "Ordenar Ahora" } } ] } ``` -------------------------------- ### Get Account Settings Source: https://docs.zapiet.com/zapiet-eats/reference/methods Retrieves the account settings configured for Zapiet Eats. This method allows access to various configuration parameters of the Zapiet Eats account. ```javascript const settings = window.ZapietEats.getSettings(); ``` -------------------------------- ### Get Inventory Date Source: https://docs.zapiet.com/zapiet-eats/reference/methods Returns the date to be used for inventory checks, which is determined by the selected location's timezone. This ensures accurate inventory management based on regional settings. ```javascript const inventoryDate = window.ZapietEats.getLocationInventoryDate(); // Returns: "YYYY-MM-DD" ``` -------------------------------- ### Listen to Zapiet Eats Settings Loading Event Source: https://docs.zapiet.com/zapiet-eats/reference/events This event is triggered just before the Zapiet Eats widget starts loading its settings. Developers can use this to perform actions prior to settings being fetched, such as showing a loading indicator. Ensure the Zapiet Eats script is included. ```javascript window.ZapietEvent.listen('zapieteats:settings:loading', function() { console.log('Settings loading'); }); ``` -------------------------------- ### Get and Set Delivery Option Source: https://docs.zapiet.com/zapiet-eats/reference/methods Retrieves the currently selected delivery option (pickup or delivery) or sets a new delivery option for the Zapiet Eats widget. The `deliveryOption` parameter must be either 'pickup' or 'delivery'. ```javascript const option = window.ZapietEats.getDeliveryOption(); // Returns: "pickup" or "delivery" window.ZapietEats.setDeliveryOption('delivery'); ``` -------------------------------- ### Get Selected Restaurant and Menu Source: https://docs.zapiet.com/zapiet-eats/reference/methods Retrieves the currently selected restaurant object or the currently selected menu object from the Zapiet Eats widget. These methods return the respective objects based on user interaction within the widget. ```javascript const restaurant = window.ZapietEats.getSelectedRestaurant(); const menu = window.ZapietEats.getSelectedMenu(); ``` -------------------------------- ### Get and Set Language Locale Source: https://docs.zapiet.com/zapiet-eats/reference/methods Retrieves the current language locale set for the Zapiet Eats widget or sets a new language locale. Requires the Zapiet Eats library to be loaded in the browser. ```javascript const locale = window.ZapietEats.getLanguage(); // Returns: "en" window.ZapietEats.setLanguage('fr'); ``` -------------------------------- ### Get Cart Line Items with Zapiet ID Source: https://docs.zapiet.com/zapiet-eats/reference/methods Retrieves the line items of the shopping cart, augmented with the `_ZapietId` property. If no cart object is provided, it defaults to fetching the current cart. ```javascript window.ZapietEats.getCartLineItemsWithZapietId().then((items) => { console.log('Items with Zapiet ID', items); }); ``` -------------------------------- ### Get Selected Date and Time Source: https://docs.zapiet.com/zapiet-eats/reference/methods Retrieves the currently selected date as a ZapietDate object or the currently selected time as a ZapietTime object. These methods capture the user's date and time selections within the Zapiet Eats widget. ```javascript const date = window.ZapietEats.getSelectedDate(); const time = window.ZapietEats.getSelectedTime(); ``` -------------------------------- ### Generate Zapiet ID and Get Cart Attributes Source: https://docs.zapiet.com/zapiet-eats/reference/methods Generates a unique Zapiet ID string based on the current selections within the widget. It also returns an object containing cart attributes derived from these selections. ```javascript const zapietId = window.ZapietEats.getZapietId(); // Returns: "A=E&M=D&L=123&Z=456&D=2023-10-25&T=14:00" const attributes = window.ZapietEats.getAttributes(); ``` -------------------------------- ### Retrieve Product Options (POST /product-options) Source: https://docs.zapiet.com/zapiet-eats/reference/api-endpoints Retrieves available product options for a given product, used for checking availability and restrictions. Requires shop and product details in the payload. Returns a list of customizable options and their values. ```json { "shop": "my-shop.myshopify.com", "product": { "id": 1234567890, "variants": [ { "id": 9876543210, "title": "Small", "price": "10.00" } ], "type": "Food", "vendor": "My Vendor", "tags": ["tag1", "tag2", "gluten-free"] } } ``` ```json { "data": { "options": [ { "id": 1, "name": "Size", "is_required": 1, "help_text": "Choose a size", "max_selections": 1, "min_selections": 1, "values": [ { "id": 1, "value": "Small" }, { "id": 2, "value": "Large" } ] }, { "id": 2, "name": "Toppings", "is_required": 0, "help_text": "Add extra toppings", "max_selections": 3, "min_selections": 0, "values": [ { "id": 3, "value": "Cheese" }, { "id": 4, "value": "Pepperoni" }, { "id": 5, "value": "Mushrooms" } ] } ] } } ``` -------------------------------- ### POST /product-options Source: https://docs.zapiet.com/zapiet-eats/reference/api-endpoints Retrieves available product options for a given product, used for checking availability and restrictions. This is crucial for dynamically updating choices for customers. ```APIDOC ## POST /product-options ### Description Retrieves available product options for a given product, used for checking availability and restrictions. This is crucial for dynamically updating choices for customers. ### Method POST ### Endpoint /product-options ### Parameters #### Request Body - **shop** (string) - Required - The shop domain (e.g., "my-shop.myshopify.com"). - **product** (object) - Required - Contains product details. - **id** (integer) - Required - The unique identifier for the product. - **variants** (array) - Optional - List of product variants. - **id** (integer) - Required - The unique identifier for the variant. - **title** (string) - Required - The name of the variant (e.g., "Small"). - **price** (string) - Required - The price of the variant. - **type** (string) - Optional - The type of the product (e.g., "Food"). - **vendor** (string) - Optional - The vendor of the product. - **tags** (array) - Optional - List of tags associated with the product (e.g., ["tag1", "tag2", "gluten-free"]). ### Request Example ```json { "shop": "my-shop.myshopify.com", "product": { "id": 1234567890, "variants": [ { "id": 9876543210, "title": "Small", "price": "10.00" } ], "type": "Food", "vendor": "My Vendor", "tags": ["tag1", "tag2", "gluten-free"] } } ``` ### Response #### Success Response (200) - **data** (object) - Contains the available product options. - **options** (array) - List of option objects. - **id** (integer) - The unique identifier for the option. - **name** (string) - The name of the option (e.g., "Size"). - **is_required** (integer) - Indicates if the option is required (1 for true, 0 for false). - **help_text** (string) - Text to help the user select an option. - **max_selections** (integer) - The maximum number of selections allowed for this option. - **min_selections** (integer) - The minimum number of selections allowed for this option. - **values** (array) - List of available values for the option. - **id** (integer) - The unique identifier for the option value. - **value** (string) - The display value for the option (e.g., "Small"). #### Response Example ```json { "data": { "options": [ { "id": 1, "name": "Size", "is_required": 1, "help_text": "Choose a size", "max_selections": 1, "min_selections": 1, "values": [ { "id": 1, "value": "Small" }, { "id": 2, "value": "Large" } ] }, { "id": 2, "name": "Toppings", "is_required": 0, "help_text": "Add extra toppings", "max_selections": 3, "min_selections": 0, "values": [ { "id": 3, "value": "Cheese" }, { "id": 4, "value": "Pepperoni" }, { "id": 5, "value": "Mushrooms" } ] } ] } } ``` #### Error Response (400) - **message** (string) - "Bad Request: Missing product data." #### Error Response (404) - **message** (string) - "Not Found: Shop or account not found." ``` -------------------------------- ### POST /checkouts Source: https://docs.zapiet.com/zapiet-eats/reference/api-endpoints Creates a draft order or processes the checkout for a selected restaurant and menu. ```APIDOC ## POST /checkouts ### Description Creates a draft order or processes the checkout. ### Method POST ### Endpoint /checkouts ### Parameters #### Request Body - **restaurant_id** (integer) - Required - The ID of the restaurant. - **menu_id** (integer) - Required - The ID of the menu. - **zone_id** (integer) - Optional - Required for delivery if zones are used. - **store_url** (string) - Required - The URL of the store (e.g., my-shop.myshopify.com). - **checkout_method** (string) - Required - The method of checkout ('pickup' or 'delivery'). - **date** (string) - Required - The desired date for the order (YYYY-MM-DD). - **time** (string) - Required - The desired time for the order (HH:MM). - **start_time** (string) - Optional - The start time for delivery slots. - **end_time** (string) - Optional - The end time for delivery slots. - **slot_id** (integer) - Optional - The ID of a specific time slot. - **note** (string) - Optional - Any special notes for the order. - **first_name** (string) - Required - The customer's first name. - **last_name** (string) - Required - The customer's last name. - **email** (string) - Required - The customer's email address. - **phone** (string) - Required - The customer's phone number. - **customer_id** (string) - Optional - The customer ID from the store platform (e.g., Shopify). - **locale** (string) - Optional - The locale for the order (e.g., 'en'). - **line_items** (array) - Required - An array of items to be included in the order. - **id** (integer) - Required - The variant ID of the product. - **quantity** (integer) - Required - The quantity of the item. - **properties** (object) - Optional - Custom properties for the line item. - **customer_address** (object) - Required if checkout_method is 'delivery'. - The customer's address. - **formatted_address** (string) - Required - The full formatted address. - **postcode** (string) - Required - The postcode. - **city** (string) - Required - The city. - **province_code** (string) - Required - The province or state code. - **country_code** (string) - Required - The country code. - **country** (string) - Required - The country name. - **attributes** (array) - Optional - Additional attributes for the checkout. - **key** (string) - Required - The attribute key. - **value** (string) - Required - The attribute value. ### Request Example ```json { "restaurant_id": 123, "menu_id": 456, "zone_id": 789, "store_url": "my-shop.myshopify.com", "checkout_method": "pickup", "date": "2023-10-25", "time": "14:00", "note": "Leave at door", "first_name": "John", "last_name": "Doe", "email": "john@example.com", "phone": "+15551234567", "customer_id": "987654321", "locale": "en", "line_items": [ { "id": 11223344, "quantity": 2, "properties": { "_ZapietId": "M=P&D=2023-10-25&T=14:00", "Custom Option": "Value" } } ], "customer_address": { "formatted_address": "123 Main St, New York, NY 10001, USA", "postcode": "10001", "city": "New York", "province_code": "NY", "country_code": "US", "country": "United States" }, "attributes": [ { "key": "Checkout-Method", "value": "pickup" }, { "key": "Pickup-Date", "value": "2023-10-25" }, { "key": "Pickup-Time", "value": "14:00" } ] } ``` ### Response #### Success Response (200 OK) - **url** (string) - The URL to the checkout page. #### Response Example ```json { "url": "https://my-shop.myshopify.com/6324234/checkouts/0123456789abcdef0123456789abcdef" } ``` #### Error Response (422 Unprocessable Entity) - **errors** (array) - A list of validation errors. - **field** (array) - The field(s) with the error. - **message** (string) - The error message. #### Error Response Example ```json { "errors": [ { "field": ["line_items"], "message": "Some items are out of stock" } ] } ``` ``` -------------------------------- ### Create Checkout API (POST /checkouts) Source: https://docs.zapiet.com/zapiet-eats/reference/api-endpoints Creates a draft order or processes a checkout for a restaurant. This endpoint requires restaurant and menu IDs, checkout method, customer details, and line items with quantities and properties. It can return a success URL upon successful creation or validation errors. ```json { "restaurant_id": 123, "menu_id": 456, "zone_id": 789, "store_url": "my-shop.myshopify.com", "checkout_method": "pickup", "date": "2023-10-25", "time": "14:00", "start_time": "14:00", "end_time": "15:00", "slot_id": 101, "note": "Leave at door", "first_name": "John", "last_name": "Doe", "email": "john@example.com", "phone": "+15551234567", "customer_id": "987654321", "locale": "en", "line_items": [ { "id": 11223344, "quantity": 2, "properties": { "_ZapietId": "M=P&D=2023-10-25&T=14:00", "Custom Option": "Value" } } ], "customer_address": { "formatted_address": "123 Main St, New York, NY 10001, USA", "postcode": "10001", "city": "New York", "province_code": "NY", "country_code": "US", "country": "United States" }, "attributes": [ { "key": "Checkout-Method", "value": "pickup" }, { "key": "Pickup-Date", "value": "2023-10-25" }, { "key": "Pickup-Time", "value": "14:00" } ] } ``` -------------------------------- ### POST /search Source: https://docs.zapiet.com/zapiet-eats/reference/api-endpoints Searches for available restaurants based on location and delivery option. Returns a list of restaurants matching the specified criteria. ```APIDOC ## POST /search ### Description Searches for available restaurants based on location and delivery option. ### Method POST ### Endpoint /search ### Parameters #### Request Body - **deliveryOption** (string) - Required - Specifies the delivery option ('pickup' or 'delivery'). - **query** (string) - Required - The search query, typically a postcode or address. - **latitude** (number) - Optional - The latitude for location-based search. - **longitude** (number) - Optional - The longitude for location-based search. - **page** (integer) - Optional - The page number for paginated results. - **requestTime** (string) - Optional - The timestamp for the request. - **postcode** (string) - Required - The postcode for the search. ### Request Example ```json { "deliveryOption": "pickup", "query": "10001", "latitude": 40.7128, "longitude": -74.0060, "page": 1, "requestTime": "2023-10-25T12:00:00", "postcode": "10001" } ``` ### Response #### Success Response (200 OK) - **data** (array) - List of restaurants matching the search criteria. - **meta** (object) - Pagination metadata. - **account_status** (string) - The status of the account. - **all_restaurants_closed** (boolean) - Indicates if all restaurants are closed. - **count** (boolean) - Indicates if a count is returned. - **distance_unit** (string) - The unit for distance measurements. - **has_more_pages** (boolean) - Indicates if there are more pages of results. #### Response Example ```json { "data": [ { "id": 1, "name": "Downtown Store", "distance": 1.2, "status": "open", "full_address": "123 Main St, New York, NY 10001", "address_line_1": "123 Main St", "city": "New York", "region": "NY", "country_code": "US", "menus": [ { "id": 1, "name": { "en": "Lunch Menu" }, "status": "published" } ], "restaurant_type": { "id": 1, "name": "Italian" }, "config": { "delivery_options": { "store_pickup": { "enabled": true }, "local_delivery": { "enabled": false } } } } ], "meta": { "current_page": 1, "from": 1, "last_page": 5, "per_page": 5, "to": 5, "total": 25 }, "account_status": "active", "all_restaurants_closed": false, "count": true, "distance_unit": "km", "has_more_pages": true } ``` ``` -------------------------------- ### Listen to Zapiet Eats Initialization Event Source: https://docs.zapiet.com/zapiet-eats/reference/events This event is fired when the Zapiet Eats widget has finished its initialization process. It's useful for running custom code once the widget is ready to be interacted with. No specific dependencies are required beyond the Zapiet Eats widget script. ```javascript window.ZapietEvent.listen('zapieteats:init', function() { console.log('Widget initialized'); }); ``` -------------------------------- ### Search Restaurants API (POST /search) Source: https://docs.zapiet.com/zapiet-eats/reference/api-endpoints Searches for available restaurants based on location and delivery options. Requires a payload with delivery option, query (e.g., postcode), latitude, longitude, page number, and request time. Returns a list of restaurants matching the criteria or an empty list if none are found. ```json { "deliveryOption": "pickup", "query": "10001", "latitude": 40.7128, "longitude": -74.0060, "page": 1, "requestTime": "2023-10-25T12:00:00", "postcode": "10001" } ``` -------------------------------- ### Listen to Zapiet Eats Restaurants Loading Event Source: https://docs.zapiet.com/zapiet-eats/reference/events This event occurs as the Zapiet Eats widget begins to fetch the list of available restaurants. It can be used to indicate to the user that data is being retrieved. The Zapiet Eats script must be present. ```javascript window.ZapietEvent.listen('zapieteats:restaurants:loading', function() { console.log('Restaurants loading'); }); ``` -------------------------------- ### Widget Initialization Event Source: https://docs.zapiet.com/zapiet-eats/reference/events This event is fired when the Zapiet Eats widget has finished its initialization process. ```APIDOC ## zapieteats:init ### Description Fired when the widget initializes. ### Method Event Listener ### Parameters None ### Request Example ```javascript window.ZapietEvent.listen('zapieteats:init', function() { console.log('Widget initialized'); }); ``` ### Response #### Success Response None ``` -------------------------------- ### Listen to Zapiet Eats Settings Loaded Event Source: https://docs.zapiet.com/zapiet-eats/reference/events Fired after the Zapiet Eats widget has successfully loaded its settings. The loaded settings object is passed as an argument, allowing for dynamic adjustments or logging. The widget script is required. ```javascript window.ZapietEvent.listen('zapieteats:settings:loaded', function(settings) { console.log('Settings loaded', settings); }); ``` -------------------------------- ### Listen to Zapiet Eats Ready Event Source: https://docs.zapiet.com/zapiet-eats/reference/events The 'zapieteats:ready' event signifies that the Zapiet Eats widget is fully prepared and available for use. This is a good point to perform actions that rely on the widget's complete readiness. The widget script is a prerequisite. ```javascript window.ZapietEvent.listen('zapieteats:ready', function() { console.log('Widget ready'); }); ``` -------------------------------- ### Widget Ready Event Source: https://docs.zapiet.com/zapiet-eats/reference/events This event is fired when the Zapiet Eats widget is fully ready to be interacted with. ```APIDOC ## zapieteats:ready ### Description Fired when the widget is ready. ### Method Event Listener ### Parameters None ### Request Example ```javascript window.ZapietEvent.listen('zapieteats:ready', function() { console.log('Widget ready'); }); ``` ### Response #### Success Response None ``` -------------------------------- ### Settings Loading Event Source: https://docs.zapiet.com/zapiet-eats/reference/events This event indicates that the Zapiet Eats widget is in the process of loading its settings. ```APIDOC ## zapieteats:settings:loading ### Description Fired when settings are loading. ### Method Event Listener ### Parameters None ### Request Example ```javascript window.ZapietEvent.listen('zapieteats:settings:loading', function() { console.log('Settings loading'); }); ``` ### Response #### Success Response None ``` -------------------------------- ### Listen to Zapiet Eats Restaurants Loaded Event Source: https://docs.zapiet.com/zapiet-eats/reference/events Triggered once the Zapiet Eats widget has finished loading the restaurant data. The list of restaurants is provided as an argument, enabling further processing or display logic. The widget script is a prerequisite. ```javascript window.ZapietEvent.listen('zapieteats:restaurants:loaded', function(restaurants) { console.log('Restaurants loaded', restaurants); }); ``` -------------------------------- ### Open and Close Widget Modal Source: https://docs.zapiet.com/zapiet-eats/reference/methods Controls the display of the Zapiet Eats widget modal. `openModal()` presents the modal to the user, while `closeModal()` hides it. ```javascript window.ZapietEats.openModal(); window.ZapietEats.closeModal(); ``` -------------------------------- ### Show and Close Widget Message Source: https://docs.zapiet.com/zapiet-eats/reference/methods Displays a message within the Zapiet Eats widget or closes any currently visible message. The `showMessage` method accepts an object or string, with options for message type and actions. ```javascript window.ZapietEats.showMessage({ message: 'Please select a location', type: 'error' }); window.ZapietEats.closeMessage(); ``` -------------------------------- ### Settings Loaded Event Source: https://docs.zapiet.com/zapiet-eats/reference/events This event is fired once the Zapiet Eats widget has successfully loaded its settings. It may include the loaded settings object. ```APIDOC ## zapieteats:settings:loaded ### Description Fired when settings are loaded. ### Method Event Listener ### Parameters * **settings** (object) - The loaded settings object. ### Request Example ```javascript window.ZapietEvent.listen('zapieteats:settings:loaded', function(settings) { console.log('Settings loaded', settings); }); ``` ### Response #### Success Response * **settings** (object) - The loaded settings object. ``` -------------------------------- ### Show and Hide Top Bar Source: https://docs.zapiet.com/zapiet-eats/reference/methods Controls the visibility of the Zapiet Eats widget's top bar. `showTopBar()` makes the top bar visible, while `hideTopBar()` conceals it. ```javascript window.ZapietEats.showTopBar(); window.ZapietEats.hideTopBar(); ``` -------------------------------- ### Restaurants Loading Event Source: https://docs.zapiet.com/zapiet-eats/reference/events This event signals that the Zapiet Eats widget is currently loading the list of available restaurants. ```APIDOC ## zapieteats:restaurants:loading ### Description Fired when restaurants are loading. ### Method Event Listener ### Parameters None ### Request Example ```javascript window.ZapietEvent.listen('zapieteats:restaurants:loading', function() { console.log('Restaurants loading'); }); ``` ### Response #### Success Response None ``` -------------------------------- ### Listen to Zapiet Eats Restaurant Changed Event Source: https://docs.zapiet.com/zapiet-eats/reference/events This event is emitted when the user selects a different restaurant within the Zapiet Eats widget. The details of the newly selected restaurant are provided as an argument. Ensure the Zapiet Eats widget script is included. ```javascript window.ZapietEvent.listen('zapieteats:restaurant:changed', function(restaurant) { console.log('Restaurant changed', restaurant); }); ``` -------------------------------- ### Listen to Zapiet Eats Menu Changed Event Source: https://docs.zapiet.com/zapiet-eats/reference/events Fired when the selected menu within the Zapiet Eats widget is changed. The details of the new menu are passed as an argument, allowing for updates based on the selected menu. The widget script is a prerequisite. ```javascript window.ZapietEvent.listen('zapieteats:menu:changed', function(menu) { console.log('Menu changed', menu); }); ``` -------------------------------- ### Listen to Zapiet Eats Modal Opened Event Source: https://docs.zapiet.com/zapiet-eats/reference/events Fired when a modal dialog is opened by the Zapiet Eats widget. This can be used to execute code when a modal appears, such as pausing background activity or tracking modal view events. The widget script is required. ```javascript window.ZapietEvent.listen('zapieteats:modal:opened', function() { console.log('Modal opened'); }); ``` -------------------------------- ### Restaurants Loaded Event Source: https://docs.zapiet.com/zapiet-eats/reference/events This event is triggered after the Zapiet Eats widget has successfully loaded the list of restaurants. It may include the list of restaurants. ```APIDOC ## zapieteats:restaurants:loaded ### Description Fired when restaurants are loaded. ### Method Event Listener ### Parameters * **restaurants** (array) - An array of restaurant objects. ### Request Example ```javascript window.ZapietEvent.listen('zapieteats:restaurants:loaded', function(restaurants) { console.log('Restaurants loaded', restaurants); }); ``` ### Response #### Success Response * **restaurants** (array) - An array of restaurant objects. ``` -------------------------------- ### Menu Changed Event Source: https://docs.zapiet.com/zapiet-eats/reference/events This event fires when the user selects a different menu for the currently chosen restaurant. ```APIDOC ## zapieteats:menu:changed ### Description Fired when the selected menu changes. ### Method Event Listener ### Parameters * **menu** (object) - The newly selected menu object. ### Request Example ```javascript window.ZapietEvent.listen('zapieteats:menu:changed', function(menu) { console.log('Menu changed', menu); }); ``` ### Response #### Success Response * **menu** (object) - The newly selected menu object. ``` -------------------------------- ### Listen to Zapiet Eats Language Changed Event Source: https://docs.zapiet.com/zapiet-eats/reference/events Fired whenever the user or system changes the language within the Zapiet Eats widget. The new language code is passed as an argument, useful for internationalization logic. The Zapiet Eats script is required. ```javascript window.ZapietEvent.listen('zapieteats:language:changed', function(language) { console.log('Language changed to', language); }); ``` -------------------------------- ### Listen to Zapiet Eats Delivery Option Changed Event Source: https://docs.zapiet.com/zapiet-eats/reference/events This event is triggered when the delivery option (e.g., delivery, pickup) is altered within the Zapiet Eats widget. It can be used to update UI elements or logic related to delivery choices. The Zapiet Eats script must be present. ```javascript window.ZapietEvent.listen('zapieteats:deliveryoption:changed', function() { console.log('Delivery option changed'); }); ``` -------------------------------- ### Language Changed Event Source: https://docs.zapiet.com/zapiet-eats/reference/events This event fires whenever the display language of the Zapiet Eats widget is changed. ```APIDOC ## zapieteats:language:changed ### Description Fired when the language changes. ### Method Event Listener ### Parameters * **language** (string) - The new language code (e.g., 'en', 'fr'). ### Request Example ```javascript window.ZapietEvent.listen('zapieteats:language:changed', function(language) { console.log('Language changed to', language); }); ``` ### Response #### Success Response * **language** (string) - The new language code. ``` -------------------------------- ### Modal Opened Event Source: https://docs.zapiet.com/zapiet-eats/reference/events This event fires when a modal dialog is opened within the Zapiet Eats widget. ```APIDOC ## zapieteats:modal:opened ### Description Fired when the modal is opened. ### Method Event Listener ### Parameters None ### Request Example ```javascript window.ZapietEvent.listen('zapieteats:modal:opened', function() { console.log('Modal opened'); }); ``` ### Response #### Success Response None ``` -------------------------------- ### Listen to Zapiet Eats Modal Closed Event Source: https://docs.zapiet.com/zapiet-eats/reference/events This event is triggered when a modal dialog within the Zapiet Eats widget is closed. It's useful for resuming background processes, cleaning up modal-specific resources, or tracking modal dismissal. Ensure the Zapiet Eats script is included. ```javascript window.ZapietEvent.listen('zapieteats:modal:closed', function() { console.log('Modal closed'); }); ``` -------------------------------- ### Add Zapiet ID to Cart Source: https://docs.zapiet.com/zapiet-eats/reference/methods Appends the generated Zapiet ID and associated attributes to the current shopping cart. This method returns a promise that resolves with the updated cart object. ```javascript window.ZapietEats.addZapietId().then((cart) => { console.log('Zapiet ID added to cart', cart); }); ``` -------------------------------- ### Restaurant Changed Event Source: https://docs.zapiet.com/zapiet-eats/reference/events This event is triggered when the user selects a different restaurant within the Zapiet Eats widget. ```APIDOC ## zapieteats:restaurant:changed ### Description Fired when the selected restaurant changes. ### Method Event Listener ### Parameters * **restaurant** (object) - The newly selected restaurant object. ### Request Example ```javascript window.ZapietEvent.listen('zapieteats:restaurant:changed', function(restaurant) { console.log('Restaurant changed', restaurant); }); ``` ### Response #### Success Response * **restaurant** (object) - The newly selected restaurant object. ``` -------------------------------- ### Delivery Option Changed Event Source: https://docs.zapiet.com/zapiet-eats/reference/events This event is triggered when the user modifies their delivery option within the Zapiet Eats widget. ```APIDOC ## zapieteats:deliveryoption:changed ### Description Fired when the delivery option changes. ### Method Event Listener ### Parameters None ### Request Example ```javascript window.ZapietEvent.listen('zapieteats:deliveryoption:changed', function() { console.log('Delivery option changed'); }); ``` ### Response #### Success Response None ``` -------------------------------- ### Modal Closed Event Source: https://docs.zapiet.com/zapiet-eats/reference/events This event is triggered when a modal dialog is closed within the Zapiet Eats widget. ```APIDOC ## zapieteats:modal:closed ### Description Fired when the modal is closed. ### Method Event Listener ### Parameters None ### Request Example ```javascript window.ZapietEvent.listen('zapieteats:modal:closed', function() { console.log('Modal closed'); }); ``` ### Response #### Success Response None ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.