> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.bentoweb.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# ขั้นตอนการทำ Cart API

1. สร้าง Cart ด้วย Endpoint [/cart-api](https://app.swaggerhub.com/apis/SemanticTouch/BentoWebOrderAPI/1.0.0-oas3#/Cart/post_cart_api) กรณีสร้างในรูปแบบออกด้วย POS ให้ส่ง is_pos เป็น 1 ด้วย
2. เพิ่มสินค้าลง Cart ด้วย Endpoint [/cart-api/product](https://app.swaggerhub.com/apis/SemanticTouch/BentoWebOrderAPI/1.0.0-oas3#/Cart/post_cart_api_product)
3. สร้างลูกค้า Guest ด้วย Endpoint [/guest](https://app.swaggerhub.com/apis/SemanticTouch/BentowebProduct/1.0.0-oas3#/Guest/post_guest) และ Guest Address ใน Endpoint [/guest-address](https://app.swaggerhub.com/apis/SemanticTouch/BentowebProduct/1.0.0-oas3#/Guest/post_guest_address) 
[API นี้จะอยู่ในฝั่ง BentowebProduct https://queue.bentoweb.com/api โปรดระวังใช้ผิดเป็น https://order.bentoweb.com/api]
4. เพิ่ม Guest address ID ลง Cart ด้วย Endpoint [/cart-api/guest-address](https://app.swaggerhub.com/apis/SemanticTouch/BentoWebOrderAPI/1.0.0-oas3#/Cart/post_cart_api_guest_address)
5. เพิ่มการจัดส่งด้วย Endpoint [/cart-api/shipping](https://app.swaggerhub.com/apis/SemanticTouch/BentoWebOrderAPI/1.0.0-oas3#/Cart/post_cart_api_shipping) 
กรณีมี guest_address_id แล้วให้ระบุมาด้วย 
shipping_key คือการจัดส่งของร้าน สามารถดูได้ใน API Endpoint [/store/shipping/{store_id}](https://app.swaggerhub.com/apis/SemanticTouch/BentowebProduct/1.0.0-oas3#/Payment%20%26%20Shipment/get_store_shipping__store_id_) [BentowebProduct]
6. เพิ่มการชำระเงินด้วย Endpoint [/cart-api/payment](https://app.swaggerhub.com/apis/SemanticTouch/BentoWebOrderAPI/1.0.0-oas3#/Cart/post_cart_api_payment) payment_key ดูได้ที่ [/store/payment/{store_id}](https://app.swaggerhub.com/apis/SemanticTouch/BentowebProduct/1.0.0-oas3#/Payment%20%26%20Shipment/get_store_payment__store_id_) [BentowebProduct] ระบุ grand_total และ shipping_key ด้วย เพื่อใช้คำนวนท้ายบิลและตรวจสอบเงื่อนไขพ่วงกับการจัดส่ง
grand_total สามารถดูได้ใน Endpoint [/cart-api/calculate](https://app.swaggerhub.com/apis/SemanticTouch/BentoWebOrderAPI/1.0.0-oas3#/Cart/post_cart_api_calculate)
7. สั่ง Checkout ด้วย Endpoint [/cart-api/checkout](https://app.swaggerhub.com/apis/SemanticTouch/BentoWebOrderAPI/1.0.0-oas3#/Cart/post_cart_api_checkout)