บันทึกโปรโมชั่นฝากที่เลือก
ใช้งานได้PUT
/api/v1/promotions/selectedบันทึกโบนัสฝากที่สมาชิกเลือก (หรือเลือกไม่รับ) — ค่าที่ส่งต้องอยู่ในชุดตัวเลือกล่าสุดจาก deposit-options และระบบตอบสถานะตัวเลือกชุดใหม่กลับมา
ตัวเลือกผูกกับเวลา (นาทีทอง/ฝากแรกของวัน) — เจอ 6003 ให้เรียก deposit-options รีเฟรชรายการก่อนให้สมาชิกเลือกอีกครั้ง
Headers
| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
|---|---|---|---|
| Authorization | string | ใช่ | ใช้ — แนบ Bearer <access_token> ของสมาชิก |
| X-Api-Key | string | ใช่ | API key ของ agent (ak_…) จากหน้า bo |
| X-Timestamp | string | ใช่ | เวลา sign เป็น unix milliseconds (คลาดเคลื่อนได้ ±300 วินาที) |
| X-Nonce | string | ใช่ | ค่าไม่ซ้ำต่อ request (UUIDv4) กัน replay |
| X-Signature | string | ใช่ | hex(HMAC-SHA256(secret, canonical)) — ดูหน้า Authentication |
| X-Player-IP | string | — | IP จริงของผู้เล่น (IPv4/IPv6) — แนะนำให้ส่ง (ใช้ใน login history) |
| X-Player-UA | string | — | User-Agent ของผู้เล่น (optional — ลง login history) |
| X-Request-Id | string | — | correlation id ของฝั่งคุณ — ระบบ echo กลับใน request_uuid (แนะนำให้ส่ง) |
| x-lang | string | — | th (default) หรือ en — ภาษาของ message |
Request bodyapplication/json
| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
|---|---|---|---|
| promotion_id | string | null | — | id โปรโมชั่นจาก options ของ deposit-options — ส่ง null (หรือไม่ส่ง) = ไม่รับโบนัส |
ตัวอย่าง request
{
"promotion_id": "550e8400-e29b-41d4-a716-446655440111"
}Response
ฟิลด์ใน data
| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
|---|---|---|---|
| mode | string | — | โหมดตัวเลือกล่าสุด (ความหมายเดียวกับ deposit-options)forced | choose | none |
| options | object[] | — | รายการโบนัสที่ยังเลือกได้ — โครงเดียวกับ options ใน deposit-options |
| selected_id | string | null | — | ค่าที่เพิ่งบันทึก — null = ไม่รับโบนัส |
ตัวอย่าง response
{
"success": true,
"code": 0,
"message": "สำเร็จ",
"data": {
"mode": "choose",
"options": [
{
"id": "550e8400-e29b-41d4-a716-446655440111",
"type": "FIRST_DEPOSIT",
"name": "ฝากแรกของวันรับเพิ่ม 10%",
"description": "โบนัส 10% สำหรับยอดฝากแรกที่สำเร็จของวัน",
"banner_url": "https://cdn.bestsystem.example/promotions/first-deposit-10.jpg",
"sort_order": 3,
"config": { "percentage": 10, "max_bonus_thb": 300, "min_deposit_thb": 100 },
"time_window": null,
"wager_mode": "TURNOVER",
"wager_multiplier": "3",
"withdraw_cap_thb": null,
"allowed_provider_ids": [],
"allowed_categories": [],
"ends_at": null,
"eligible": true,
"cashback_available_thb": null,
"cashback_claimed_today": false
}
],
"selected_id": "550e8400-e29b-41d4-a716-446655440111"
},
"request_uuid": "e4b0d2c8-7a15-4f39-b6e2-90c3d8a1f574"
}Error codes ที่พบได้
| code | ชื่อ | HTTP | ข้อความ |
|---|---|---|---|
| 6003 | PROMOTION_NOT_ELIGIBLE | 422 | ยังไม่เข้าเงื่อนไขรับโปรโมชั่นpromotion_id ไม่อยู่ในชุดที่เลือกได้ตอนนี้ — เช่น พ้นช่วงนาทีทองไปแล้ว หรือมียอดฝากสำเร็จของวันนี้แล้ว |
| 4001 | VALIDATION_ERROR | 400 | ข้อมูลไม่ถูกต้องpromotion_id ไม่ใช่ string (ถ้าไม่รับโบนัสให้ส่ง null) |
| 1001 | UNAUTHORIZED | 401 | ไม่ได้รับอนุญาต |
| 1007 | TOKEN_INVALID | 401 | โทเค็นไม่ถูกต้อง |