# 3.5 Call Back Service
*Please keep all of 'Call Back Service' confidentially.
- Optional production security
You can also whitelist IP on the production environment. If need, please request our NAT IP to do whitelist. - *Remark: Our retry times, 5mins > 10mins > 15mins within 24 hours. You can stop retry by return this code. All retry will depends on which API.
# 3.5.1 GetUserBalance
When a player enters the homepage or other pages, the Pretty Gaming system sends a request to obtain the amount of the actual player balance.
# Request Body
| Parameter | Type | Description |
|---|---|---|
| service | String | Fixed value"GetUserBalance" |
| data | Object | Object response. |
| playerApiId | String | |
| playerApiUsername | String | Player username from Pretty Gaming system. |
| playerUsername | String | Player username from partner system. |
| requestDate | String | System request date. format(YYYY-MM-DD HH:mm:ss) |
# Example Request Body
{
"service": "GetUserBalance",
"data": {
"playerApiId": "5eae90e32f7df02c92fde32d",
"playerApiUsername": "startseamlessmember@startapiseamless",
"playerUsername": "startseamlessmember",
"requestDate": "2020-05-03 19:16:47"
}
}
2
3
4
5
6
7
8
9
# Response Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| code | Number | Yes | Result Code Reference. |
| balance | Number | Yes |
# Service Response Code
| Parameter | Description |
|---|---|
| 0 | SUCCESS |
| 911008 | Player not found. |
| 911009 | Bad parameters. |
# Example Service Respond Code
{
"code": 0,
"balance": 100000
}
2
3
4
# 3.5.2 UserPlaceBet
When a player places a bet, the Pretty Gaming system sends a request UserPlaceBet to the partner's system. The request will be timed out after 4 seconds and PlaceBetCancel will be sent.
# Request Body
| Parameter | Type | Description |
|---|---|---|
| service | String | Fixed value"UserPlaceBet" |
| data | Object | Object response. |
| playerId | String | Player identity form Pretty Gaming system. |
| playerApiUsername | String | Player username from Pretty Gaming system. |
| playerUsername | String | Player username from partner system. |
| ticketId | String | User bet group record from one submit. |
| type | String | Bet type = Baccarat, 4Point, Super6, CowCow, DragonTiger, Roulette, SicBo, Step |
| currency | String | Standard ISO 3-character currency unit eg: CNY/USD/EUR . currency list |
| gameId | Number | GameID |
| totalBetAmt | Number | User bet amount. |
| totalPayOutAmt | Number | totalPayOutAmt equals 0 when a player loses but not in every game, for example, if a player places a bet in dragon tiger then he loses half of the bet amount (when bets 100, then totalPayOutAmt equals 50). |
| winLoseTurnOver | Number | Member win/lose turnover. |
| txtList | arrayobject | List of bet position. |
| txtId | String | Transaction id of bet position. |
| commissionRate | Number | Commission Rate. |
| payOutRate | Number | Rate payout when member win. |
| betPosition | String | Bet position. |
| betAmt | Number | Bet amount of this reccord. |
| payOutAmt | Number | Payout amount of this reccord. |
| status | String | SuccessfulPayment,SuccessfulBet, Pending, Canceled. |
| createDate | String | The date the bet was placed. format(YYYY-MM-DD HH:mm:ss) |
| requestDate | String | System request date. format(YYYY-MM-DD HH:mm:ss) |
# Example Request Body
{
"service": "UserPlaceBet",
"data": {
"playerId": "5eae90e32f7df02c92fde32d",
"playerApiUsername": "startseamlessmember",
"playerUsername": "startseamlessmember",
"ticketId": "1004718",
"type": "Baccarat",
"currency": "THB",
"gameId": 146826,
"totalBetAmt": -1400,
"totalPayOutAmt": 0,
"winLoseTurnOver": 0,
"txtList": [
{
"txtId": "5eaec8cdb9fe9212c6bd8aa5",
"commissionRate": 0,
"payOutRate": 1.95,
"betPosition": "banker",
"betAmt": -500,
"payOutAmt": 0
},
{
"txtId": "5eaec8cdb9fe9212c6bd8aa9",
"commissionRate": 0,
"payOutRate": 4.5,
"betPosition": "bankerNatural",
"betAmt": -500,
"payOutAmt": 0
},
{
"txtId": "5eaec8cdb9fe9212c6bd8aad",
"commissionRate": 0,
"payOutRate": 12,
"betPosition": "bankerPair",
"betAmt": -200,
"payOutAmt": 0
},
{
"txtId": "5eaec8cdb9fe9212c6bd8dec",
"commissionRate": 0,
"payOutRate": 1.5,
"betPosition": "big",
"betAmt": -200,
"payOutAmt": 0
}
],
"status": "Pending",
"createDate": "2020-05-03 20:36:13",
"requestDate": "2020-05-03 20:36:13"
}
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Response Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| code | Number | Yes | Result Code Reference. |
# Service Response Code
| Parameter | Description |
|---|---|
| 0 | SUCCESS |
| 911000 | Bet Limit exceeded. |
| 911001 | Insufficient balance. |
| 911002 | Account is Suspend. |
| 911004 | Session expired. |
| 911005 | Bet failed. Please try again. |
| 911006 | The game is under maintenance. |
| 911007 | You are not allowed to play this game. |
| 911008 | Player not found. |
| 911009 | Bad parameters. |
| 911010 | Account is locked. |
# Example Service Respond Code
{
"code": 0
}
2
3
# 3.5.3 UserPlaceBetCancel
When previous PlaceBet is failed due to timeout or partner system error.Partner system should refund the user if the transaction has been done in the partner system side.If there are timeout or error, the request will be retried after n seconds within m tries.An expired request will move to the unsuccessful transaction list for back office to further process.Those unsuccessful transactions can be retry by the operator through the back office.
# Request Body
| Parameter | Type | Description |
|---|---|---|
| service | String | Fixed value"UserPlaceBetCancel" |
| data | Object | Object response. |
| playerId | String | Player identity form Pretty Gaming system. |
| playerApiUsername | String | Player username from Pretty Gaming system. |
| playerUsername | String | Player username from partner system. |
| ticketId | String | User bet group record from one submit. |
| type | String | Bet type = Baccarat, 4Point, Super6, CowCow, DragonTiger, Roulette, SicBo, Step |
| currency | String | Standard ISO 3-character currency unit eg: CNY/USD/EUR . currency list |
| gameId | Number | GameID |
| totalBetAmt | Number | User bet amount. |
| totalPayOutAmt | Number | totalPayOutAmt equals 0 when a player loses but not in every game, for example, if a player places a bet in dragon tiger then he loses half of the bet amount (when bets 100, then totalPayOutAmt equals 50). |
| winLoseTurnOver | Number | Member win/lose turnover. |
| txtList | arrayobject | List of bet position. |
| txtId | String | Transaction id of bet position. |
| commissionRate | Number | Commission Rate. |
| payOutRate | Number | Rate payout when member win. |
| betPosition | String | Bet position. |
| betAmt | Number | Bet amount of this reccord. |
| payOutAmt | Number | Payout amount of this reccord. |
| status | Object | SuccessfulPayment,SuccessfulBet, Pending, Canceled. |
| createDate | String | The date the bet was placed. format(YYYY-MM-DD HH:mm:ss) |
| requestDate | String | System request date. format(YYYY-MM-DD HH:mm:ss) |
# Example Request Body
{
"service": "UserPlaceBetCancel",
"data": {
"playerId": "5eae90e32f7df02c92fde32d",
"playerApiUsername": "'startseamlessmember,",
"playerUsername": "startseamlessmember",
"ticketId": "1004718",
"type": "Baccarat",
"currency": "THB",
"gameId": 146826,
"totalBetAmt": -1400,
"totalPayOutAmt": 0,
"winLoseTurnOver": 0,
"txtList": [
{
"txtId": "5eaec8cdb9fe9212c6bd8aa5",
"commissionRate": 0,
"payOutRate": 1.95,
"betPosition": "banker",
"betAmt": -500,
"payOutAmt": 0
},
{
"txtId": "5eaec8cdb9fe9212c6bd8aa9",
"commissionRate": 0,
"payOutRate": 4.5,
"betPosition": "bankerNatural",
"betAmt": -500,
"payOutAmt": 0
},
{
"txtId": "5eaec8cdb9fe9212c6bd8aad",
"commissionRate": 0,
"payOutRate": 12,
"betPosition": "bankerPair",
"betAmt": -200,
"payOutAmt": 0
},
{
"txtId": "5eaec8cdb9fe9212c6bd8dec",
"commissionRate": 0,
"payOutRate": 1.5,
"betPosition": "big",
"betAmt": -200,
"payOutAmt": 0
}
],
"status": "Canceled",
"createDate": "2020-05-03 20:36:13",
"requestDate": "2020-05-03 20:36:13"
}
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Response Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| code | Number | Yes | Result Code Reference. |
# Service Response Code
| Parameter | Description |
|---|---|
| 0 | SUCCESS (stop retry). |
| 51101 | Duplicate Transaction (stop retry). |
| 51102 | Transaction not found. |
| 911009 | Bad parameters. |
# Example Service Respond Code
{
"code": 0
}
2
3
# 3.5.4 UserPlacePayout
This interface will be called after the platform pays, and the member's bet will be returned to the third-party system in time. If the call times out or does not receive a response, the system will re-call every minute until it succeeds.
# Request Body
| Parameter | Type | Description |
|---|---|---|
| service | String | Fixed value"UserPlacePayout" |
| data | Object | Object response. |
| playerId | String | Player identity form Pretty Gaming system. |
| playerApiUsername | String | Player username from Pretty Gaming system. |
| playerUsername | String | Player username from partner system. |
| ticketId | String | User bet group record from one submit. |
| type | String | Bet type = Baccarat, 4Point, Super6, CowCow, DragonTiger, Roulette, SicBo, Step |
| currency | String | Standard ISO 3-character currency unit eg: CNY/USD/EUR . currency list |
| gameId | Number | GameID |
| totalBetAmt | Number | User bet amount. |
| totalPayOutAmt | Number | totalPayOutAmt equals 0 when a player loses but not in every game, for example, if a player places a bet in dragon tiger then he loses half of the bet amount (when bets 100, then totalPayOutAmt equals 50). |
| winLoseTurnOver | Number | Member win/lose turnover. |
| txtList | arrayobject | List of bet position. |
| txtId | String | Transaction id of bet position. |
| commissionRate | Number | Commission Rate. |
| payOutRate | Number | Rate payout when member win. |
| betPosition | String | Bet position. |
| betAmt | Number | Bet amount of this reccord. |
| payOutAmt | Number | Payout amount of this reccord. |
| status | Object | SuccessfulPayment,SuccessfulBet, Pending, Canceled. |
| result | arrayobject | |
| rsDr | Object | Dragon Tiger result (raw cards) Contains: dragon (card), dragon_tt (total), tiger (card), tiger_tt (total) |
| rsBc | Object | Baccarat result (raw cards) Contains: banker_1, banker_2, banker_3, banker123 (total), player_1, player_2, player_3, player123 (total) |
| rsRu | Number | Roulette result The number that was hit. null if not a Roulette round. |
| rsSic | Number | SicBo / ThaiHiLo / ThaiFanTan result Encoded dice values. null if not a SicBo round. |
| winBc | array | Baccarat winning positions Array of positions that won. e.g. ["banker", "tie", "bp"] Used for: Baccarat, 4Point, Super6, CowCow |
| winDr | Number | Dragon Tiger winner Single string e.g. "dragon", "tiger", "tie". null if not played. |
| winRu | Number | Roulette winning positions Array of all positions that won. e.g. ["17", "red", "odd", "b1to18"] |
| winSic | Object | SicBo / ThaiHiLo / ThaiFanTan winning positions Array of winning positions. Used for SicBo, MegaSicBo, ThaiHiLo,ThaiFanTan. |
| resultLink | String | |
| createDate | String | The date the bet was placed. format(YYYY-MM-DD HH:mm:ss) |
| requestDate | String | System request date. format(YYYY-MM-DD HH:mm:ss) |
*Remark: If "type": "Step", Please use only "totalPayOutAmt" field.
# Example Request Body
{
"service": "UserPlacePayout",
"data": {
"playerId": "5eae90e32f7df02c92fde32d",
"playerApiUsername": "startseamlessmember@startapiseamless",
"playerUsername": "startseamlessmember",
"ticketId": "1004831",
"type": "Baccarat",
"currency": "THB",
"gameId": 147846,
"totalBetAmt": -10000,
"totalPayOutAmt": 10000,
"winLoseTurnOver": 0,
"txtList": [
{
"txtId": "5eafdb00a875b774c30fffce",
"commissionRate": 0,
"payOutRate": 1,
"betPosition": "banker",
"betAmt": -10000,
"payOutAmt": 10000
}
],
"status": "SuccessfulPayment",
"result": {
"rsBc": [
"Object"
],
"rsDr": [
"Object"
],
"rsRu": null,
"rsSic": null,
"winBc": [
"Array"
],
"winDr": null,
"winRu": null,
"winSic": []
},
"resultLink": "https://status-dev.hippo168.com/?gameId=28682527&id=xxxxxxxxx&mid=xxxxxxxxxxxxxxxxxxxxxxxx",
"createDate": "2020-05-04 16:04:43",
"requestDate": "2020-05-04 16:06:08"
}
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Response Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| code | Number | Yes | Result Code Reference. |
# Service Response Code
| Parameter | Description |
|---|---|
| 0 | SUCCESS |
| 51101 | Duplicate Transaction (no return). |
| 911009 | Bad parameters. |
# Example Service Respond Code
{
"code": 0
}
2
3
# 3.5.5 Response Code
# Pretty Gaming API Response
| Parameter | Description |
|---|---|
| 71001 | missing filed 'agentUsername'. |
| 71002 | missing filed 'agentApiKey'. |
| 71003 | Invalid agentUsername or apiKey. |
| 71004 | Invalid agentUsername or apiKey. |
| 71005 | playerUsername must be between 4 and 24 characters long , error_filed:"playerUsername". |
| 71006 | username must not contain any special characters and can only contain letters a-z and numbers 0-9. |
| 71007 | invalid bet limit id. |
| 71008 | System detects double request bets. Please wait 1 minute to proceed again. |
| 71009 | Bet below the limit. |
| 71010 | Bet more than the limit. |
| 71011 | Game ID not found. |
| 71012 | No more bets. |
| 71013 | Up line amount is not enough to accept your bet. Please contact your up line. |
| 71014 | Invalid request body. |
| 71015 | Can request up to 5 times per minute. |
| 71016 | Can request up to 15 times per minute. |
| 71017 | Can request up to 30 times per minute. |