Appearance
08.02 Get Order Rejection API
📌 At a Glance
| รายการ | รายละเอียด |
|---|---|
| Topic | Get Order Rejection API |
| Endpoint | GET /order-rejections |
| Method | GET |
| Authentication | API Key |
| Difficulty | ⭐⭐ Intermediate |
| Reading Time | 10 นาที |
| Target | Developer, System Integrator |
🎯 Learning Objectives
หลังจากศึกษาหัวข้อนี้แล้ว ผู้อ่านจะสามารถ
- เรียกดูรายการที่ถูกปฏิเสธผ่าน API ได้
- ค้นหารายการปฏิเสธตาม
client_reference_no - กรองข้อมูลตามช่วงวันที่ได้
- เข้าใจโครงสร้าง Response ของ Order Rejection API
Overview
Order Rejection API ใช้สำหรับดึงข้อมูลรายการ Order Checking ที่ถูกปฏิเสธโดยพนักงาน SISAHYGO
API นี้ช่วยให้ Client System สามารถตรวจสอบเหตุผลการปฏิเสธรายการ เพื่อนำข้อมูลกลับไปแก้ไขในระบบต้นทาง และส่งรายการใหม่เข้าสู่ SISAHYGO ได้อย่างถูกต้อง
ข้อมูลที่แสดงจะถูกจำกัดตาม API Client และ Customer ที่ผูกกับ API Key นั้น
Figure 8-2 Get Order Rejection API

Figure 8-2 แสดงการเรียก Order Rejection API เพื่อดึงรายการที่ถูกปฏิเสธ พร้อมเหตุผล วันที่ปฏิเสธ และข้อมูลอ้างอิงที่ Client System ใช้ในการแก้ไขข้อมูล
Endpoint
List Order Rejections
http
GET /order-rejectionsFull URL
text
https://app.sisahygo.online/api/v1/order-rejectionsGet Order Rejection by Client Reference No
http
GET /order-rejections/{client_reference_no}ตัวอย่าง
http
GET /order-rejections/ERP-20260701-120750Authentication
http
X-API-Key: {your_api_key}
Accept: application/jsonQuery Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| client_reference_no | String | No | ค้นหาจากเลขอ้างอิงของ Client System |
| from_date | Date | No | วันที่เริ่มต้นของ rejected_at |
| to_date | Date | No | วันที่สิ้นสุดของ rejected_at |
| per_page | Integer | No | จำนวนรายการต่อหน้า ค่าเริ่มต้น 50 |
Sample Requests
Get Recent Rejections
http
GET /order-rejectionsFilter by Client Reference No
http
GET /order-rejections?client_reference_no=ERP-20260701-120750Filter by Date
http
GET /order-rejections?from_date=2026-07-01&to_date=2026-07-31Get Single Rejection
http
GET /order-rejections/ERP-20260701-120750Sample Response : List
json
{
"data": [
{
"id": 101,
"client_reference_no": "ERP-20260701-120750",
"reason": "ข้อมูลผู้รับสินค้าไม่ถูกต้อง",
"rejected_at": "2026-07-01T14:30:00+07:00",
"order_header_id": 681126
}
],
"meta": {
"current_page": 1,
"per_page": 50,
"total": 1,
"last_page": 1
}
}Sample Response : Single Rejection
json
{
"data": {
"id": 101,
"client_reference_no": "ERP-20260701-120750",
"reason": "ข้อมูลผู้รับสินค้าไม่ถูกต้อง",
"rejected_at": "2026-07-01T14:30:00+07:00",
"order_header_id": 681126
}
}Response Data Model
| Field | Type | Description |
|---|---|---|
| id | Integer | รหัสรายการปฏิเสธ |
| client_reference_no | String | เลขอ้างอิงจาก Client System |
| reason | String | เหตุผลที่รายการถูกปฏิเสธ |
| rejected_at | DateTime | วันที่และเวลาที่ปฏิเสธรายการ |
| order_header_id | Integer | รหัสรายการ Order ที่เกี่ยวข้อง |
Meta Object
การเรียก API แบบรายการจะมีข้อมูล Pagination
| Field | Description |
|---|---|
| current_page | หน้าปัจจุบัน |
| per_page | จำนวนรายการต่อหน้า |
| total | จำนวนรายการทั้งหมด |
| last_page | จำนวนหน้าทั้งหมด |
Business Rules
- แสดงเฉพาะรายการของ API Client ปัจจุบัน
- แสดงเฉพาะรายการของ Customer ที่ผูกกับ API Key
- หากเรียกแบบรายการ ระบบเรียงข้อมูลตาม
rejected_atจากใหม่ไปเก่า - หากเรียกแบบรายรายการด้วย
client_reference_noระบบคืนรายการล่าสุดของเลขอ้างอิงนั้น reasonคือข้อความเหตุผลที่บันทึกจากฝั่ง SISAHYGO
Implementation Notes
- ใช้
client_reference_noเชื่อมโยงกลับไปยังเอกสารใน Client System - ใช้
reasonเพื่อแสดงให้ผู้ใช้งานทราบว่าต้องแก้ไขข้อมูลอะไร - ใช้
rejected_atสำหรับเรียงลำดับและแสดง Timeline - ใช้
order_header_idเป็นข้อมูลอ้างอิงฝั่ง SISAHYGO
Best Practices
- ตรวจสอบ Order Rejection เป็นประจำ
- ใช้ Filter วันที่เพื่อลดปริมาณข้อมูล
- แสดงเหตุผลการปฏิเสธให้ผู้ใช้งานเข้าใจง่าย
- เก็บประวัติการปฏิเสธไว้ใน Client System
- แก้ไขข้อมูลต้นทางก่อนส่งรายการใหม่
Related APIs
- POST /order-checkings
- GET /shipments
Summary
Order Rejection API ช่วยให้ Client System ตรวจสอบรายการที่ไม่ผ่านการตรวจสอบจาก SISAHYGO ได้อย่างเป็นระบบ โดยใช้ client_reference_no เป็นข้อมูลเชื่อมโยงกลับไปยังเอกสารต้นทาง และใช้ reason เพื่อแก้ไขข้อมูลก่อนส่งรายการใหม่
Next Step
➡️ 08.03 Rejection Response Data Model
