# ZiffyDeals Technical Protocol & Schema This document defines the data structures and interaction protocols for ZiffyDeals.com to be consumed by AI agents. ## 1. Deal Data Schema Deals are represented with the following fields: - `id` (UUID): Unique identifier. - `title` (String): Product name and offer summary. - `description` (String): Full details of the deal. - `store` (String): Retailer name (e.g., "Amazon", "Flipkart"). - `offerPrice` (Number): Current discounted price in INR. - `originalPrice` (Number): MRP or pre-discount price. - `percentageOff` (Number): Calculated discount percentage. - `category` (String): Product category. - `dealUrl` (URL): Direct link to the retailer (includes Ziffy affiliate tracking). - `verified` (Boolean): If the deal has been manually validated. - `slug` (String): URL-friendly version of the title. ## 2. Search & Discovery Protocols ### URL Parameters Agents should construct search URLs using: - `?q=[term]`: Keyword search for products, brands, or IDs. - `?category=[category_name]`: Filter by category. - `?retailer=[retailer_name]`: Filter by specific store. ### Jump Protocol ZiffyDeals supports a "Jump" feature to instantly find a deal based on an external URL: - Endpoint: `/jump/[external_url]` - Behavior: The system extracts product IDs (ASIN/PID) and redirects to the internal deal page if matched. ## 3. ZifCoin (ZIF) Protocol ZifCoin is the native reward layer. - **Earning**: 1 ZIF per day via profile claim. - **Requirements**: User must have viewed 3 unique deals in the current 24h window. - **Utility**: Trading on ZifExchange, future withdrawals to BNB Chain (BEP-20). ## 4. Price Comparison Protocol The system uses the `serp-price-comparison` edge function. - **Input**: Product Title. - **Output**: JSON array of `shopping_results` containing prices from various Indian retailers. ## 5. Community Sentiment - **Voting**: Deals have `upvotes` and `downvotes`. - **Ranking**: Trending deals are sorted by `upvotes` count.