Reason code ที่คงที่
Error code ที่คงที่ใช้ใน client logic, reports และการ route support requests แบบอัตโนมัติ
รูปแบบเดียวสำหรับ responses, error codes, temporary failures, unknown results, diagnostics และ safe recovery สำหรับ iGaming integrations
ตรวจสอบ HTTP status, reason code, error category และ operation state
บันทึก request ID และ operation ID, endpoint, เวลา, provider reference และ parameters ที่ปลอดภัย
แก้ไขข้อมูล หยุด operation, retry request หลังเว้นช่วง หรือเช็กสถานะปัจจุบัน
ป้องกันรายการซ้ำ ทำ reconciliation แจ้งผู้รับผิดชอบ และปิดสาเหตุของปัญหา
HTTP 400 หรือ 500 เพียงอย่างเดียวไม่เพียงพอ API ที่เชื่อถือได้ควรส่ง reason code ที่คงที่ เชื่อม response กับ request ID และช่วยให้เข้าใจว่าต้องแก้ข้อมูล หยุด operation, retry request หรือเช็กสถานะแยกต่างหาก
Error code ที่คงที่ใช้ใน client logic, reports และการ route support requests แบบอัตโนมัติ
Error category ระบุว่า retry ได้หรือไม่ และต้องแก้ข้อมูลใด
Request ID, operation ID และ provider ID เชื่อม client logs กับ internal systems และ support
Response ควรกระชับ คงที่ และเหมาะกับ automatic processing โดยไม่เปิดเผย internal implementation หรือ sensitive data
ตัวระบุสาเหตุที่คงที่ ซึ่งไม่เปลี่ยนแม้แก้ข้อความอธิบาย
คำอธิบายสั้นและปลอดภัย โดยไม่มี internal code, database queries, secrets หรือรายละเอียดที่ไม่จำเป็น
Unique ID สำหรับค้นหา operation ใน logs และใช้ติดต่อ support
สถานะที่อนุญาต limit, current state หรือ safe rejection reason
สัญญาณชัดเจนว่าเป็น temporary error โดยยังต้องมีการป้องกัน operation ไม่ให้ทำซ้ำ
เวลาหน่วงที่แนะนำเป็นวินาที หรือ HTTP header สำหรับ rate limiting และ temporary unavailability
รายการ fields ที่มีปัญหา พร้อม reason code, value path และคำอธิบายที่ปลอดภัย
ลิงก์ถาวรหรือ section ID ที่อธิบายสาเหตุและวิธีแก้
HTTP status แสดง class ของผลลัพธ์โดยรวม ส่วน internal code ระบุสาเหตุและ action ที่อนุญาตอย่างเจาะจง
รูปแบบไม่ถูกต้อง ขาด required field, unsupported value, amount precision ผิด หรือ request structure ไม่ถูกต้อง
Token หาย หมดอายุ หรือไม่ถูกต้อง, API key, signature, request time หรือ one-time identifier ผิด
Client ถูกระบุได้ แต่ไม่มี role, brand, market หรือ permission ที่ต้องใช้
Player, payment, round, KYC check, provider หรือ object อื่นไม่มีอยู่หรือ client ไม่มีสิทธิ์เข้าถึง
เวอร์ชันหรือสถานะของ object เปลี่ยนไป หรือ operation ID ถูกใช้แล้วกับ parameters อื่น
ยอดคงเหลือไม่พอ เกิน limit, player ถูกบล็อก market ถูกห้าม หรือ status transition ไม่ถูกต้อง
จำนวน requests เกิน limit ที่อนุญาตสำหรับ client, method, role หรือ critical operation
External service ไม่พร้อมใช้งาน ตอบช้า หรือไม่รับ operations ชั่วคราว
เกิด platform error ที่ไม่คาดคิด โดยไม่เปิดเผยรายละเอียดภายใน แต่มี identifier สำหรับ diagnostics
Retry จะปลอดภัยต่อเมื่อระบุประเภท error แล้วและตรวจสอบว่า original operation อาจทำสำเร็จไปแล้วหรือไม่
Data, permission และ business rule errors โดยทั่วไปต้องแก้ request ไม่ใช่ส่งซ้ำ
การ retry financial, gaming หรือ critical operation อื่น ต้องไม่สร้างผลลัพธ์ใหม่
เพิ่ม interval ทีละขั้น คำนึงถึงเวลาที่ server ระบุ และจำกัดจำนวน attempts รวม
เมื่อใช้ attempts ครบแล้ว ให้บันทึก operation ว่ายังไม่เสร็จและส่งไป manual review หรือ reconciliation
หาก connection หลุดหลังส่ง request ผลลัพธ์อาจยังไม่ทราบ ก่อน retry ต้องเช็กสถานะด้วย operation ID หรือรอ trusted notification
Diagnostics ควรทำให้ติดตาม request path ระหว่าง platform, adapter และ external provider ได้ โดยไม่เก็บ sensitive data เกินจำเป็น
Test environment ควรจำลอง error category สำคัญทั้งหมดและยืนยันว่า client, retries และ controls ทำงานถูกต้อง
Required fields ที่ขาด, data types ผิด, unsupported values, amount precision และหลาย errors พร้อมกัน
Invalid key, expired token, invalid signature, unauthorized role, blocked IP และ repeated one-time identifier
Connection หลุดก่อนส่ง หลังรับ operation หรือระหว่างรอ final response
HTTP 429, recommended delay, parallel requests และ recovery หลัง limit สิ้นสุด
Unavailable, maintenance, invalid response, delayed notification และ conflicting status
จำกัดจำนวน attempts, เพิ่ม delay, หยุด requests ชั่วคราว, controlled recovery และ manual escalation
Production integration ควร launch หลังตรวจ error structure, client behavior, duplicate protection และ diagnostics
ส่ง HTTP responses ปัจจุบัน, error codes, retry rules และ problematic scenarios มาให้ APIACE จะช่วยกำหนด unified error model, safe recovery และ control