Product Attribute API
Postman Example
https://www.getpostman.com/collections/7edce68fd8879d90c2ee
![](https://storage.crisp.chat/users/helpdesk/website/14e70c59388c7000/image_7nyzfh.png)
![](https://storage.crisp.chat/users/helpdesk/website/14e70c59388c7000/image-6_xk78ao.png)
ให้นำ Link import เข้า Postman
![](https://storage.crisp.chat/users/helpdesk/website/14e70c59388c7000/image-2_mrlup4.png)
![คลิกที่เมนู Collection ที่ Import เข้ามาแล้วเลือก Edit](https://storage.crisp.chat/users/helpdesk/website/14e70c59388c7000/image-3_u7fdcm.png)
![ใส่ Access Token ที่ได้จากการ Authenticate](https://storage.crisp.chat/users/helpdesk/website/14e70c59388c7000/image-4_g8ivzr.png)
![คลิกที่ Variables แล้วระบุ ค่า storeId ส่วนค่า productId ให้ระบุทีหลัง หลังจากส่งคำสั่งสร้าง Product มา ให้ระบุทั้งสองช่อง (INITIAL VALUE และ CURRENT VALUE)](https://storage.crisp.chat/users/helpdesk/website/14e70c59388c7000/image-5_1miijiz.png)
![ใช้ request add product เพื่อสร้าง product type 3 (Product Attribute) หลังจากได้ productId ให้นำค่าไปใส่ใน Variable ที่เดียวกับ storeId](https://storage.crisp.chat/users/helpdesk/website/14e70c59388c7000/image-7_1461l33.png)
![ระบุ Attribute name กรณีมีตัวเลือกฝั่งเดียว ให้ระบุแค่ field attr1name ส่วน attr2name ให้ปิดไป (กรณีที่เคย init atrtibute ไปแล้ว ถ้ากลับมา init ใหม่ product variant ทั้้งหมดจะถูกลบไป)](https://storage.crisp.chat/users/helpdesk/website/14e70c59388c7000/image-8_vxmarv.png)
![เพิ่ม product variant โดยระบุรายละเอียดตามตัวอย่าง สามารถ request ซ้ำเพื่ออัพเดทค่า price, stock ของ product variant ได้ โดยระบบจะใช้ attr1 และ attr2 อ้างอิง ถ้าไม่มีในระบบ ระบบจะทำการสร้างให้](https://storage.crisp.chat/users/helpdesk/website/14e70c59388c7000/image-9_1a12j3q.png)
![การอัพเดท Attribute name ระบุชื่อที่ต้องการเปลี่ยนเช่นจะเปลี่ยนจาก Colour > สี ให้ระบุ แล้วส่งค่าเพื่อเปลี่ยน](https://storage.crisp.chat/users/helpdesk/website/14e70c59388c7000/image-11_xdb4y2.png)
การเพิ่มรูปให้กับ product สามารถดูได้ที่
https://app.swaggerhub.com/apis/SemanticTouch/BentowebProduct/1.0.0-oas3#/Products/post_product_image
https://www.getpostman.com/collections/7edce68fd8879d90c2ee
![](https://storage.crisp.chat/users/helpdesk/website/14e70c59388c7000/image_7nyzfh.png)
![](https://storage.crisp.chat/users/helpdesk/website/14e70c59388c7000/image-6_xk78ao.png)
ให้นำ Link import เข้า Postman
![](https://storage.crisp.chat/users/helpdesk/website/14e70c59388c7000/image-2_mrlup4.png)
![คลิกที่เมนู Collection ที่ Import เข้ามาแล้วเลือก Edit](https://storage.crisp.chat/users/helpdesk/website/14e70c59388c7000/image-3_u7fdcm.png)
![ใส่ Access Token ที่ได้จากการ Authenticate](https://storage.crisp.chat/users/helpdesk/website/14e70c59388c7000/image-4_g8ivzr.png)
![คลิกที่ Variables แล้วระบุ ค่า storeId ส่วนค่า productId ให้ระบุทีหลัง หลังจากส่งคำสั่งสร้าง Product มา ให้ระบุทั้งสองช่อง (INITIAL VALUE และ CURRENT VALUE)](https://storage.crisp.chat/users/helpdesk/website/14e70c59388c7000/image-5_1miijiz.png)
![ใช้ request add product เพื่อสร้าง product type 3 (Product Attribute) หลังจากได้ productId ให้นำค่าไปใส่ใน Variable ที่เดียวกับ storeId](https://storage.crisp.chat/users/helpdesk/website/14e70c59388c7000/image-7_1461l33.png)
![ระบุ Attribute name กรณีมีตัวเลือกฝั่งเดียว ให้ระบุแค่ field attr1name ส่วน attr2name ให้ปิดไป (กรณีที่เคย init atrtibute ไปแล้ว ถ้ากลับมา init ใหม่ product variant ทั้้งหมดจะถูกลบไป)](https://storage.crisp.chat/users/helpdesk/website/14e70c59388c7000/image-8_vxmarv.png)
![เพิ่ม product variant โดยระบุรายละเอียดตามตัวอย่าง สามารถ request ซ้ำเพื่ออัพเดทค่า price, stock ของ product variant ได้ โดยระบบจะใช้ attr1 และ attr2 อ้างอิง ถ้าไม่มีในระบบ ระบบจะทำการสร้างให้](https://storage.crisp.chat/users/helpdesk/website/14e70c59388c7000/image-9_1a12j3q.png)
![การอัพเดท Attribute name ระบุชื่อที่ต้องการเปลี่ยนเช่นจะเปลี่ยนจาก Colour > สี ให้ระบุ แล้วส่งค่าเพื่อเปลี่ยน](https://storage.crisp.chat/users/helpdesk/website/14e70c59388c7000/image-11_xdb4y2.png)
การเพิ่มรูปให้กับ product สามารถดูได้ที่
https://app.swaggerhub.com/apis/SemanticTouch/BentowebProduct/1.0.0-oas3#/Products/post_product_image
อัปเดตเมื่อ: 12/07/2021
ขอบคุณ!