29. Free Spin
ลำดับการใช้งาน: 29.1 ดึง provider → 29.2 ดึงเกมของ provider นั้น (ได้ gameID) → 29.3 แจก free spin → 29.4 เช็คว่าถูกใช้แล้วหรือยัง
29.1 Get Provider Free Spin (Common)
สำหรับ Merchant ดึงรายชื่อ provider ที่รองรับ free spin
Method : [Post]
Path : {{domain}}/ext/getProviderFreeSpin/{{prefix}}/{{agentUsername}}
Content-Type : application/json
Request Body
{
"agentUsername": "{{agentUsername}}",
"key": "{{key}}",
"web": "{{whiteLabel}}"
}
| Key | Type | Example Value | Description |
|---|---|---|---|
| agentUsername | String | testopupapixx | เอเย่นต์ที่ใช้งาน |
| key | String | pbR-P0cnKwLVirSOCvf53 | คีย์ของเอเย่นต์ |
| web | String | sportbook101 | เว็บที่ใช้งาน |
Response
{
"code": 0,
"msg": "SUCCESS",
"data": [
{
"provider": "PGS"
}
]
}
| Key | Type | Example Value | Description |
|---|---|---|---|
| code | Number | 0 | โค้ดผลลัพธ์ของ API |
| msg | String | SUCCESS | คำอธิบายของโค้ด |
| data | Array | [{"provider":"PGS"}] | รายชื่อ provider ที่มี free spin ส่งต่อจาก game service ตามที่ได้รับมา |
*รายชื่อ provider ถูก cache ไว้ 5 นาที ถ้าฝั่ง game service เพิ่ม provider ใหม่ อาจเห็นช้าได้ถึง 5 นาที
Error Code
| Value | msg |
|---|---|
| 0 | Success |
| 100001 | Missing 'agent username' field. |
| 100002 | Agent username is type string. |
| 100003 | Missing 'key' field. |
| 100004 | Key is type string. |
| 100012 | Key not found. |
| 100013 | Agent not found. |
| 998 | System error. |
*โค้ดอื่นนอกจากนี้เป็นของ game service ส่งกลับมาตรง ๆ พร้อมข้อความของเขาเอง
29.2 Get Free Spin Games (Common)
สำหรับ Merchant ดึงรายชื่อเกมของ provider ที่แจก free spin ได้ เอา gameID จากรายการนี้ไปใส่เป็น gameId ตอน Create Free Spin
Method : [Post]
Path : {{domain}}/ext/getFreeSpinGames/{{prefix}}/{{agentUsername}}
Content-Type : application/json
Request Body
{
"agentUsername": "{{agentUsername}}",
"key": "{{key}}",
"provider": "L22",
"web": "{{whiteLabel}}"
}
| Key | Type | Example Value | Description |
|---|---|---|---|
| agentUsername | String | testopupapixx | เอเย่นต์ที่ใช้งาน |
| key | String | pbR-P0cnKwLVirSOCvf53 | คีย์ของเอเย่นต์ |
| provider | String | L22 | รหัส provider ที่ได้จาก Get Provider Free Spin บังคับส่ง |
| web | String | sportbook101 | เว็บที่ใช้งาน |
Response
{
"code": 0,
"msg": "SUCCESS",
"data": [
{
"gameID": "66053e460b0139746d384980",
"gameName": {
"en": "Apes Squad",
"th": "",
"cn": "猿人突击队",
"la": "",
"id": "",
"vn": "",
"my": "",
"mm": "",
"kh": "",
"tw": ""
},
"image": {
"vertical": "https://ambimgcdn2.co/img/sportsbook/game/L22/L22_Apes%20Squad.webp",
"horizontal": "https://ambimgcdn2.co/img/sportsbook/game/L22/L22_Apes%20Squad.webp",
"square": "https://ambimgcdn2.co/img/sportsbook/game/L22/L22_Apes%20Squad.jpg"
}
}
]
}
| Key | Type | Example Value | Description |
|---|---|---|---|
| code | Number | 0 | โค้ดผลลัพธ์ของ API |
| msg | String | SUCCESS | คำอธิบายของโค้ด |
| data | Array | [{...}] | รายชื่อเกมที่แจก free spin ได้ ส่งต่อจาก game service ตามที่ได้รับมา |
| data[].gameID | String | 66053e460b0139746d384980 | game id เอาไปใส่เป็น gameId ตอน Create Free Spin |
| data[].gameName | Object | {"en":"Apes Squad",...} | ชื่อเกมแยกตามภาษา: en, th, cn, la, id, vn, my, mm, kh, tw ภาษาที่ provider ไม่ได้ใส่จะเป็น "" |
| data[].image | Object | {"vertical":"https://...",...} | รูปเกม: vertical, horizontal, square |
*เกมที่ฝั่ง game service ซ่อนไว้จะไม่ถูกส่งกลับมา
*รายชื่อเกมไม่มี cache ดึงจาก game service ใหม่ทุกครั้ง
Error Code
| Value | msg |
|---|---|
| 0 | Success |
| 100001 | Missing 'agent username' field. |
| 100002 | Agent username is type string. |
| 100003 | Missing 'key' field. |
| 100004 | Key is type string. |
| 100012 | Key not found. |
| 100013 | Agent not found. |
| 100015 | Invalid input format 'provider' field. |
| 998 | System error. |
*100015 คือไม่ได้ส่ง provider หรือ provider ไม่ใช่ string พร้อม error_filed เป็น "provider"
*provider ที่ไม่รองรับ free spin จะได้ code 9901 จาก game service
*โค้ดอื่นนอกจากนี้เป็นของ game service ส่งกลับมาตรง ๆ พร้อมข้อความของเขาเอง
29.3 Create Free Spin (Common)
สำหรับ Merchant แจก free spin ให้สมาชิก
Method : [Post]
Path : {{domain}}/ext/createFreeSpin/{{prefix}}/{{agentUsername}}
Content-Type : application/json
Request Body
{
"agentUsername": "{{agentUsername}}",
"key": "{{key}}",
"username": "{{agentUsername}}ninemb01",
"transactionId": "FS-20260914-0001",
"gameId": "60531c5534d88c344ce9acb2",
"betAmount": 1,
"freeSpinCount": 10,
"web": "{{whiteLabel}}"
}
| Key | Type | Example Value | Description |
|---|---|---|---|
| agentUsername | String | testopupapixx | เอเย่นต์ที่ใช้งาน |
| key | String | pbR-P0cnKwLVirSOCvf53 | คีย์ของเอเย่นต์ |
| username | String | testopupapixxninemb01 | สมาชิกที่จะได้รับ free spin ต้องเป็นสมาชิกตรงของเอเย่นต์ที่ยิงเข้ามา |
| transactionId | String | FS-20260914-0001 | เลขอ้างอิงของ merchant ใช้ค้น log ภายหลังได้ |
| gameId | String | 60531c5534d88c344ce9acb2 | เกมที่จะแจก free spin ดึงได้จาก Get Free Spin Games |
| betAmount | Number | 1 | เงินเดิมพันต่อสปิน ต้องมากกว่า 0 |
| freeSpinCount | Number | 10 | จำนวนสปิน ต้องมากกว่า 0 |
| web | String | sportbook101 | เว็บที่ใช้งาน |
*ไม่รับ minAmount และ maxAmount ระบบฟิกไว้ที่ 0 และ 100000
*เกม PG Soft มี game id สองชุด ส่งชุดไหนมาก็ได้ ระบบจะแปลงให้ตรงกับชุดของสมาชิกก่อนส่งต่อ game service
Response
{
"code": 0,
"msg": "SUCCESS",
"data": {}
}
| Key | Type | Example Value | Description |
|---|---|---|---|
| code | Number | 0 | โค้ดผลลัพธ์ของ API |
| msg | String | SUCCESS | คำอธิบายของโค้ด |
| data | Object | {} | ผลลัพธ์ที่ส่งต่อจาก game service ตามที่ได้รับมา |
Error Code
| Value | msg |
|---|---|
| 0 | Success |
| 100001 | Missing 'agent Username' field. |
| 100002 | Agent username is type string. |
| 100003 | Missing 'key' field. |
| 100004 | Key is type string. |
| 100005 | Missing 'username' field. |
| 100006 | Username is type string. |
| 100007 | Missing 'transactionId' field. |
| 100008 | TransactionId is type string. |
| 100010 | Missing 'gameId' field. |
| 100011 | GameId is type string. |
| 100012 | Key not found. |
| 100013 | Agent not found. |
| 100015 | Invalid input format 'betAmount' field. |
| 100015 | Invalid input format 'freeSpinCount' field. |
| 5044 | Permission denied |
| 998 | System error. |
*5044 คือไม่มี username นี้ หรือสมาชิกไม่ใช่สมาชิกตรงของเอเย่นต์ที่ยิงเข้ามา
*โค้ดอื่นนอกจากนี้เป็นของ game service ส่งกลับมาตรง ๆ พร้อมข้อความของเขาเอง
29.4 Get Free Spin Logs (Common)
สำหรับ Merchant เช็ค free spin ที่แจกไปแล้วว่ายังไม่ถูกใช้ (pending) หรือใช้ไปแล้ว (used)
Method : [Post]
Path : {{domain}}/ext/getFreeSpinLogs/{{prefix}}/{{agentUsername}}
Content-Type : application/json
Request Body
{
"agentUsername": "{{agentUsername}}",
"key": "{{key}}",
"transactionId": "FS-20260914-0001",
"username": "{{agentUsername}}ninemb01",
"provider": "PGS",
"status": "pending",
"page": 1,
"limit": 20,
"web": "{{whiteLabel}}"
}
| Key | Type | Example Value | Description |
|---|---|---|---|
| agentUsername | String | testopupapixx | เอเย่นต์ที่ใช้งาน |
| key | String | pbR-P0cnKwLVirSOCvf53 | คีย์ของเอเย่นต์ |
| transactionId | String | FS-20260914-0001 | ไม่บังคับ เลขอ้างอิงที่ส่งตอนแจก free spin ใส่แล้วได้เฉพาะก้อนนั้น |
| username | String | testopupapixxninemb01 | บังคับ สมาชิกที่ต้องการดู log ต้องเป็นสมาชิกตรงของเอเย่นต์ที่ยิงเข้ามา |
| provider | String | PGS | ไม่บังคับ PGS / FC / PG |
| status | String | pending | ไม่บังคับ ใส่ได้แค่ pending หรือ used |
| page | Number | 1 | ไม่บังคับ ต้องเป็นจำนวนเต็ม (ทศนิยมถูกปัดลง) น้อยกว่า 1 จะกลายเป็น 1 ค่าเริ่มต้น 1 |
| limit | Number | 20 | ไม่บังคับ ต้องเป็นจำนวนเต็ม (ทศนิยมถูกปัดลง) น้อยกว่า 1 เป็น 20 มากกว่า 100 เป็น 100 ค่าเริ่มต้น 20 |
| web | String | sportbook101 | เว็บที่ใช้งาน |
*username บังคับส่ง ดู log ได้เฉพาะสมาชิกตรงของเอเย่นต์ที่ยิงเข้ามา ถ้าต้องการดูหลายคนให้ยิงทีละคน ตัวกรองที่เหลือไม่บังคับ
Response
{
"code": 0,
"msg": "SUCCESS",
"data": [
{
"transactionID": "FS-20260914-0001",
"username": "testopupapixxninemb01",
"provider": "PGS",
"status": "pending"
}
]
}
| Key | Type | Example Value | Description |
|---|---|---|---|
| code | Number | 0 | โค้ดผลลัพธ์ของ API |
| msg | String | SUCCESS | คำอธิบายของโค้ด |
| data | Array | [{...}] | log free spin ที่ส่งต่อจาก game service ตามที่ได้รับมา |
Error Code
| Value | msg |
|---|---|
| 0 | Success |
| 100001 | Missing 'agent username' field. |
| 100002 | Agent username is type string. |
| 100003 | Missing 'key' field. |
| 100004 | Key is type string. |
| 100005 | Missing 'username' field. |
| 100006 | Username is type string. |
| 100008 | TransactionId is type string. |
| 100012 | Key not found. |
| 100013 | Agent not found. |
| 100015 | Invalid input format 'provider' field. |
| 100015 | Invalid input format 'status' field. |
| 100015 | Invalid input format 'page' field. |
| 100015 | Invalid input format 'limit' field. |
| 5044 | Permission denied |
| 998 | System error. |
*5044 คือไม่มี username นี้ หรือสมาชิกไม่ใช่สมาชิกตรงของเอเย่นต์ที่ยิงเข้ามา
*status ใส่ได้แค่ pending หรือ used ค่าอื่นจะตอบ 100015 พร้อม error_filed เป็น "status"
*โค้ดอื่นนอกจากนี้เป็นของ game service ส่งกลับมาตรง ๆ พร้อมข้อความของเขาเอง