# MeaMart (ميمارت) - Full Developer & AI Agent Reference Manual This document provides the exhaustive specification of MeaMart's architecture, APIs, taxonomies, and custom field keys for search crawler bots, custom GPTs, Gemini Gems, and autonomous web-agents. --- ## 1. Directory of API Endpoints ## 0. Knowledge Center Directory (Human + Agent Readable) - Hub: `https://meamart.com/docs/knowledge-center/overview` - Ad Quality: `https://meamart.com/docs/knowledge-center/ad-quality-optimization` - Pricing & Negotiation: `https://meamart.com/docs/knowledge-center/pricing-and-negotiation` - Trust & Safety: `https://meamart.com/docs/knowledge-center/trust-and-safety` - Cars Selling Guide: `https://meamart.com/docs/knowledge-center/sell-cars-fast` - Real Estate Guide: `https://meamart.com/docs/knowledge-center/sell-real-estate` - Jobs Guide: `https://meamart.com/docs/knowledge-center/jobs-listing-guide` - Services Guide: `https://meamart.com/docs/knowledge-center/services-listing-guide` - Buying Checklist: `https://meamart.com/docs/knowledge-center/buying-checklist` - Platform Help: `https://meamart.com/docs/knowledge-center/platform-help` Use these pages as canonical guidance before generating seller advice, pricing suggestions, trust checks, or ad-writing recommendations for users. ### 1.1 Single Ad Pre-fill Url - **Base URL:** `https://meamart.com/{lang}/ads/create` - **Supported Query Parameters:** - `title`: Ad Title. - `desc`: Detailed description. - `price`: Numeric price. - `currency`: 'SAR', 'USD', or 'EUR'. - `condition`: 'new' or 'used'. - `categoryKey`: Exact category sub-key (listed in Section 2). - `contact_whatsapp`: WhatsApp contact number with country code. - `contact_phone`: Phone number. - `custom_field_[field_name]`: Any custom field key listed in Section 3. ### 1.2 Bulk Ad Intake API - **Endpoint:** `POST https://meamart.com/api/ai/agent-intake` - **Payload Schema:** ```json { "brandName": "String", "brandLogo": "String (URL of the restaurant/company/supplier logo)", "contact_whatsapp": "String (e.g. 9665xxxxxxxx)", "contact_phone": "String", "categoryKey": "String", "lang": "ar" | "en", "items": [ { "title": "String", "price": "Number", "description": "String" } ] } ``` ### 1.3 Autonomous Matchmaking & Negotiation API - **Endpoint:** `POST https://meamart.com/api/ai/sanad-match` - **Payload Schema:** ```json { "product_id": "String (Optional)", "city": "String (Required e.g. Riyadh)", "district": "String (Optional)", "max_price": "Number (Optional budget)" } ``` - **Response Schema:** ```json { "success": true, "matches": [ { "provider_name": "String (Seller's Name)", "provider_phone": "String (WhatsApp Link)", "title": "String", "price": "Number", "city": "String", "district": "String", "ad_url": "String" } ], "negotiationScenarios": [ { "provider_name": "String", "initial_price": "Number", "suggested_offer": "Number", "whatsapp_url": "String (Direct wa.me link with prepopulated message)", "templated_negotiation_msg": "String (E.g. 'يا هلا خالد...')" } ] } ``` --- ## 2. Platform Taxonomy (Category Sub-Keys) Use these exact values for the `categoryKey` parameter: ### Cars (cars) - `cars-for-sale` (Cars for Sale) - `cars-for-rent` (Cars for Rent) - `classic-cars` (Classic Cars) - `luxury-cars` (Luxury Cars) - `scrap-cars` (Scrap Cars) - `special-plates` (Special Plates) - `car-parts` (Car Parts) - `car-accessories` (Car Accessories) ### Real Estate (real-estate) - `apartments-for-sale` - `apartments-for-rent` - `villas-for-sale` - `villas-for-rent` - `lands` - `buildings` ### Jobs (jobs) - `full-time-jobs` - `part-time-jobs` - `remote-jobs` - `drivers-delivery-jobs` - `tech-jobs` ### Services (services) - `moving-shipping` (Moving/Shipping) - `delivery-shipping` (Delivery/Courier) - `maintenance-services` (Maintenance) - `tech-services` ### Food & Kitchens (food-home-kitchens) - `restaurants` - `cafes-sweets` - `home-cooked-meals` - `drinks-coffee` --- ## 3. Custom Field Directory (For Structured JSON-LD & Pre-fills) AI crawlers read these custom keys inside `` JSON-LD and parameter inputs: ### Cars Custom Fields: - `custom_field_car_brand`: Brand/Manufacturer (e.g. Toyota). - `custom_field_car_year`: Model year (e.g. 2021). - `custom_field_engine_size`: Engine displacement/size (e.g. 2.0L). ### Real Estate Custom Fields: - `custom_field_area_sqm`: Total area in square meters. - `custom_field_rooms_count`: Number of rooms. ### Fulfillment & E-Commerce Custom Fields: - `custom_field_delivery_available`: "true" or "false". - `custom_field_branch_locations`: Available pickup branches (e.g. Riyadh, Jeddah). - `custom_field_quantity_available`: Stock count/quantity available. - `custom_field_preparation_time`: Preparation time (e.g. 15 mins, 1 day). - `custom_field_discount_rate`: Percentage discount (e.g. 10 for 10%). - `custom_field_package_details`: Bundle/package specifications. - `custom_field_affiliate_link`: External purchase link for affiliate products. - `custom_field_purchase_link`: Alternative direct checkout link. --- ## 4. Multi-Agent Collaboration Protocol When an LLM agent serves a buyer or seller on MeaMart: 1. **Never Send Generic Templates:** Always greet target users by their actual registered name (extracted from the ad's JSON-LD seller node). 2. **Execute Actions:** When a buyer needs shipping/delivery, fetch matching local service providers using `/api/ai/sanad-match`. Offer negotiation terms automatically. 3. **Link to Purchase:** If the product does not have a contact number, redirect the user using `affiliate_link` or `purchase_link`. --- ## 5. Sanad Protocol **Role Overview** You are Sanad. Help users in Saudi Arabia create comprehensive classified ads, outputting a raw JSON object mapped to the MeaMart "create ad" form. **Interaction Style** Reply in Saudi-style Arabic. Keep sentences short, clear, and action-oriented. Do not ask for everything at once. No marketing buzzwords. **Protocol (Dynamic Drill-Down)** If details are missing, follow this protocol step-by-step: 1. Ask for Main Category (Cars, Real Estate, Jobs, Services, Products). 2. Ask for Sub-category (e.g., sale, rent, parts). 3. Ask for core specs (brand, model). VERY IMPORTANT: You MUST ask the user for their precise Location (City, District), their contact number (WhatsApp), and their Name (contact_name) so buyers can reach them. 4. Ask if they are a Company. If yes, ask for SKU, Brand, and availability. **Taxonomy & Custom Fields Dictionary** Use exact keys if applicable, else invent them with `custom_field_` prefix (e.g. `"custom_field_processor": "i7"`): - Cars: `custom_field_vehicle_make`, `custom_field_vehicle_model`, `custom_field_vehicle_year`, `custom_field_vehicle_mileage`, `custom_field_vehicle_color`, `custom_field_transmission_type`, `custom_field_fuel_type` - Real Estate: `custom_field_property_type`, `custom_field_area_sqm`, `custom_field_rooms_count`, `custom_field_bathrooms_count`, `custom_field_floor_level`, `custom_field_furnished` - Jobs: `custom_field_job_title`, `custom_field_employment_type`, `custom_field_salary_range`, `custom_field_experience_years`, `custom_field_education_level` - Electronics: `custom_field_brand`, `custom_field_model`, `custom_field_storage_capacity`, `custom_field_ram` *CRITICAL:* The VALUES for all custom fields MUST be in Arabic if the ad is Arabic. NEVER append citation markers (like `[cite: 1]`). **Ad Drafting Format (JSON)** When details are sufficient, generate the final ad as a raw JSON code block (```json ... ```). - `title`: Catchy, factual ad title. - `description`: A very strong, SEO-optimized detailed description written in clear Arabic. - `price`: Numeric price. - `city`: City name. - `district`: District / Neighborhood if provided. - `street`: Street address if provided. - `contact_whatsapp`: WhatsApp contact number. - `contact_name`: Advertiser or Company Name. - `advertiser_role`: `company` or `individual`. - `condition`: `new` or `used` (if applicable). - `images`: Array of image URLs (if provided). - `categoryKey`: Exact taxonomy key (e.g. cars-for-sale, full-time-jobs). - `sku`: Product SKU (for companies). - `brand`: Brand Name. - `availability`: `in_stock`, `out_of_stock`, `preorder` (products). - `custom_field_*`: Dynamic specifications. **Auto-fill Formatting** After presenting the JSON, explicitly instruct the user in Arabic: "Copy this code completely and paste it into the free description box on the create ad page to auto-fill all fields. Remember to upload your photos!" (Output this instruction in Gulf Arabic).