{"openapi":"3.1.0","info":{"title":"Alita OSP OpenAPI v1 · Dữ liệu Sàn Cam Việt Nam","version":"1.0.0","description":"Hệ thống OpenAPI tự vận hành trên VPS phục vụ tra cứu Gian hàng, Sản phẩm, Affiliate, Lịch sử giá và Phân tích thị trường Sàn Cam Việt Nam."},"servers":[{"url":"https://osp.alita.vn","description":"Current Server"}],"tags":[{"name":"Health","description":"System health and integration status"},{"name":"Shop","description":"Hồ sơ Gian hàng Sàn Cam, sản phẩm, tìm kiếm & mã giảm giá"},{"name":"Product","description":"Chi tiết sản phẩm Sàn Cam, tìm kiếm, đánh giá, hoa hồng Affiliate & lịch sử giá"},{"name":"Market","description":"Ngành hàng Sàn Cam, Flash Sale, link rút gọn Affiliate & phân tích thị trường"}],"components":{"securitySchemes":{"ApiKeyHeader":{"type":"apiKey","in":"header","name":"X-API-Key","description":"API key cấp từ /portal hoặc /admin"},"BearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{}},"security":[{"ApiKeyHeader":[]},{"BearerAuth":[]}],"paths":{"/health/v1/check":{"get":{"tags":["Health"],"summary":"Check API server, Postgres, Redis, and upstream integration status","security":[],"responses":{"200":{"description":"System health payload"}}}},"/shop/v1/shops/{identifier}/profile":{"get":{"tags":["Shop"],"summary":"Lấy hồ sơ Gian hàng Sàn Cam theo shop_id hoặc username","parameters":[{"name":"identifier","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Shop profile"},"404":{"description":"Not found"}}}},"/shop/v1/shops/{shopId}/products":{"get":{"tags":["Shop"],"summary":"Danh sách sản phẩm của Gian hàng Sàn Cam có phân trang","parameters":[{"name":"shopId","in":"path","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","schema":{"type":"integer","default":1}},{"name":"page_size","in":"query","schema":{"type":"integer","default":20}}],"responses":{"200":{"description":"Paginated shop products"}}}},"/shop/v1/shops/search":{"post":{"tags":["Shop"],"summary":"Tìm kiếm Gian hàng Sàn Cam theo từ khoá, trạng thái Mall, khu vực, rating","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"keyword":{"type":"string"},"is_official_mall":{"type":"boolean"},"location":{"type":"string"},"min_rating":{"type":"number"},"min_followers":{"type":"integer"},"sort_by":{"type":"string","enum":["followers","rating","items"]},"page":{"type":"integer","default":1},"page_size":{"type":"integer","default":20}}}}}},"responses":{"200":{"description":"Matched shops"}}}},"/shop/v1/shops/{shopId}/vouchers":{"get":{"tags":["Shop"],"summary":"Danh sách mã giảm giá đang hiệu lực của Gian hàng Sàn Cam","parameters":[{"name":"shopId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Shop vouchers"}}}},"/product/v1/products/{shopId}/{itemId}/details":{"get":{"tags":["Product"],"summary":"Chi tiết đầy đủ sản phẩm Sàn Cam theo shopId và itemId","parameters":[{"name":"shopId","in":"path","required":true,"schema":{"type":"string"}},{"name":"itemId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Product details with shop info"}}}},"/product/v1/products/{itemId}/details":{"get":{"tags":["Product"],"summary":"Tra cứu nhanh chi tiết sản phẩm Sàn Cam theo itemId","parameters":[{"name":"itemId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Product details"}}}},"/product/v1/products/search":{"post":{"tags":["Product"],"summary":"Tìm kiếm sản phẩm Sàn Cam với bộ lọc giá, ngành hàng, Mall và sắp xếp","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"keyword":{"type":"string"},"shop_id":{"type":"string"},"category_id":{"type":"string"},"min_price":{"type":"number"},"max_price":{"type":"number"},"min_rating":{"type":"number"},"is_official_mall":{"type":"boolean"},"sort_by":{"type":"string","enum":["sold","sold_30d","price_asc","price_desc","rating","commission","newest"]},"page":{"type":"integer","default":1},"page_size":{"type":"integer","default":20}}}}}},"responses":{"200":{"description":"Paginated product results"}}}},"/product/v1/products/{itemId}/reviews":{"get":{"tags":["Product"],"summary":"Lấy danh sách đánh giá khách hàng & lọc theo số sao","parameters":[{"name":"itemId","in":"path","required":true,"schema":{"type":"string"}},{"name":"rating","in":"query","schema":{"type":"integer","minimum":1,"maximum":5}},{"name":"page","in":"query","schema":{"type":"integer","default":1}},{"name":"page_size","in":"query","schema":{"type":"integer","default":20}}],"responses":{"200":{"description":"Paginated reviews"}}}},"/product/v1/products/{itemId}/affiliate":{"get":{"tags":["Product"],"summary":"Tra cứu tỷ lệ hoa hồng Affiliate Sàn Cam và hoa hồng ước tính","parameters":[{"name":"itemId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Affiliate commission details"}}}},"/product/v1/products/affiliate/search":{"post":{"tags":["Product"],"summary":"Tìm kiếm sản phẩm Sàn Cam có hoa hồng Affiliate cao","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"keyword":{"type":"string"},"min_commission_rate":{"type":"number"},"is_official_mall":{"type":"boolean"},"sort_by":{"type":"string","default":"commission"},"page":{"type":"integer","default":1},"page_size":{"type":"integer","default":20}}}}}},"responses":{"200":{"description":"Affiliate product results"}}}},"/product/v1/products/{itemId}/history":{"get":{"tags":["Product"],"summary":"Lịch sử biến động giá, tồn kho và lượt bán ghi nhận định kỳ trên VPS","parameters":[{"name":"itemId","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","default":60}}],"responses":{"200":{"description":"Product price & sales history"}}}},"/market/v1/categories":{"get":{"tags":["Market"],"summary":"Danh sách ngành hàng Sàn Cam Việt Nam","parameters":[{"name":"parent_id","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Category list"}}}},"/market/v1/flash-sales":{"get":{"tags":["Market"],"summary":"Danh sách sản phẩm Flash Sale Sàn Cam","parameters":[{"name":"active_only","in":"query","schema":{"type":"boolean","default":false}},{"name":"page","in":"query","schema":{"type":"integer","default":1}},{"name":"page_size","in":"query","schema":{"type":"integer","default":20}}],"responses":{"200":{"description":"Paginated flash sale items"}}}},"/market/v1/affiliate/short-link":{"post":{"tags":["Market"],"summary":"Tạo link rút gọn Affiliate Sàn Cam kèm tối đa 5 mã sub_id","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["origin_url"],"properties":{"origin_url":{"type":"string","format":"uri"},"sub_ids":{"type":"array","items":{"type":"string"},"maxItems":5}}}}}},"responses":{"200":{"description":"Generated short link"}}}},"/market/v1/analytics/summary":{"get":{"tags":["Market"],"summary":"Thống kê thị trường Sàn Cam (Top Brand, ngành hàng, khoảng giá, Top Affiliate) tính trực tiếp trên VPS","responses":{"200":{"description":"Market analytics summary"}}}}}}