# Pantip Mall > Pantip Mall คือตลาดคนไทย ซื้อขายแฟร์...แฟร์ | ช้อปออนไลน์ | สินค้าแบรนด์แท้ | ร้านค้าไทย > ไฟล์นี้ให้ข้อมูลแบบละเอียดสำหรับ AI agent ที่ต้องการช่วยผู้ใช้ค้นหาและแนะนำสินค้าบนแพลตฟอร์มนี้ (เวอร์ชันเต็ม — มี schema และตัวอย่าง response ครบ ไม่ต้องตามลิงก์เพิ่ม) หมายเหตุสำคัญ: - ปัจจุบันรองรับเฉพาะการอ่านข้อมูลสินค้า (ค้นหา ดูรายละเอียด) เท่านั้น ทุก endpoint เป็น GET เท่านั้น (Phase 1 ไม่รองรับการแก้ไขข้อมูลผ่าน agent) - ไม่รองรับการทำธุรกรรมซื้อขายผ่าน agent ในขณะนี้ ผู้ใช้ต้องทำการสั่งซื้อด้วยตนเองผ่านหน้าเว็บ/แอป - ทุก endpoint ไม่ต้อง login / authenticate ## Search Products `GET /v1/products?` - Query params: คำค้น (keyword), `offset`, `limit` (สูงสุด 50) - คืนข้อมูลเป็น JSON array ของสินค้าตาม Physical Product Schema (ดูด้านล่าง) - มี cache layer ฝั่ง gRPC (TTL เท่ากับ search หน้าบ้าน) และ cache ฝั่ง resolve product ## Product Detail `GET /api/v1/products/{id}` - คืนข้อมูลสินค้ารายตัวแบบเต็ม ตาม Physical Product Schema - หากสินค้าไม่มีอยู่จริง ถูกลบ หรือถูกซ่อน/ปิดการขาย → คืน HTTP 404 พร้อม error message ที่ชัดเจน (ป้องกัน agent แนะนำสินค้าที่ซื้อไม่ได้) - มี cache layer (cache 5 นาที) เพื่อลด load บน database ## Category Listing `GET /api/v1/categories/{id}/products` - คืนรายการสินค้าในหมวดหมู่นั้นแบบ JSON ตาม Physical Product Schema - รองรับ sort: มาใหม่ / ยอดนิยม / เกี่ยวข้อง - รองรับ pagination (`offset`, `limit`) ## Physical Product Schema **กรณี `has_variants: false`** (สินค้าไม่มีตัวเลือก) — คืน field ระดับสินค้าตรง ๆ: `price`, `discount_price`, `stock_status`, `stock_quantity` ไม่มี field `variants`/`option_groups` ```json { "id": "P10001", "name": "หมอนรองคอเป่าลม", "price": 199, "discount_price": null, "currency": "THB", "stock_status": "in_stock", "stock_quantity": 320, "description": "หมอนรองคอแบบเป่าลม พกพาสะดวก พับเก็บได้", "category": "หมอนเดินทาง", "category_path": ["ของใช้เดินทาง", "อุปกรณ์พักผ่อน", "หมอนเดินทาง"], "category_id": "C00045", "seller": { "id": "S001", "name": "ร้าน Travel Easy" }, "images": ["https://yourdomain.com/img/P10001-1.jpg"], "rating": 4.3, "review_count": 152, "has_variants": false } ``` **กรณี `has_variants: true`** (สินค้ามีตัวเลือก 1-2 ชั้น) — `price` ระดับสินค้าเป็น `null`, มี `price_range` คำนวณจาก variant ที่ `in_stock: true` เท่านั้น (ถ้าหมดสต็อกทั้งหมด ให้คำนวณจากราคาทั้งหมดแทน), มี `option_groups` และ `variants` (เฉพาะคู่ที่เปิดขายจริง ไม่ใช่ cartesian product ทางทฤษฎี), `stock_status` ระดับสินค้า = `in_stock` ถ้ามี variant อย่างน้อย 1 ตัว in_stock ```json { "id": "P20005", "name": "เสื้อยืดคอกลม Basic", "price": null, "price_range": { "min": 199, "max": 259 }, "currency": "THB", "stock_status": "in_stock", "description": "เสื้อยืดผ้าคอตตอน 100% ระบายอากาศดี", "category": "เสื้อยืด", "category_path": ["เสื้อผ้าแฟชั่น", "เสื้อผ้าผู้ชาย", "เสื้อยืด"], "category_id": "C00123", "seller": { "id": "S045", "name": "ร้าน Fashion House" }, "images": ["https://yourdomain.com/img/P20005-1.jpg"], "rating": 4.6, "review_count": 230, "has_variants": true, "option_groups": [ { "name": "สี", "values": ["ขาว", "ดำ", "กรมท่า"] }, { "name": "ไซส์", "values": ["S", "M", "L", "XL"] } ], "variants": [ { "variant_id": "P20005-WH-S", "options": {"สี": "ขาว", "ไซส์": "S"}, "price": 199, "stock_quantity": 40, "in_stock": true, "image": "https://yourdomain.com/img/P20005-white.jpg" }, { "variant_id": "P20005-BK-XL", "options": {"สี": "ดำ", "ไซส์": "XL"}, "price": 259, "stock_quantity": 12, "in_stock": true, "image": "https://yourdomain.com/img/P20005-black.jpg" } ] } ``` ## Usage Limits & Errors - Rate limiting และ monitoring แยกจาก internal API พร้อม logging ตรวจจับ pattern การใช้งานผิดปกติ - ทุก endpoint public ผ่าน security review ก่อนขึ้น production - 404 กรณีไม่พบสินค้า / สินค้าถูกลบ / สินค้าถูกซ่อนหรือปิดการขาย ## Other Resources - [Sitemap](https://www.pantipmall.com/sitemap.xml) - [Terms of service](https://www.pantipmall.com/static/terms-and-conditions) - [Privacy policy](https://www.pantipmall.com/static/privacy) - [Shipping & return policy](https://www.pantipmall.com/static/return-and-refund)