Check Balance
ใช้งานได้POST
{base}/api/balanceดึงยอดคงเหลือล่าสุด
ตอบ HTTP 200 เสมอแม้เป็น business error
Headers
| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
|---|---|---|---|
| X-Api-Key | string | ใช่ | API key ที่ best-system ออกให้ (ตรวจว่าตรงกับของคุณ) |
| X-Signature | string | ใช่ | hex(HMAC-SHA256(secret, raw body)) — verify จาก raw bytes ห้าม re-serialize · ไม่ตรง → ตอบ code 30002 |
Request bodyapplication/json
| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
|---|---|---|---|
| request_id | string | ใช่ | id ของ request นี้ |
| player_username | string | ใช่ | username ผู้เล่นในระบบของคุณ |
| currency | string | ใช่ | สกุลเงินของผู้เล่น ตาม ISO 4217 เช่น THB |
| product_code | string | — | รหัสค่ายเกม (เช่น PGSOFT) |
| timestamp | number | ใช่ | เวลาที่ส่ง (unix ms) |
ตัวอย่าง request
{
"request_id": "9b6ad1a2-5a3f-4d0e-8c7b-1f2e3d4c5b6a",
"player_username": "foobar",
"currency": "THB",
"timestamp": 1783236600000
}Expected Response
ฟิลด์ใน data
| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
|---|---|---|---|
| code | number | ใช่ | 0 = สำเร็จ |
| request_id | string | ใช่ | echo จาก request |
| username | string | ใช่ | player_username |
| currency | string | ใช่ | echo จาก request |
| balance | number | ใช่ | ยอดคงเหลือปัจจุบัน |
| timestamp | number | ใช่ | เวลาที่คุณตอบ (unix ms) |
ตัวอย่าง response
{
"code": 0,
"request_id": "9b6ad1a2-5a3f-4d0e-8c7b-1f2e3d4c5b6a",
"username": "foobar",
"currency": "THB",
"balance": 1000,
"timestamp": 1783236600120
}Error codes ที่พบได้
| code | ชื่อ | HTTP | ข้อความ |
|---|---|---|---|
| 10001 | SEAMLESS_USER_NOT_FOUND | 200 | ไม่พบผู้เล่นในระบบของ agent |
| 30002 | SEAMLESS_INVALID_SIGNATURE | 401 | X-Signature ไม่ถูกต้อง |
| 40003 | SEAMLESS_FORBIDDEN | 200 | ปฏิเสธการเข้าถึง (api-key/IP) |
| 50001 | SEAMLESS_INTERNAL_ERROR | 200 | ข้อผิดพลาดภายในระบบของ agent |