ดึงรายการสินค้าทั้งหมดภายใน Sales Order หนึ่งรายการ
Endpoint นี้เหมาะสำหรับ:
read:sales
Access Token ต้องได้รับ Scope read:sales มิฉะนั้นระบบจะปฏิเสธคำขอ
GET /api/partner/v1/sales/:id/items
Authorization: Bearer <access_token>
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string (UUID) | Yes | Sales Order ID |
Endpoint นี้คืนรายการสินค้าทั้งหมดใน Order โดยไม่ใช้ Pagination — ข้อมูลทุก item จะอยู่ใน data array เพียง response เดียว
curl -X GET \
"https://<host>/api/partner/v1/sales/4e3509ea-6e79-4243-b861-2d6d96e22af3/items" \
-H "Authorization: Bearer <access_token>"
{
"data": [
{
"id": "cd1f8ec8-8da4-4ed9-b2dc-84fcae5fd2bf",
"product_sku_id": "464e9d4f-f873-4cf2-8ce7-061ce856eb61",
"sku_code": "",
"sku_name": "ส้มตำคอหมูย่าง",
"product_name": "ส้มตำคอหมูย่าง",
"quantity": "1",
"unit_price": "120",
"discount_amount": "0",
"tax_amount": "7.85",
"line_total": "120",
"refunded_quantity": "0",
"refunded_amount": "0",
"is_fully_refunded": false,
"created_at": "2026-06-15T03:22:16.744Z"
}
]
}
| Field | Type | Description |
|---|---|---|
| id | string (UUID) | Order Item ID |
| product_sku_id | string (UUID) | SKU ที่ขาย |
| sku_code | string | รหัส SKU |
| sku_name | string | ชื่อ SKU |
| product_name | string | ชื่อสินค้า |
| quantity | string (decimal) | จำนวนที่ขาย |
| unit_price | string (decimal) | ราคาต่อหน่วย |
| discount_amount | string (decimal) | ส่วนลดของ item นี้ |
| tax_amount | string (decimal) | ภาษีของ item นี้ |
| line_total | string (decimal) | ยอดรวมของ item (หลังส่วนลด ก่อนภาษี) |
| refunded_quantity | string (decimal) | จำนวนที่คืนเงินแล้ว |
| refunded_amount | string (decimal) | ยอดเงินที่คืนแล้ว |
| is_fully_refunded | boolean | true หาก item นี้ถูกคืนเงินทั้งหมด |
| created_at | string (ISO 8601) | เวลาที่สร้าง record |
ฟิลด์เกี่ยวกับจำนวนเงินและปริมาณทั้งหมดถูกส่งกลับในรูปแบบ Decimal String เพื่อป้องกันปัญหา Floating Point
Partner ควรใช้ Decimal Library หรือ Big Number Library ในการคำนวณทางการเงิน
404 Not Found
{
"error": "not_found",
"message": "Sales order not found"
}
สาเหตุ:
id ไม่ถูกต้อง