{"openapi":"3.0.3","info":{"title":"Sydigi Content API","version":"1.0.0","description":"API quản lý nội dung sydigi.com. Xác thực: header `Authorization: Bearer <token>` (tạo token tại Admin → Cài đặt → API). Scopes: `*` hoặc `products:read`, `products:write`, `posts:read`, `posts:write`, `services:read`, `services:write`, `keys:read`, `keys:write`, `orders:read`. Giới hạn 120 request/phút."},"servers":[{"url":"https://sydigi.com/api/v1"}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"security":[{"bearer":[]}],"paths":{"/products":{"get":{"tags":["products"],"summary":"Danh sách products","parameters":[{"name":"limit","in":"query","schema":{"type":"integer"}},{"name":"offset","in":"query","schema":{"type":"integer"}}],"responses":{"200":{"description":"OK"}}},"post":{"tags":["products"],"summary":"Tạo products","requestBody":{"content":{"application/json":{"example":{"name":"Tên phần mềm","tagline":"Mô tả ngắn","content":"Nội dung **markdown** hoặc HTML","youtube":"https://youtu.be/xxxxxxxxxxx","delivery_type":"download","delivery_url":"https://drive.google.com/...","status":"published","tiers":[{"name":"1 năm","price":199000,"duration_days":365,"features":["1 máy"]}]}}}},"responses":{"201":{"description":"Created"}}}},"/products/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"id hoặc slug (GET)"}],"get":{"tags":["products"],"summary":"Chi tiết","responses":{"200":{"description":"OK"}}},"patch":{"tags":["products"],"summary":"Cập nhật một phần","requestBody":{"content":{"application/json":{"example":{"name":"Tên phần mềm","tagline":"Mô tả ngắn","content":"Nội dung **markdown** hoặc HTML","youtube":"https://youtu.be/xxxxxxxxxxx","delivery_type":"download","delivery_url":"https://drive.google.com/...","status":"published","tiers":[{"name":"1 năm","price":199000,"duration_days":365,"features":["1 máy"]}]}}}},"responses":{"200":{"description":"OK"}}},"delete":{"tags":["products"],"summary":"Xoá (products: chuyển nháp)","responses":{"200":{"description":"OK"}}}},"/posts":{"get":{"tags":["posts"],"summary":"Danh sách posts","parameters":[{"name":"limit","in":"query","schema":{"type":"integer"}},{"name":"offset","in":"query","schema":{"type":"integer"}}],"responses":{"200":{"description":"OK"}}},"post":{"tags":["posts"],"summary":"Tạo posts","requestBody":{"content":{"application/json":{"example":{"title":"Tiêu đề","excerpt":"Tóm tắt","content":"# Markdown","tags":"ai, comfyui","category_id":1}}}},"responses":{"201":{"description":"Created"}}}},"/posts/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"id hoặc slug (GET)"}],"get":{"tags":["posts"],"summary":"Chi tiết","responses":{"200":{"description":"OK"}}},"patch":{"tags":["posts"],"summary":"Cập nhật một phần","requestBody":{"content":{"application/json":{"example":{"title":"Tiêu đề","excerpt":"Tóm tắt","content":"# Markdown","tags":"ai, comfyui","category_id":1}}}},"responses":{"200":{"description":"OK"}}},"delete":{"tags":["posts"],"summary":"Xoá (products: chuyển nháp)","responses":{"200":{"description":"OK"}}}},"/services":{"get":{"tags":["services"],"summary":"Danh sách services","parameters":[{"name":"limit","in":"query","schema":{"type":"integer"}},{"name":"offset","in":"query","schema":{"type":"integer"}}],"responses":{"200":{"description":"OK"}}},"post":{"tags":["services"],"summary":"Tạo services","requestBody":{"content":{"application/json":{"example":{"name":"API tạo ảnh","tagline":"...","external_url":"https://...","price_text":"Từ 0đ"}}}},"responses":{"201":{"description":"Created"}}}},"/services/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"id hoặc slug (GET)"}],"get":{"tags":["services"],"summary":"Chi tiết","responses":{"200":{"description":"OK"}}},"patch":{"tags":["services"],"summary":"Cập nhật một phần","requestBody":{"content":{"application/json":{"example":{"name":"API tạo ảnh","tagline":"...","external_url":"https://...","price_text":"Từ 0đ"}}}},"responses":{"200":{"description":"OK"}}},"delete":{"tags":["services"],"summary":"Xoá (products: chuyển nháp)","responses":{"200":{"description":"OK"}}}},"/products/{id}/keys":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"get":{"tags":["keys"],"summary":"Danh sách key + tồn kho","parameters":[{"name":"status","in":"query","schema":{"type":"string","enum":["available","sold","revoked"]}}],"responses":{"200":{"description":"OK"}}},"post":{"tags":["keys"],"summary":"Thêm key hàng loạt","requestBody":{"content":{"application/json":{"example":{"keys":["AAAA-BBBB","CCCC-DDDD"],"tier_id":null}}}},"responses":{"201":{"description":"Created"}}}},"/products/{id}/keys/{kid}":{"delete":{"tags":["keys"],"summary":"Xoá key chưa bán","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}},{"name":"kid","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"OK"}}}},"/orders":{"get":{"tags":["orders"],"summary":"Danh sách đơn hàng","responses":{"200":{"description":"OK"}}}}}}