บันทึกโปรโมชั่นฝากที่เลือก

ใช้งานได้
PUT/api/v1/promotions/selected

บันทึกโบนัสฝากที่สมาชิกเลือก (หรือเลือกไม่รับ) — ค่าที่ส่งต้องอยู่ในชุดตัวเลือกล่าสุดจาก deposit-options และระบบตอบสถานะตัวเลือกชุดใหม่กลับมา

ตัวเลือกผูกกับเวลา (นาทีทอง/ฝากแรกของวัน) — เจอ 6003 ให้เรียก deposit-options รีเฟรชรายการก่อนให้สมาชิกเลือกอีกครั้ง

Headers

ฟิลด์ชนิดจำเป็นคำอธิบาย
Authorizationstringใช่ใช้ — แนบ Bearer <access_token> ของสมาชิก
X-Api-Keystringใช่API key ของ agent (ak_…) จากหน้า bo
X-Timestampstringใช่เวลา sign เป็น unix milliseconds (คลาดเคลื่อนได้ ±300 วินาที)
X-Noncestringใช่ค่าไม่ซ้ำต่อ request (UUIDv4) กัน replay
X-Signaturestringใช่hex(HMAC-SHA256(secret, canonical)) — ดูหน้า Authentication
X-Player-IPstring—IP จริงของผู้เล่น (IPv4/IPv6) — แนะนำให้ส่ง (ใช้ใน login history)
X-Player-UAstring—User-Agent ของผู้เล่น (optional — ลง login history)
X-Request-Idstring—correlation id ของฝั่งคุณ — ระบบ echo กลับใน request_uuid (แนะนำให้ส่ง)
x-langstring—th (default) หรือ en — ภาษาของ message

Request bodyapplication/json

ฟิลด์ชนิดจำเป็นคำอธิบาย
promotion_idstring | null—id โปรโมชั่นจาก options ของ deposit-options — ส่ง null (หรือไม่ส่ง) = ไม่รับโบนัส
ตัวอย่าง request
{
  "promotion_id": "550e8400-e29b-41d4-a716-446655440111"
}

Response

ฟิลด์ใน data

ฟิลด์ชนิดจำเป็นคำอธิบาย
modestring—โหมดตัวเลือกล่าสุด (ความหมายเดียวกับ deposit-options)forced | choose | none
optionsobject[]—รายการโบนัสที่ยังเลือกได้ — โครงเดียวกับ options ใน deposit-options
selected_idstring | 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ข้อความ
6003PROMOTION_NOT_ELIGIBLE422ยังไม่เข้าเงื่อนไขรับโปรโมชั่นpromotion_id ไม่อยู่ในชุดที่เลือกได้ตอนนี้ — เช่น พ้นช่วงนาทีทองไปแล้ว หรือมียอดฝากสำเร็จของวันนี้แล้ว
4001VALIDATION_ERROR400ข้อมูลไม่ถูกต้องpromotion_id ไม่ใช่ string (ถ้าไม่รับโบนัสให้ส่ง null)
1001UNAUTHORIZED401ไม่ได้รับอนุญาต
1007TOKEN_INVALID401โทเค็นไม่ถูกต้อง