Appearance
07.06 Chapter Summary
📌 At a Glance
| รายการ | รายละเอียด |
|---|---|
| Topic | Chapter Summary |
| Difficulty | ⭐ Beginner |
| Reading Time | 5 นาที |
| Target | Developer, System Integrator |
🎯 Learning Outcomes
หลังจากศึกษาบทนี้แล้ว ผู้อ่านจะสามารถ
- เรียกใช้งาน Shipment Tracking API ได้
- ค้นหารายการจัดส่งตามเงื่อนไขต่าง ๆ
- ติดตามสถานะของ Shipment ได้
- แสดง Timeline จากข้อมูล
history - ออกแบบระบบติดตามสถานะสำหรับใช้งานจริงได้
Overview
Chapter 7 อธิบายการใช้งาน Shipment Tracking API ซึ่งเป็นบริการสำหรับติดตามสถานะของรายการจัดส่งหลังจากผ่านการตรวจสอบและเข้าสู่กระบวนการขนส่ง
Developer สามารถใช้ API นี้เพื่อค้นหารายการ ตรวจสอบสถานะปัจจุบัน ดูรายละเอียดสินค้า และแสดงประวัติการเปลี่ยนสถานะให้กับผู้ใช้งานแบบ Near Real-time
Figure 7-6 Chapter Summary

Figure 7-6 สรุปภาพรวมของกระบวนการติดตามสถานะการจัดส่ง ตั้งแต่การสร้าง Order Checking การติดตาม Shipment ไปจนถึงการส่งมอบสินค้า
Chapter Overview
ตลอดทั้งบท ได้เรียนรู้หัวข้อดังต่อไปนี้
| Section | Description |
|---|---|
| 7.1 | Shipment Tracking Overview |
| 7.2 | Get Shipment Tracking API |
| 7.3 | Shipment Response Data Model |
| 7.4 | Shipment Status History |
| 7.5 | Shipment Tracking Best Practices |
Shipment Tracking Workflow
text
Create Order Checking
│
▼
Checker Review
│
▼
Shipment Created
│
▼
GET /shipments
│
▼
Receive Response
│
▼
Update Local Database
│
▼
Display Current Status
│
▼
Show TimelineDeveloper Readiness Checklist
ก่อนนำระบบขึ้น Production
- [x] จัดเก็บ Order ID (
id) - [x] เรียก Shipment Tracking API ได้
- [x] รองรับ Query Parameters
- [x] รองรับ Pagination
- [x] แสดง Timeline จาก
history - [x] จัดเก็บ Response สำหรับ Audit
- [x] รองรับ HTTP Error
- [x] ใช้งานผ่าน HTTPS
Key Takeaways
| Topic | Recommendation |
|---|---|
| Order ID | ใช้ id เป็นเลขอ้างอิงหลัก |
| Tracking | ใช้ Shipment Tracking API เพื่อติดตามสถานะ |
| History | แสดง Timeline จากข้อมูล history |
| Pagination | ใช้เมื่อดึงข้อมูลจำนวนมาก |
| Local Database | จัดเก็บข้อมูลเพื่อลดการเรียก API ซ้ำ |
| Security | ใช้งานผ่าน HTTPS และจัดการ API Key อย่างปลอดภัย |
Production Readiness
Client System ควรมีความสามารถดังต่อไปนี้
| Capability | Recommended |
|---|---|
| Shipment Tracking | ✅ |
| Query Parameters | ✅ |
| Pagination | ✅ |
| Timeline Display | ✅ |
| Local Database | ✅ |
| Logging | ✅ |
| Error Handling | ✅ |
| HTTPS | ✅ |
Common Integration Flow
text
Order Checking API
│
▼
Shipment Tracking API
│
▼
Response
│
▼
Status History
│
▼
Client Dashboard
│
▼
Customer Portal / ERP / WMSRelated Chapters
| Chapter | Description |
|---|---|
| Chapter 6 | Order Checking APIs |
| Chapter 8 | Order Rejection APIs |
| Chapter 9 | Error Handling & Response Codes |
Summary
Shipment Tracking API ช่วยให้ Client System สามารถติดตามสถานะของรายการจัดส่งได้ตลอดกระบวนการขนส่ง ตั้งแต่การยืนยันรายการ การขึ้นสินค้า การเดินทาง จนถึงการส่งมอบสินค้า โดยข้อมูล history ช่วยให้สามารถแสดง Timeline ของเหตุการณ์ทั้งหมดได้อย่างชัดเจน และข้อมูล id ใช้เป็นเลขอ้างอิงหลักสำหรับการเชื่อมโยงข้อมูลระหว่างระบบ
🎓 Chapter 7 Learning Outcomes
เมื่อจบบทนี้ คุณสามารถ
- เรียก Shipment Tracking API ได้
- ค้นหารายการจัดส่งตามเงื่อนไขต่าง ๆ
- แสดงข้อมูล Shipment ได้ครบถ้วน
- ใช้
historyสร้าง Timeline การจัดส่ง - รองรับ Pagination และ Query Parameters
- พัฒนาระบบติดตามสถานะสินค้าในระดับ Production
Next Step
➡️ Chapter 8 – Order Rejection APIs
