orders-dt
เอกสารถูกนำเข้าจากไฟล์ Postman collection อัตโนมัติ
ใช้สำหรับดึงรายละเอียดคำสั่งซื้อของร้านค้า โดยระบุหมายเลขคำสั่งซื้อ (order_number) ที่ต้องการ
ระบบจะตรวจสอบว่าคำสั่งซื้อดังกล่าวเป็นของร้านค้าที่กำลังเรียก API เท่านั้น
Request
-
Method:
GET -
URL:
{{api_url}}/v1/orders/get_dt -
View common parameters
Query params
| Properties | Type | Required | Description |
|---|---|---|---|
| app_key | string | Yes | Partner application key |
| app_secret | string | Yes | Partner application secret |
| shop_id | string | Yes | Shop ID |
| access_token | string | Yes | Partner access token |
| order_number | string | Yes | หมายเลขคำสั่งซื้อที่ต้องการดึงข้อมูล |
Request example
Example response
Status: 200
Response fields
Order
| Properties | Type | Description |
|---|---|---|
| status | boolean | สถานะการทำงานของ API |
| code | string | Response code |
| message | string | รายละเอียดผลลัพธ์ |
| data.order_id | integer | Internal order ID |
| data.order_number | string | หมายเลขคำสั่งซื้อ |
| data.buyer_user_id | integer | User ID ของผู้ซื้อ |
| data.buyer_user_name | string / null | ชื่อผู้ซื้อ |
| data.buyer_username | string / null | Username ของผู้ซื้อ |
| data.order_amount | decimal / string | มูลค่าสินค้ารวมก่อนค่าจัดส่งและส่วนลดตามข้อมูลของคำสั่งซื้อ |
| data.shipping_fee | decimal / string | ค่าจัดส่ง |
| data.discount | decimal / string | ส่วนลดของคำสั่งซื้อ |
| data.total_amount | decimal / string | ยอดรวมของคำสั่งซื้อ |
| data.cod | integer | สถานะ COD โดย 1 หมายถึง COD และ 0 หมายถึง Non-COD |
| data.recipient_name | string / null | ชื่อผู้รับสินค้า |
| data.recipient_phone | string / null | เบอร์โทรศัพท์ผู้รับสินค้า |
| data.recipient_address | string / null | ที่อยู่ผู้รับสินค้า |
| data.recipient_sub_district | string / null | แขวง/ตำบล |
| data.recipient_district | string / null | เขต/อำเภอ |
| data.recipient_province | string / null | จังหวัด |
| data.recipient_zipcode | string / null | รหัสไปรษณีย์ |
| data.shipment_provider | string / null | รหัสผู้ให้บริการขนส่ง |
| data.tracking_number | string / null | หมายเลขติดตามพัสดุ |
| data.package_weight | number / null | น้ำหนักพัสดุ |
| data.package_width | number / null | ความกว้างพัสดุ |
| data.package_length | number / null | ความยาวพัสดุ |
| data.package_height | number / null | ความสูงพัสดุ |
| data.order_status | string / null | รหัสสถานะคำสั่งซื้อ |
| data.create_time | integer | เวลาที่สร้างคำสั่งซื้อในรูปแบบ Unix timestamp (seconds) |
| data.update_time | integer | เวลาที่คำสั่งซื้อถูกแก้ไขล่าสุดในรูปแบบ Unix timestamp (seconds) |
| data.order_details | array | รายการสินค้าในคำสั่งซื้อ |
| request_id | string | Request reference ID สำหรับใช้ตรวจสอบ Log หรือแจ้งปัญหา |
Order details
| Properties | Type | Description |
|---|---|---|
| order_detail_id | integer | Order detail ID |
| product_id | integer | Product ID |
| product_name | string | ชื่อสินค้า |
| product_sku | string / null | SKU ของสินค้า |
| product_image | string / null | URL รูปภาพสินค้า |
| option_id | integer / null | Product option ID หากสินค้ามีตัวเลือก |
| option_name | string / null | ชื่อตัวเลือกสินค้า |
| option_sku | string / null | SKU ของตัวเลือกสินค้า |
| option_image | string / null | URL รูปภาพของตัวเลือกสินค้า |
| original_price | decimal / number | ราคาขายสินค้าต่อหน่วยก่อนส่วนลดตามข้อมูลที่บันทึกในคำสั่งซื้อ |
| discount_price | decimal / number | ส่วนลดสินค้าต่อหน่วยตามข้อมูลที่บันทึกในคำสั่งซื้อ |
| product_qty | integer | จำนวนสินค้า |
| total_amount | decimal / number | ยอดรวมของรายการสินค้า |
Error response
Missing order number
หากไม่ได้ส่ง order_number หรือข้อมูลไม่ผ่าน Validation API จะคืน HTTP Status 422
Status: 422
ข้อความ Validation ที่คืนจริงอาจแตกต่างตาม Validation helper ของระบบ
Order not found
หากไม่พบ order_number ที่ระบุ หรือคำสั่งซื้อไม่ได้เป็นของร้านค้าที่กำลังเรียก API ระบบจะไม่คืนรายละเอียดคำสั่งซื้อ
Status: 404