{"openapi":"3.1.0","info":{"title":"https://ambinfosys.com | Agentic Commerce API","version":"1.0.0","description":"Autonomous Agent & AI Tool Calling API for product discovery, live search, catalog retrieval, payment methods, order tracking, and 1-click checkout URL generation."},"servers":[{"url":"https://ambinfosys.com","description":"Live Storefront Server"}],"paths":{"/api/search":{"get":{"operationId":"searchProducts","summary":"Search & Filter Store Catalog","description":"Search products by keyword query, filter by category slug, apply price ranges, and paginate results.","parameters":[{"name":"q","in":"query","required":false,"description":"Search query string (e.g., 'metal hanging', 'modern wallpaper', 'floral')","schema":{"type":"string"}},{"name":"category","in":"query","required":false,"description":"Category slug to filter by (e.g., 'wallpapers', 'metal-art')","schema":{"type":"string"}},{"name":"start","in":"query","required":false,"description":"Pagination start offset (default: 0)","schema":{"type":"integer","default":0}},{"name":"end","in":"query","required":false,"description":"Pagination item limit (default: 50)","schema":{"type":"integer","default":50}},{"name":"sort","in":"query","required":false,"description":"Sort order: 'price-asc', 'price-desc', 'newest', 'default'","schema":{"type":"string","enum":["price-asc","price-desc","newest","default"]}}],"responses":{"200":{"description":"Search results successfully retrieved","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"query":{"type":"string"},"category":{"type":"string","nullable":true},"pagination":{"type":"object","properties":{"start":{"type":"integer"},"end":{"type":"integer"}}},"data":{"type":"object"}}}}}}}}},"/api/products/{id}":{"get":{"operationId":"getProductDetails","summary":"Get Product Details & Variants","description":"Retrieve comprehensive product information including pricing, stock, dimensions, materials, and available variants using product ID or URL slug.","parameters":[{"name":"id","in":"path","required":true,"description":"Product ID, slug, or handle (e.g., 'METAL-HANGING')","schema":{"type":"string"}}],"responses":{"200":{"description":"Product details found","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"price":{"type":"number"},"currency":{"type":"string","default":"NPR"},"stock":{"type":"object"},"variants":{"type":"array"},"attributes":{"type":"array"},"media":{"type":"array"}}}}}}}},"404":{"description":"Product not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"}}}}}}}}}}},"/api/categories":{"get":{"operationId":"listCategories","summary":"List All Store Categories","description":"Retrieve all active store collections, category names, slugs, and navigation routes.","responses":{"200":{"description":"Categories successfully retrieved","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"total":{"type":"integer"},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"route":{"type":"string"}}}}}}}}}}}},"/api/payments/methods":{"get":{"operationId":"listPaymentMethods","summary":"List Accepted Payment Gateways","description":"Get active payment methods accepted by the store (Cash on Delivery, eSewa, Khalti, Fonepay QR).","responses":{"200":{"description":"Payment methods retrieved","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"total":{"type":"integer"},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"currency":{"type":"string"}}}}}}}}}}}},"/api/orders/{orderId}":{"get":{"operationId":"getOrderStatus","summary":"Get Order Fulfillment & Status","description":"Look up order details, tracking status, and fulfillment stage using the Order ID and optional phone number.","parameters":[{"name":"orderId","in":"path","required":true,"description":"Order ID (e.g. 'ORD-12345')","schema":{"type":"string"}},{"name":"phone","in":"query","required":false,"description":"Customer verification phone number","schema":{"type":"string"}}],"responses":{"200":{"description":"Order found","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"order_id":{"type":"string"},"status":{"type":"string"},"payment_status":{"type":"string"},"data":{"type":"object"}}}}}}}}}},"components":{"schemas":{"CheckoutUrlParameters":{"type":"object","description":"URL parameters for creating direct 1-click checkout sessions at /checkout","properties":{"items":{"type":"string","description":"JSON array of items stringified: `[{\"p\":\"<PRODUCT_ID>\",\"v\":\"<VARIANT_ID>\",\"q\":1}]`"},"user":{"type":"string","description":"JSON object of customer info stringified: `{\"n\":\"Name\",\"ph\":\"9800000000\",\"loc\":\"Kathmandu\"}`"},"pay":{"type":"string","description":"Selected payment provider: 'cod', 'esewa', 'khalti', 'fonepay'"}}}}}}