{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "version": "2.0",
  "site": "https://cartly-frontend.onrender.com",
  "apiBaseUrl": "https://cartly-backend-zbbh.onrender.com/api",
  "name": "Cartly Egypt WebMCP Commerce & AI Atelier",
  "description": "Machine-readable action contracts and tools for autonomous AI agents to search products, negotiate prices, manage carts, customize discovery boxes, and track luxury orders across Egypt.",
  "locale": {
    "default": "ar-EG",
    "supported": ["ar-EG", "en-EG"],
    "currency": "EGP",
    "timezone": "Africa/Cairo"
  },
  "actions": [
    {
      "id": "search-catalog",
      "name": "Search Catalog",
      "description": "Search 100 authentic luxury perfumes in Egypt with filters for price in EGP, scent family category, olfactory note, and stock availability.",
      "method": "GET",
      "endpoint": "/api/products",
      "parameters": {
        "type": "object",
        "properties": {
          "search": {
            "type": "string",
            "description": "Keyword search term in Arabic or English (e.g., 'Dior Sauvage', 'Ombre Nomade', 'Baccarat Rouge', 'عود', 'فانيليا')"
          },
          "categoryId": {
            "type": "integer",
            "description": "Scent family category ID filter (Oud & Oriental, Woody & Leather, French & Floral, Fresh & Citrus, Vanilla & Gourmand, Niche & Private)"
          },
          "minPrice": {
            "type": "number",
            "description": "Minimum price in EGP"
          },
          "maxPrice": {
            "type": "number",
            "description": "Maximum price in EGP"
          },
          "inStockOnly": {
            "type": "boolean",
            "description": "Filter strictly for in-stock products"
          },
          "page": {
            "type": "integer",
            "default": 0
          },
          "size": {
            "type": "integer",
            "default": 12
          }
        }
      }
    },
    {
      "id": "ai-smart-search",
      "name": "AI Smart Natural Language Search",
      "description": "Perform an AI-powered conversational search query parsed into price constraints, olfactory categories, and aesthetic preferences.",
      "method": "GET",
      "endpoint": "/api/products/ai-search",
      "parameters": {
        "type": "object",
        "required": ["prompt"],
        "properties": {
          "prompt": {
            "type": "string",
            "description": "Natural language request (e.g., 'I want a warm smoky oud for winter under 2500 pounds', 'عايز هدية فخمة لأمي عطر وردي هادي')"
          }
        }
      }
    },
    {
      "id": "get-product-details",
      "name": "Get Product Details",
      "description": "Retrieve complete specifications, notes, sillage metrics, wholesale tiers, and pricing for a specific product ID.",
      "method": "GET",
      "endpoint": "/api/products/{id}",
      "parameters": {
        "type": "object",
        "required": ["id"],
        "properties": {
          "id": {
            "type": "integer",
            "description": "Unique identifier of the product"
          }
        }
      }
    },
    {
      "id": "ai-bargain-negotiate",
      "name": "AI Price Bargain Negotiator",
      "description": "Submit a custom discounted price offer to the AI pricing agent. If acceptable or counter-offered, generates a dynamic one-time checkout coupon.",
      "method": "POST",
      "endpoint": "/api/ai/bargain/offer",
      "parameters": {
        "type": "object",
        "required": ["productId", "offeredPrice"],
        "properties": {
          "productId": {
            "type": "integer",
            "description": "Product ID the buyer is negotiating for"
          },
          "offeredPrice": {
            "type": "number",
            "description": "Buyer's proposed price in EGP"
          },
          "round": {
            "type": "integer",
            "default": 1,
            "description": "Current negotiation round (1 to 3)"
          },
          "buyerMessage": {
            "type": "string",
            "description": "Optional persuasive message or speech transcript from buyer in Arabic or English"
          }
        }
      }
    },
    {
      "id": "ai-stylist-chat",
      "name": "Maison Stylist AI Assistant",
      "description": "Chat with the Cartly fragrance concierge to get scent layering advice, climate matching, discovery set recommendations, and gift ideas.",
      "method": "POST",
      "endpoint": "/api/ai/assistant/chat",
      "parameters": {
        "type": "object",
        "required": ["message"],
        "properties": {
          "message": {
            "type": "string",
            "description": "User question or inquiry to the shopping assistant"
          },
          "conversationId": {
            "type": "string",
            "description": "Optional session tracking identifier for multi-turn dialogue"
          }
        }
      }
    },
    {
      "id": "ai-review-summary",
      "name": "AI Review Intelligence Summary",
      "description": "Fetch real-time synthesized review sentiment, verified buyer highlights, pros and cons for a product.",
      "method": "GET",
      "endpoint": "/api/ai/reviews/{productId}/summary",
      "parameters": {
        "type": "object",
        "required": ["productId"],
        "properties": {
          "productId": {
            "type": "integer",
            "description": "Product ID to summarize reviews for"
          }
        }
      }
    },
    {
      "id": "get-cart",
      "name": "Get Shopping Cart",
      "description": "Retrieve current items, quantities, subtotal, and complimentary shipping progress for a guest session or authenticated user.",
      "method": "GET",
      "endpoint": "/api/cart/session/{sessionId}",
      "parameters": {
        "type": "object",
        "required": ["sessionId"],
        "properties": {
          "sessionId": {
            "type": "string",
            "description": "Guest session UUID or browser session key"
          }
        }
      }
    },
    {
      "id": "add-to-cart",
      "name": "Add Item to Cart",
      "description": "Add a fragrance with specified quantity and optional variant to the guest or user cart.",
      "method": "POST",
      "endpoint": "/api/cart/session/{sessionId}/add",
      "parameters": {
        "type": "object",
        "required": ["sessionId", "productId", "quantity"],
        "properties": {
          "sessionId": {
            "type": "string",
            "description": "Session UUID"
          },
          "productId": {
            "type": "integer",
            "description": "Product ID to add"
          },
          "quantity": {
            "type": "integer",
            "default": 1,
            "minimum": 1
          },
          "variantId": {
            "type": "integer",
            "description": "Optional SKU variant ID (size/color)"
          }
        }
      }
    },
    {
      "id": "validate-coupon",
      "name": "Validate Promotional Coupon",
      "description": "Validate coupon codes (e.g. WELCOME15, OUD15, PERFUME20, VIP200, DISCOVERY350) and calculate discount amount.",
      "method": "GET",
      "endpoint": "/api/coupons/validate/{code}",
      "parameters": {
        "type": "object",
        "required": ["code"],
        "properties": {
          "code": {
            "type": "string",
            "description": "Promo or bargain coupon code"
          }
        }
      }
    },
    {
      "id": "subscribe-price-alert",
      "name": "Subscribe to Price Drop / Stock Alert",
      "description": "Register email or WhatsApp notification when a luxury product drops in price or is back in stock.",
      "method": "POST",
      "endpoint": "/api/product-alerts",
      "parameters": {
        "type": "object",
        "required": ["productId", "email", "alertType"],
        "properties": {
          "productId": {
            "type": "integer",
            "description": "Product ID to monitor"
          },
          "email": {
            "type": "string",
            "format": "email",
            "description": "Buyer's email for instant notification"
          },
          "alertType": {
            "type": "string",
            "enum": ["PRICE_DROP", "BACK_IN_STOCK"],
            "description": "Type of event to notify on"
          },
          "targetPrice": {
            "type": "number",
            "description": "Target threshold price in EGP for PRICE_DROP"
          }
        }
      }
    },
    {
      "id": "get-shipping-zones",
      "name": "Get Egyptian Shipping Zones & SLAs",
      "description": "Query Cairo and regional governorate delivery rates, dispatch hubs (El Nozha), and transit SLAs.",
      "method": "GET",
      "endpoint": "/api/shipping-zones",
      "parameters": {
        "type": "object",
        "properties": {
          "governorate": {
            "type": "string",
            "description": "Optional Egyptian governorate filter (e.g., 'Cairo', 'Giza', 'Alexandria')"
          }
        }
      }
    },
    {
      "id": "track-order",
      "name": "Track Order & Invoice Status",
      "description": "Check real-time fulfillment status, courier assignment, and payment confirmation for an order.",
      "method": "GET",
      "endpoint": "/api/orders/{id}",
      "parameters": {
        "type": "object",
        "required": ["id"],
        "properties": {
          "id": {
            "type": "integer",
            "description": "Order reference ID"
          }
        }
      }
    }
  ]
}
