{"openapi":"3.1.0","info":{"title":"A2R Marketplace API","description":"Agent-to-Retail commerce platform API.","version":"0.1.0"},"paths":{"/api/elevenlabs/tts":{"post":{"tags":["elevenlabs"],"summary":"Text To Speech","description":"Convert text to speech using ElevenLabs TTS API.\nReturns audio/mpeg stream.","operationId":"text_to_speech_api_elevenlabs_tts_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TTSRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/chat":{"post":{"summary":"Chat","description":"Process a user message and return agent responses.","operationId":"chat_api_chat_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserInput"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/products":{"get":{"summary":"Get Products","description":"Browse and search the product catalog.","operationId":"get_products_api_products_get","parameters":[{"name":"query","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search query","title":"Query"},"description":"Search query"},{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by category","title":"Category"},"description":"Filter by category"},{"name":"vendor_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by vendor ID","title":"Vendor Id"},"description":"Filter by vendor ID"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","description":"Max results","default":100,"title":"Limit"},"description":"Max results"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Create Product","description":"Create a single product.","operationId":"create_product_api_products_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/products/{product_id}":{"get":{"summary":"Get Product","description":"Get a single product by ID","operationId":"get_product_api_products__product_id__get","parameters":[{"name":"product_id","in":"path","required":true,"schema":{"type":"string","title":"Product Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"summary":"Update Product","description":"Update an existing product.","operationId":"update_product_api_products__product_id__put","parameters":[{"name":"product_id","in":"path","required":true,"schema":{"type":"string","title":"Product Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Product Data"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Product","description":"Delete a product by ID.","operationId":"delete_product_api_products__product_id__delete","parameters":[{"name":"product_id","in":"path","required":true,"schema":{"type":"string","title":"Product Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/categories":{"get":{"summary":"Get Categories","description":"Get all product categories for filtering.","operationId":"get_categories_api_categories_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/checkout":{"get":{"summary":"Get Checkout","description":"Get current checkout session status","operationId":"get_checkout_api_checkout_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/reset":{"post":{"summary":"Reset","description":"Reset conversation and checkout state","operationId":"reset_api_reset_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/search/tokens":{"post":{"summary":"Search By Tokens","description":"Search products using embedding vectors.","operationId":"search_by_tokens_api_search_tokens_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenSearchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenSearchResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cart/add":{"post":{"summary":"Add To Cart","description":"Add Product to Cart for External Agent\n\nFlow:\n1. External agent selects product from search results\n2. Sends product_id + quantity to this endpoint\n3. Server adds to checkout session\n4. Returns updated cart summary","operationId":"add_to_cart_api_cart_add_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddToCartRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CartResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/api/cart/{session_id}":{"get":{"summary":"Get Cart","description":"Get Cart Status\n\nExternal agent can check cart contents before checkout.","operationId":"get_cart_api_cart__session_id__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CartResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/checkout/complete":{"post":{"summary":"Complete Checkout","description":"Complete Purchase for External Agent\n\nFlow:\n1. External agent has products in cart (session_id)\n2. Sends buyer info + payment method\n3. Server processes payment\n4. Returns order confirmation\n\nPayment Methods (MVP):\n- mock_pay: Demo payment (always succeeds)\n- card_visa: Mock Visa card\n- card_mastercard: Mock Mastercard","operationId":"complete_checkout_api_checkout_complete_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/api/agent/run":{"post":{"summary":"Run Agent Flow","description":"Run the agent shopping flow, streaming each step via SSE.","operationId":"run_agent_flow_api_agent_run_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentRunRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/login":{"post":{"summary":"Vendor Login","operationId":"vendor_login_api_auth_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/vendors":{"get":{"summary":"List Vendor Accounts","description":"Top vendor accounts from real Amazon data — all use password demo123.","operationId":"list_vendor_accounts_api_auth_vendors_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/auth/agent-login":{"post":{"summary":"Agent Login","description":"Lightweight agent login — no password, just pick a name (demo).","operationId":"agent_login_api_auth_agent_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentLoginRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/products/bulk":{"post":{"summary":"Bulk Create Products","description":"Bulk create products from CSV upload.","operationId":"bulk_create_products_api_products_bulk_post","requestBody":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ProductCreate"},"type":"array","title":"Products Data"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkUploadResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/analytics/summary":{"get":{"summary":"Get Analytics Summary","description":"Main analytics dashboard endpoint — returns all metrics in one call.","operationId":"get_analytics_summary_api_analytics_summary_get","parameters":[{"name":"vendor_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by vendor ID","title":"Vendor Id"},"description":"Filter by vendor ID"},{"name":"source","in":"query","required":false,"schema":{"type":"string","description":"Data source: 'real' (Harvard) or 'simulated'","default":"real","title":"Source"},"description":"Data source: 'real' (Harvard) or 'simulated'"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/orders":{"get":{"summary":"Get Orders","description":"Vendor order history.\nsource=real  → Harvard Open e-Commerce 1.0 (real Amazon purchases, dates shifted to recent)\nsource=simulated → our seeded conversion_events","operationId":"get_orders_api_orders_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","description":"Max orders to return","default":50,"title":"Limit"},"description":"Max orders to return"},{"name":"days","in":"query","required":false,"schema":{"type":"integer","description":"Window in days","default":30,"title":"Days"},"description":"Window in days"},{"name":"vendor_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by vendor ID","title":"Vendor Id"},"description":"Filter by vendor ID"},{"name":"source","in":"query","required":false,"schema":{"type":"string","description":"Data source: 'real' (Harvard) or 'simulated'","default":"real","title":"Source"},"description":"Data source: 'real' (Harvard) or 'simulated'"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/intelligence":{"get":{"summary":"Get Vendor Intelligence","description":"Vendor Intelligence insights (TR-VN-1 through TR-VN-6).\nComputed from aggregated, anonymized interaction data.","operationId":"get_vendor_intelligence_api_intelligence_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/agent-insights":{"get":{"summary":"Get Agent Insights","description":"Agent Insights — powerhouse analytics for how AI agents discover, evaluate, and buy\nthe vendor's products. Includes funnel, top products, purchase queries, rank distribution,\nagent breakdown, repeat rate, product health, and auto-generated recommendations.","operationId":"get_agent_insights_api_agent_insights_get","parameters":[{"name":"vendor_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by vendor ID","title":"Vendor Id"},"description":"Filter by vendor ID"},{"name":"source","in":"query","required":false,"schema":{"type":"string","description":"Data source: 'real' (Harvard) or 'simulated'","default":"real","title":"Source"},"description":"Data source: 'real' (Harvard) or 'simulated'"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/vendors":{"get":{"summary":"Get Vendors","description":"Pre-computed vendor data from SQLite — no on-the-fly aggregation.","operationId":"get_vendors_api_vendors_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","description":"Max vendors to return","default":100,"title":"Limit"},"description":"Max vendors to return"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/analytics/search-demand":{"get":{"summary":"Get Search Demand","description":"Top search tags by frequency.","operationId":"get_search_demand_api_analytics_search_demand_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/analytics/performance":{"get":{"summary":"Get Analytics Performance","description":"Query performance metrics.","operationId":"get_analytics_performance_api_analytics_performance_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/analytics/stream":{"get":{"summary":"Analytics Stream","description":"SSE stream for live analytics events.\n\nPushes events as they happen: searches, purchases, cart_adds, agent steps.\nConnect once and receive real-time updates without polling.","operationId":"analytics_stream_api_analytics_stream_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/agents/status":{"get":{"summary":"Get Agents Status","description":"Currently active agent flows and their step progress.","operationId":"get_agents_status_api_agents_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/dbsync/supported-types":{"get":{"summary":"Dbsync Supported Types","description":"Return list of supported database types.","operationId":"dbsync_supported_types_api_dbsync_supported_types_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/dbsync/schema":{"get":{"summary":"Dbsync Viree Schema","description":"Return the expected product field schema for column mapping.","operationId":"dbsync_viree_schema_api_dbsync_schema_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/dbsync/sources":{"get":{"summary":"Dbsync Sources","description":"List available source databases for the sync dropdown.","operationId":"dbsync_sources_api_dbsync_sources_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"summary":"Dbsync Add Source","description":"Add a new source database configuration.","operationId":"dbsync_add_source_api_dbsync_sources_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SourceConfigRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/dbsync/sources/{source_id}":{"get":{"summary":"Dbsync Source Detail","description":"Get full config for a source (password masked).","operationId":"dbsync_source_detail_api_dbsync_sources__source_id__get","parameters":[{"name":"source_id","in":"path","required":true,"schema":{"type":"string","title":"Source Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"summary":"Dbsync Update Source","description":"Update an existing source database configuration.","operationId":"dbsync_update_source_api_dbsync_sources__source_id__put","parameters":[{"name":"source_id","in":"path","required":true,"schema":{"type":"string","title":"Source Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SourceConfigRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Dbsync Delete Source","description":"Delete a user-added source database configuration.","operationId":"dbsync_delete_source_api_dbsync_sources__source_id__delete","parameters":[{"name":"source_id","in":"path","required":true,"schema":{"type":"string","title":"Source Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/dbsync/test-connection":{"post":{"summary":"Dbsync Test Connection","description":"Test connection to a source database without saving it.","operationId":"dbsync_test_connection_api_dbsync_test_connection_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SourceConfigRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/dbsync":{"post":{"summary":"Dbsync Trigger","description":"Trigger a database sync job.","operationId":"dbsync_trigger_api_dbsync_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DBSyncRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/dbsync/jobs":{"get":{"summary":"Dbsync Jobs","description":"List recent sync jobs.","operationId":"dbsync_jobs_api_dbsync_jobs_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","description":"Max jobs to return","default":20,"title":"Limit"},"description":"Max jobs to return"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/dbsync/jobs/{job_id}":{"get":{"summary":"Dbsync Job Status","description":"Get status of a specific sync job.","operationId":"dbsync_job_status_api_dbsync_jobs__job_id__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/robots.txt":{"get":{"summary":"Serve Robots Txt","description":"Serve robots.txt for AI agent crawlers.","operationId":"serve_robots_txt_robots_txt_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/.well-known/agent.json":{"get":{"summary":"Serve Agent Card","description":"Serve agent card — machine-readable manifest of platform capabilities.","operationId":"serve_agent_card__well_known_agent_json_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/.well-known/ai-plugin.json":{"get":{"summary":"Serve Ai Plugin","description":"Serve OpenAI-compatible plugin manifest for ChatGPT and GPT-based agents.","operationId":"serve_ai_plugin__well_known_ai_plugin_json_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/llms.txt":{"get":{"summary":"Serve Llms Txt","description":"Serve llms.txt — plain-language API description for LLMs and AI crawlers.","operationId":"serve_llms_txt_llms_txt_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/sitemap.xml":{"get":{"summary":"Serve Sitemap","description":"Serve sitemap.xml — points crawlers to all discovery endpoints.","operationId":"serve_sitemap_sitemap_xml_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/agents/register":{"post":{"summary":"Register Agent","description":"Register a new external AI agent and receive an API key.\n\nThe agent starts with READ_ONLY permission and auto-escalates\nto higher levels based on intent (cart actions → READ_CART,\ncheckout → READ_CART_CHECKOUT).","operationId":"register_agent_api_agents_register_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentRegisterRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agents/{agent_id}/permissions":{"get":{"summary":"Get Agent Permissions","description":"Check current permission level for an agent. Requires the agent's own API key.","operationId":"get_agent_permissions_api_agents__agent_id__permissions_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","title":"Agent Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/ucp/message":{"post":{"summary":"Ucp Message Endpoint","description":"Unified UCP protocol endpoint for external AI agents.\n\nSend A2A-formatted messages and get them routed through the protocol layer.\nRead operations work without auth. Write operations require an API key\n(permissions auto-escalate based on the operation).","operationId":"ucp_message_endpoint_api_ucp_message_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UcpMessageRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/":{"get":{"summary":"Serve Frontend","operationId":"serve_frontend__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"AddToCartRequest":{"properties":{"product_id":{"type":"string","title":"Product Id"},"quantity":{"type":"integer","title":"Quantity","default":1},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}},"type":"object","required":["product_id"],"title":"AddToCartRequest","description":"Request to add product to cart"},"AgentLoginRequest":{"properties":{"agent_name":{"type":"string","maxLength":100,"minLength":1,"title":"Agent Name"}},"type":"object","required":["agent_name"],"title":"AgentLoginRequest"},"AgentRegisterRequest":{"properties":{"agent_name":{"type":"string","maxLength":100,"minLength":1,"title":"Agent Name","description":"Name for the AI agent"}},"type":"object","required":["agent_name"],"title":"AgentRegisterRequest"},"AgentRunRequest":{"properties":{"query":{"type":"string","maxLength":500,"minLength":1,"title":"Query"},"limit":{"type":"integer","maximum":50.0,"minimum":1.0,"title":"Limit","default":5},"category":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Category"},"buyer_email":{"type":"string","maxLength":254,"title":"Buyer Email","default":"demo@viree.dev"},"buyer_name":{"type":"string","maxLength":200,"title":"Buyer Name","default":"Demo Agent"},"payment_method":{"type":"string","maxLength":50,"title":"Payment Method","default":"mock_pay"}},"type":"object","required":["query"],"title":"AgentRunRequest","description":"Request to run the full external-agent flow."},"BulkUploadResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"inserted":{"type":"integer","title":"Inserted"},"product_ids":{"items":{"type":"string"},"type":"array","title":"Product Ids"}},"type":"object","required":["success","inserted","product_ids"],"title":"BulkUploadResponse","description":"Response model for bulk upload."},"CartResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"session_id":{"type":"string","title":"Session Id"},"items":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Items"},"subtotal":{"type":"integer","title":"Subtotal"},"total":{"type":"integer","title":"Total"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["success","session_id","items","subtotal","total"],"title":"CartResponse","description":"Cart status response"},"CheckoutRequest":{"properties":{"session_id":{"type":"string","title":"Session Id"},"buyer_email":{"type":"string","title":"Buyer Email"},"buyer_name":{"type":"string","title":"Buyer Name"},"payment_method":{"type":"string","title":"Payment Method","default":"mock_pay"}},"type":"object","required":["session_id","buyer_email","buyer_name"],"title":"CheckoutRequest","description":"Request to complete checkout"},"CheckoutResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"order_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Order Id"},"transaction_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transaction Id"},"total":{"type":"integer","title":"Total"},"status":{"type":"string","title":"Status"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["success","total","status"],"title":"CheckoutResponse","description":"Checkout completion response"},"ConversationResponse":{"properties":{"messages":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Messages"}},"type":"object","required":["messages"],"title":"ConversationResponse"},"DBSyncRequest":{"properties":{"sync_type":{"type":"string","title":"Sync Type","default":"ondemand"},"from_db":{"type":"string","title":"From Db","default":"source_products"}},"type":"object","title":"DBSyncRequest"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"LoginRequest":{"properties":{"username":{"type":"string","title":"Username"},"password":{"type":"string","title":"Password"}},"type":"object","required":["username","password"],"title":"LoginRequest"},"ProductCreate":{"properties":{"title":{"type":"string","maxLength":512,"minLength":3,"title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"price":{"type":"integer","exclusiveMinimum":0.0,"title":"Price","description":"Price in cents"},"currency":{"type":"string","pattern":"^[A-Z]{3}$","title":"Currency","default":"USD"},"category":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Category"},"brand":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Brand"},"image_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image Url"},"vendor_id":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Vendor Id"},"rating":{"anyOf":[{"type":"number","maximum":5.0,"minimum":0.0},{"type":"null"}],"title":"Rating"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"},"in_stock":{"type":"boolean","title":"In Stock","default":true},"stock_quantity":{"type":"integer","minimum":0.0,"title":"Stock Quantity","description":"Available stock quantity","default":100}},"type":"object","required":["title","price"],"title":"ProductCreate","description":"Request model for creating a product."},"ProductResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"product_id":{"type":"string","title":"Product Id"},"product":{"additionalProperties":true,"type":"object","title":"Product"}},"type":"object","required":["success","product_id","product"],"title":"ProductResponse","description":"Response model for product operations."},"SourceConfigRequest":{"properties":{"label":{"type":"string","title":"Label","default":""},"type":{"type":"string","title":"Type","default":""},"description":{"type":"string","title":"Description","default":""},"table":{"type":"string","title":"Table","default":"products"},"mapping_mode":{"type":"string","title":"Mapping Mode","default":"default"},"column_mapping":{"additionalProperties":{"type":"string"},"type":"object","title":"Column Mapping","default":{}}},"type":"object","title":"SourceConfigRequest"},"TTSRequest":{"properties":{"text":{"type":"string","title":"Text"}},"type":"object","required":["text"],"title":"TTSRequest"},"TokenSearchRequest":{"properties":{"tokens":{"items":{"type":"number"},"type":"array","title":"Tokens"},"limit":{"type":"integer","title":"Limit","default":20},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"min_price":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Min Price"},"max_price":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Price"}},"type":"object","required":["tokens"],"title":"TokenSearchRequest","description":"Request model for token-based search"},"TokenSearchResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"products":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Products"},"count":{"type":"integer","title":"Count"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["success","products","count"],"title":"TokenSearchResponse","description":"Response model for token-based search"},"UcpMessageRequest":{"properties":{"type":{"type":"string","title":"Type","description":"MessageType value (e.g., 'search_request', 'add_to_checkout')"},"content":{"type":"string","title":"Content","description":"Human-readable text","default":""},"data":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Data","description":"Structured payload"},"ucp_capability":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ucp Capability","description":"UCP capability override"}},"type":"object","required":["type"],"title":"UcpMessageRequest"},"UserInput":{"properties":{"message":{"type":"string","title":"Message"}},"type":"object","required":["message"],"title":"UserInput"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"APIKeyHeader":{"type":"apiKey","in":"header","name":"X-Agent-Key"}}}}