TECHNICAL GUIDE€¦ · Roulette bet limit. 2019/03/04 3.0.6 Baccarat table ID 611, 612 and 613...
Transcript of TECHNICAL GUIDE€¦ · Roulette bet limit. 2019/03/04 3.0.6 Baccarat table ID 611, 612 and 613...
TECHNICAL GUIDE Web Service API
Version 3.0.6 The information presented herein this document is Confidential Information of SA Gaming created and owned by SA Gaming and is also protected by copyright and applicable laws. Unauthorised use, copying, transmission and disclosure of such information to any person is strictly prohibited without SA Gaming’s prior written consent. In the absence of any specific agreement to the contrary, reverse engineering, recompilation and disassembly are prohibited in any event as to any information or software content/materials provided by SA Gaming. While all efforts have been made to ensure that the content of this document is accurate at the time of publication, the data upon which this document is based is subject to future change at the sole and discretion of SA Gaming. Updated version of this document will be released when necessary, resources permitting.
TECHNICAL GUIDE
Content 1. Introduction 5
2. Version 5
3. API Calling Restriction Information 6 Accuracy of point value 6
4. Encryption Procedures 6 Encryption Requirements 6 Encryption Procedures 8 Example to call API 8 Error handling 10
5. Web service interface 11 User Account Manipulation 11
RegUserInfo 11 VerifyUsername 12 GetUserStatusDV 13 QueryBetLimit 15 SetBetLimit 16 GetUserMaxBalance 17 SetUserMaxBalance 18 SetUserMaxWinning 18
Login Access 19 LoginRequest 19 LoginRequestForFun 22 KickUser 24
Bet Records Query 24 GetAllBetDetailsDV 25
BetDetail structure 25 GetAllBetDetailsForTimeIntervalDV 27 GetAllBetDetailsFor30secondsDV 28 GetUserBetItemDV 29 GetUserBetAmountDV 31 GetUserWinLost 33 GetTransactionDetails 34 GetFishermenGoldBetDetails 34
Miscellaneous Functions 37 SlotJackpotQuery 37
Copyright © SA Gaming 2019 All right reserved 2/84
TECHNICAL GUIDE
Transfer Wallet 38 DebitBalanceDV 38 DebitAllBalanceDV 39 CreditBalanceDV 40 CheckOrderId 41
6. Seamless Wallet Integration 42 Introduction 42 Workflow 42 Seamless Wallet Protocol 43
Encryption procedures 44 ASP.Net version 44 PHP version 44
POST 45 Response data 45
GetUserBalance 46 Fund Transfer 47
PlaceBet 47 PlayerWin 50 PlayerLost 52 PlaceBetCancel 53
Important notice 56 Error code list 56
7. Error message code reference 57
8. Game Launching Procedures 59 Live Game 59 EGame 60 Fishermen Gold 61
9. UserBetItem 62 GameType 63 Baccarat 63
GameResult of Baccarat 63 CardDetail 63 BetType for Baccarat 64 ResultDetail for Baccarat 65
Dragon Tiger 65 GameResult of Dragon Tiger 65 BetType for Dragon Tiger 66
Copyright © SA Gaming 2019 All right reserved 3/84
TECHNICAL GUIDE
ResultDetail for Dragon Tiger 66 Sic Bo 67
GameResult of Sic Bo 67 BetType for Sic Bo 67 ResultDetail for Sic Bo 69
Fan Tan 73 GameResult of Fan Tan 73 BetType for Fan Tan 73 ResultDetail for Fan Tan 74
Roulette 75 GameResult of Roulette 76 BetType for Roulette 76 ResultDetail for Roulette 78
Multiplayer games 81 Fishermen Gold 81
10. Host ID to Game mapping 82
11. EGame ID/Game Code to Game mapping 83
12. Supported currencies 83
Copyright © SA Gaming 2019 All right reserved 4/84
TECHNICAL GUIDE
1. Introduction
The Web Service API interface is for accessing the SA Gaming Platform. Including user registration, user balance query, user betting records and charging to or withdraw from a user account. This document includes both Transfer Wallet and Seamless Wallet.
2. Version
Version Description Date
3.0.0 ● Reorganize the API functions ● Added seamless wallet API requirement ● EGame launching support more languages ● Fishing game support more languages ● Remove unused bet types of Baccarat and added
Cow Cow Tie bet type ● Added option to hide fishing game icon ● Support GET method to launch live game client
2018/02/09
3.0.1 ● Added new error code 151 ● Added new seamless wallet error code 1007 ● LoginRequest updated to support Live game,
EGame, Fishing and PvP game
2018/03/08
3.0.2 ● Added new HostId field in the seamless wallet requests
● Fishing game support more languages ● Added new currencies ● Update the name of SuperSix Baccarat’s bet type to
NC. Baccarat ● Removal of Mobile standard
2018/05/14
3.0.3 ● Update Baccarat bet types ● Remove PvP game: Liar Dice
2018/06/21
3.0.4 ● Change API function naming: ○ GetUserMaxWin to GetUserMaxBalance ○ SetUserMaxWin to SetUserMaxBalance
● Added Important notice in Seamless Wallet Integration
● Added new API function GetFishermenGoldBetDetails to query details of one fishing game session
● Remove EGameLoginRequest and AnimatedGameLoginRequest
2018/09/19
Copyright © SA Gaming 2019 All right reserved 5/84
TECHNICAL GUIDE
3.0.5 ● Adjust the naming of different Integer (8/16/32/64bit). ● Change LoginRequest's GameURL to include all
necessary parameters, no need to append unless you need to customize it.
● NEW API: SetUserMaxWinning: A function to limit the player's maximum winning amount per day.
● NEW PARAMETERS: "MaxWinning" and “MaxBalance” were added to GetUserStatusDV's response.
● Added Gametype parameter in SetBetLimit to set Roulette bet limit.
2019/03/04
3.0.6 ● Baccarat table ID 611, 612 and 613 will change to 619, 620 and 621. If you use defaulttable to enter those tables, you have to change the table ID.
2019/04/15
3. API Calling Restriction Information
The following APIs have calling restriction.
Name of API Frequency of calls
GetAllBetDetailsDV Every 5 minutes no more than 5 calls
GetAllBetDetailsFor30secondsDV Every 30 seconds no more than 2 calls
GetAllBetDetailsForTimeIntervalDV Every 5 minutes no more than 5 calls
SlotJackpotQuery Every 1 minute no more than 1 call
Accuracy of point value
The accuracy of all point value is limited two decimal place. For example: 1000.23, 89.32, 1002304.89
4. Encryption Procedures
Copyright © SA Gaming 2019 All right reserved 6/84
TECHNICAL GUIDE
4.1 Encryption Requirements
All of the web service queries require DES encryption and MD5 hashing before sending to ensure the content has no modification during transmission. Please ask us for the following information:
1. Secret Key 2. EncrypKey 3. MD5Key 4. API url 5. Client loader 6. Lobby name (supplied during startup the client)
Example DES Encrypt function: protected byte [] EncryptKey = ASCIIEncoding .ASCII.GetBytes( "ask_us_for_key" );
public string DESEncrypt( string inString)
{
MemoryStream ms = new MemoryStream ();
CryptoStream cs = new CryptoStream (ms, new
DESCryptoServiceProvider ().CreateEncryptor(EncryptKey, EncryptKey),
CryptoStreamMode .Write);
StreamWriter sw = new StreamWriter (cs);
sw.Write(inString);
sw.Flush();
cs.FlushFinalBlock();
sw.Flush();
return Convert.ToBase64String(ms.GetBuffer(), 0, ( int )ms.Length);
}
DES Encrypt function in PHP <?php
class DES
{
var $key;
var $iv;
function DES( $key, $iv=0 ) {
$this->key = $key;
if( $iv == 0 ) {
$this->iv = $key;
} else {
$this->iv = $iv;
}
}
function encrypt($str) {
return base64_encode( openssl_encrypt($str, 'DES-CBC', $this->key, OPENSSL_RAW_DATA,
$this->iv ) );
}
}
?>
Example in PHP
Copyright © SA Gaming 2019 All right reserved 7/84
TECHNICAL GUIDE
<?php
$str =
"method=GetUserStatus&Key=01234567789ABCDEF0123456789ABCDE&Time=20150101012345&Username=abcd
12345"; // for example
$key = 'ZyXw4321'; // for example
$crypt = new DES($key);
$mstr = $crypt->encrypt($str);
$urlemstr = urlencode($mstr);
echo "[ $str ] Encrypted: [ $mstr ] UrlEncoded encrypted string: [ $urlemstr ]";
?>
Example MD5 function: public string BuildMD5( string inString)
{
byte [] hashed = MD5 .Create().ComputeHash( Encoding .UTF8.GetBytes(inString));
StringBuilder sb = new StringBuilder (hashed.Length * 2);
for ( int i = 0; i < hashed.Length; i++)
{
sb.Append(hashed[i].ToString( "x2" ));
}
return sb.ToString();
}
Example in PHP <?php
$str =
"method=GetUserStatus&Key=01234567789ABCDEF0123456789ABCDE&Time=20150101012345&Username=abcd
12345"; // for example
$md5key = "abcdefg"; // for example
$Time = "20150101012345"; // for example
$SecretKey = "01234567789ABCDEF0123456789ABCDE"; // for example
$PreMD5Str = $str . $md5key . $Time . $SecretKey;
$OutMD5 = md5($PreMD5str);
echo "md5:[ $OutMD5 ]";
?>
4.2 Encryption Procedures
1. Construct a Query String (QS) with required parameters (including the web service
method name itself (e.g. method=RegUserInfo)
2. DES encrypt the Query String with the supplied EncryptKey and obtain the encrypted
query string (q)
3. Build a MD5 hash according to (QS) and other parameters to form a signature (s)
4. Use HTTP POST request to call the web service.
5. Obtain the resulting XML response.
Copyright © SA Gaming 2019 All right reserved 8/84
TECHNICAL GUIDE
4.3 Example to call API
Let’s take RegUserInfo as an example:
Encryption required parameters:
method (String, “RegUserInfo”)
Key (String, the Secret Key)
Time (DateTime, Current Time, in yyyyMMddHHmmss format)
Username (String)
method, Key and Time are always inserted. Other parameters please follow the parameter list in each API function. Let say, the Secret Key is XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX and md5key is YYYYYYYY. Example Query String (QS): QS =
“method=RegUserInfo&Key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&Time=20140101123456&U
sername=DemoUser001”;
q = HttpUtility.UrlEncode( DESencrypt(QS) );
For example, q = 'j4tjorjwarfj3trwise0safrwg2wt4awari0fwjfeoh'
Example MD5 String for building the signature (QS + md5key + Time + Key): s = BuildMD5(QS + “YYYYYYYY” + “20140101123456” +
“XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX”);
For example, s = '1234567890abcdef' Resulting POST method query (using “Content-Type: application/x-www-form-urlencoded”):
q=j4tjorjwarfj3trwise0safrwg2wt4awari0fwjfeoh&s=1234567890abcdef POST to: http://<api-domain>/api/api.aspx Output:
Copyright © SA Gaming 2019 All right reserved 9/84
TECHNICAL GUIDE
<?xml version="1.0" encoding="utf-8"?>
<RegUserInfoResponse xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Username>DemoUser001</Username>
<ErrorMsgId>0</ErrorMsgId>
<ErrorMsg>Success</ErrorMsg>
</RegUserInfoResponse>
4.4 Error handling
When we received the q and s, if it is decrypted with error or the md5 is not match, a generic error response will be output.
ErrorMsgId 128 for decryption error. ErrorMsgId 132 for md5 sign unmatch. <?xml version="1.0" encoding="utf-8"?>
<APIResponse xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ErrorMsgId>128</ErrorMsgId>
<ErrorMsg>Decryption error</ErrorMsg>
</APIResponse>
Copyright © SA Gaming 2019 All right reserved 10/84
TECHNICAL GUIDE
5. Web service interface
All services require a secret key to access. Please contact us to get one.
5.1 User Account Manipulation
5.1.1 RegUserInfo
Create a user by username and currency type.
Parameters:
Copyright © SA Gaming 2019 All right reserved 11/84
TECHNICAL GUIDE
Name Description Type and Limit Required?
method must be “RegUserInfo” String (32) Y
Key secret key String (32) Y
Time current time in “yyyyMMddHHmmss” format
DateTime Y
Username User name. Alphanumeric (5~20 characters)
String (20) Y
CurrencyType Currency: CNY USD Refer to 11. Supported currencies
String (4) Y
Result:
Name Description Type and Limit Required?
Username User name String Y
ErrorMsgId Error message: 0: Success 108: Username length/format incorrect 113: Username duplicated 114: Currency not exist 133: Create user failed
Byte Y
ErrorMsg Error message detail String Y
5.1.2 VerifyUsername
Check if a username is already existing in database of a lobby.
Parameters:
Name Description Type and Limit Required?
method must be “VerifyUsername” String (32) Y
Key secret key String (32) Y
Time current time in DateTime Y
Copyright © SA Gaming 2019 All right reserved 12/84
TECHNICAL GUIDE
“yyyyMMddHHmmss” format
Username User name String (20) Y
Result:
Name Description Type and Limit Required?
IsExist User exist? True: user existing False: user not existing
Bool Y
Username User name String Y
ErrorMsgId Error message: 0: Success 108: Username length/format incorrect
Byte Y
ErrorMsg Error message detail String Y
Output:
<?xml version="1.0" encoding="utf-8"?>
<VerifyUsernameResponse xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<IsExist>True</IsExist>
<Username>DemoUser001</Username>
<ErrorMsgId>0</ErrorMsgId>
<ErrorMsg>Success</ErrorMsg>
</VerifyUsernameResponse>
5.1.3 GetUserStatusDV
The status of a user including:
● Online/offline ● Bet exist ● Bet amount and remain balance ● Maximum balance ● Maximum daily winning
Parameters:
Name Description Type and Limit Required?
Copyright © SA Gaming 2019 All right reserved 13/84
TECHNICAL GUIDE
method must be “GetUserStatusDV” String (32) Y
Key secret key String (32) Y
Time current time in “yyyyMMddHHmmss” format
DateTime Y
Username User name String (20) Y
Result:
Name Description Type and Limit Required?
IsSuccess Success? True: Success False: Failed
Bool Y
Username User name String Y
Balance Active balance, excluding betted amount. Correct to cent.
Decimal Y
Online online? Bool Y
Betted betted? Bool Y
BettedAmount Total betted amount Decimal Y
MaxBalance Upper limit in user's balance to place bet Decimal Y
MaxWinning Daily winning limitation to allow place bet Decimal Y
ErrorMsgId Error message 0: Success 100: Username error 108: Username length/format incorrect 116: Username does not exist
Byte Y
ErrorMsg Error message detail String Y
Output:
<?xml version="1.0" encoding="utf-8"?>
<GetUserStatusResponse xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<IsSuccess>True</IsSuccess>
<Username>DemoUser001</Username>
<Balance>1234567.89</Balance>
Copyright © SA Gaming 2019 All right reserved 14/84
TECHNICAL GUIDE
<Online>False</Online>
<Betted>False</Betted>
<BettedAmount>0</BettedAmount>
<ErrorMsgId>0</ErrorMsgId>
<ErrorMsg>Success</ErrorMsg>
</GetUserStatusResponse>
5.1.4 QueryBetLimit
Query all of the bet limit for specified currency.
Parameters:
Name Description Type and Limit Required?
method must be “QueryBetLimit” String (32) Y
Key secret key String (32) Y
Time current time in “yyyyMMddHHmmss” format
DateTime Y
Currency Currency: CNY USD Refer to 11. Supported currencies
String (4) Y
Result:
Name Description Type and Limit
Required?
BetLimitList
<BetLimitList> <BetLimit> <RuleID>1</RuleID> <Min>5</Min> <Max>500</Max> </BetLimit> <BetLimit> <RuleID>2</RuleID> <Min>100</Min> <Max>5000</Max> </BetLimit> </BetLimitList>
Structure Y
Copyright © SA Gaming 2019 All right reserved 15/84
TECHNICAL GUIDE
ErrorMsgId Error message: 0: Success 114: Currency not exist
Byte Y
ErrorMsg Error message detail String Y
5.1.5 SetBetLimit
Set a maximum 5 sets of bet limit to a user.
Parameters:
Name Description Type and Limit Required?
method must be “SetBetLimit” String (32) Y
Key secret key String (32) Y
Time current time in “yyyyMMddHHmmss” format
DateTime Y
Username User name String (20) Y
Currency Currency: CNY USD Refer to 11. Supported currencies
String (4) Y
Set1 ID from QueryBetLimit Int64 Y
Set2 ID from QueryBetLimit Int64 N
Set3 ID from QueryBetLimit Int64 N
Set4 ID from QueryBetLimit Int64 N
Set5 ID from QueryBetLimit Int64 N
Gametype roulette - for Roulette, otherwise no need this parameter or empty
Int64 N
Copyright © SA Gaming 2019 All right reserved 16/84
TECHNICAL GUIDE
Result:
Name Description Type and Limit Required?
ErrorMsgId Error message 0: Success 108: Username length/format incorrect 114: Currency not exist 116: Username does not exist 142: Parameter(s) error 147: BetLimit does not existed
Byte Y
ErrorMsg Error message detail String Y
5.1.6 GetUserMaxBalance
Return the user's maximum balance limit.
Parameters:
Name Description Type and Limit Required?
method must be “GetUserMaxBalance” String (32) Y
Key secret key String (32) Y
Time current time in “yyyyMMddHHmmss” format
DateTime Y
Username User name String (20) Y
Result:
Name Description Type and Limit Required?
MaxBalance Maximum balance Decimal Y
ErrorMsgId Error message 0: Success 100: Username error 108: Username length/format incorrect 116: Username does not exist
Byte Y
ErrorMsg Error message detail String Y
Copyright © SA Gaming 2019 All right reserved 17/84
TECHNICAL GUIDE
5.1.7 SetUserMaxBalance
Set the maximum balance limit to a user.
Parameters:
Name Description Type and Limit Required?
method must be “SetUserMaxBalance” String (32) Y
Key secret key String (32) Y
Time current time in “yyyyMMddHHmmss” format
DateTime Y
Username User name String (20) Y
MaxBalance Maximum balance Decimal Y
Result:
Name Description Type and Limit Required?
ErrorMsgId Error message 0: Success 116: Username does not exist 142: Parameter(s) error 148: MaxBalance not zero or smaller than user balance
Byte Y
ErrorMsg Error message detail String Y
5.1.8 SetUserMaxWinning
Set the user’s maximum daily winning. User cannot place bet if his winning exceed
this setting. Parameters:
Name Description Type and Limit Required?
method must be “SetUserMaxWinning” String (32) Y
Key secret key String (32) Y
Copyright © SA Gaming 2019 All right reserved 18/84
TECHNICAL GUIDE
Time current time in “yyyyMMddHHmmss” format
DateTime Y
Username User name String (20) Y
MaxWinning Maximum daily winning Decimal Y
Result:
Name Description Type and Limit Required?
ErrorMsgId Error message 0: Success 116: Username does not exist 142: Parameter(s) error
Byte Y
ErrorMsg Error message detail String Y
5.2 Login Access
5.2.1 LoginRequest
It is the function to request the login token. If the username doesn’t exist, it will be created automatically.
Parameters:
Name Description Type and Limit Required?
method must be “LoginRequest” String (32) Y
Key secret key String (32) Y
Time current time in “yyyyMMddHHmmss” format
DateTime Y
Username User name (5 ~ 20 characters)
String (20) Y
CurrencyType Currency: CNY USD Refer to 11. Supported currencies
String (4) Y
Copyright © SA Gaming 2019 All right reserved 19/84
TECHNICAL GUIDE
GameCode Game code string, refer to Section 10. EGame game code, FishermenGold for Fishermen Gold game
String (16) N
Lang Language code (only apply to EGame and Fishermen Gold)
String N
Mobile Mobile version (only apply to EGame and Fishermen Gold) 1 - Enable mobile 0 - Disable mobile
Bool N
Lang parameter for Fishermen Gold:
Language Description
zh_TW Traditional Chinese
zh_CN Simplified Chinese
en_US English
th Thai
vn Vietnamese
jp Japanese
id Bahasa Indonesia
it Italiano
ms Malay
es Spanish
Result:
Name Description Type and Limit Required?
Token Token for login# String Y
DisplayName* Internal assigned username String (31) Y
GameURL Complete URL to launch EGame or String N
Copyright © SA Gaming 2019 All right reserved 20/84
TECHNICAL GUIDE
Fishing game. Follow the different instruction to launch the games: EGame launching instruction Fishermen Gold launching instruction
ErrorMsgId Error message 0: Success 129: System under maintenance 130: User account is locked (disabled) 133: Create user failed 134: Game code not found 135: Game access denied
Byte Y
ErrorMsg Error message detail String Y
# If login request failed, there is no Token node in the response. * All username will be added a suffix @XX. The DisplayName will be the actual username in our database. You must provide this DisplayName to later login to our server! ^If no supply the GameCode or GameCode invalid, there is no GameURL node in the response. You have to check if this node existing.
Output:
Without GameCode parameter
<?xml version="1.0" encoding="utf-8"?>
<LoginRequestResponse xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Token>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</Token>
<DisplayName>”cstest@cs”</DisplayName>
<ErrorMsgId>0</ErrorMsgId>
<ErrorMsg>Success</ErrorMsg>
</LoginRequestResponse>
With GameCode parameter
<?xml version="1.0" encoding="utf-8"?>
<LoginRequestResponse xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Token>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</Token>
Copyright © SA Gaming 2019 All right reserved 21/84
TECHNICAL GUIDE
<DisplayName>”cstest@cs”</DisplayName>
<GameURL>http://www.xxxxx.com/game001/play.html”</GameURL>
<GameURL2>http://www.xxxxx.com/game001/play.html?name=peter&token=123123
123”</GameURL2>
<ErrorMsgId>0</ErrorMsgId>
<ErrorMsg>Success</ErrorMsg>
</LoginRequestResponse>
5.2.2 LoginRequestForFun
Login to the system in Fun mode. The username will be generated automatically.
Parameters:
Name Description Type and Limit Required?
method must be “LoginRequestForFun” String (32) Y
Key secret key String (32) Y
Time current time in “yyyyMMddHHmmss” format
DateTime Y
Amount Initial amount Decimal Y
CurrencyType ISO Currency ID String (4) Y
GameCode Game code string, refer to Section 10. EGame game code or FishermenGold for Fishermen Gold game
String (16) N
Lang Language code (only apply to Fishermen Gold)
String N
Mobile Mobile version (only apply to Fishermen Gold) 1 - Enable mobile 0 - Disable mobile
Bool N
Result:
Name Description Type and Limit Required?
Token Token for login# String Y
DisplayName* Internal assigned username String (31) Y
Copyright © SA Gaming 2019 All right reserved 22/84
TECHNICAL GUIDE
GameURL^ URL to launch the slot game To start the slot game please refer to EGame launching instruction Or Fishermen Gold launching instruction
String N
ErrorMsgId Error message 0: Success 129: System under maintenance 134: Game code not found 135: Game access denied
Byte Y
ErrorMsg Error message detail String Y
^If no supply the GameCode or GameCode invalid, there is no GameURL node in the response. You have to check if this node existing.
Output:
<?xml version="1.0" encoding="utf-8"?>
<LoginRequestForFun xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<DisplayName>sa-test1@xx</DisplayName>
<Token>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</Token>
<ErrorMsgId>0</ErrorMsgId>
<ErrorMsg>Success</ErrorMsg>
</LoginRequestForFun>
With GameCode parameter output:
<?xml version="1.0" encoding="utf-8"?>
<LoginRequestForFun xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<DisplayName>sa-test1@xx</DisplayName>
<Token>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</Token>
<GameURL>http://www.xxxxx.com/game001/play.html”</GameURL>
<ErrorMsgId>0</ErrorMsgId>
<ErrorMsg>Success</ErrorMsg>
</LoginRequestForFun>
Copyright © SA Gaming 2019 All right reserved 23/84
TECHNICAL GUIDE
5.2.3 KickUser
Kick user to offline.
Parameters:
Name Description Type and Limit Required?
method must be “KickUser” String (32) Y
Key secret key String (32) Y
Time current time in “yyyyMMddHHmmss” format
DateTime Y
Username User name String (20) Y
Result:
Name Description Type and Limit Required?
ErrorMsgId Error message 0: Success 102: Secret key incorrect 104: Service not available 108: Username length/format incorrect 116: Username does not exist 125: Kick user fail
Byte Y
ErrorMsg Error message detail String Y
Output:
<?xml version="1.0" encoding="utf-8"?>
<KickUserResponse xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ErrorMsgId>0</ErrorMsgId>
<ErrorMsg>Success</ErrorMsg>
</KickUserResponse>
5.3 Bet Records Query
Copyright © SA Gaming 2019 All right reserved 24/84
TECHNICAL GUIDE
5.3.1 GetAllBetDetailsDV
This Web service will fetch bet details for the current lobby of the specified date from 12:00 PM to 11:59:59 AM. If no Date input, the current date will be used. The frequency of the call should be made to this API 5 times per 5 minutes otherwise it will throw an error.
Parameters:
Name Description Type and Limit
Required?
method must be “GetAllBetDetailsDV” String (32) Y
Key secret key String (32) Y
Time current time in “yyyyMMddHHmmss” format
DateTime Y
Username (optional)
User name String (20) N
Date (optional) Date for details “yyyy-MM-dd”
Date N
Result:
Name Description Type and Limit Required?
BetDetailList Bet details structure XML Y
ErrorMsgId Error message 0: Success 108: Username length/format incorrect 112: API recently called 116: Username does not exist 128: Decryption error 142: Parameter(s) error
Byte Y
ErrorMsg Error message detail String Y
BetDetail structure
Name Description Type and Limit Required?
Copyright © SA Gaming 2019 All right reserved 25/84
TECHNICAL GUIDE
BetTime Bet start time Date Time Y
PayoutTime Payout Time DateTime Y
Username Player name String(31) Y
HostID Host table ID (0 for Multiplayer game) Int16 Y
Detail EGame: Slot game code Multiplayer: Game name
String N
GameID Game ID String Y
Round Game Round Int Y
Set Game Set Int Y
BetID Bet ID Int64 Y
BetAmount Bet amount Decimal Y
Rolling Rolling Decimal Y
ResultAmount Payout Decimal Y
Balance Balance after this bet Decimal Y
GameType Game type String Y
BetType Live game: Bet type of different games EGame: Bet line Minigame: Not used
Int Y
BetSource
2 / 2114 /2640
Web
3 / 2115 /2641
Multibet in Web
4/4100 API
16 / 600/ 8792/8793
HTML5 Mobile Web
1160/1161/5248/5249
iOS app
Int Y
Copyright © SA Gaming 2019 All right reserved 26/84
TECHNICAL GUIDE
1288/1289/5379/5377
Android app
TransactionID Seamless wallet PlaceBet transaction ID. -1 if not using seamless wallet
Int64 Y
State Is the bet success or failed? Bool Y
Output:
<?xml version="1.0" encoding="utf-8"?>
<GetAllBetDetailsResponse xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<BetDetailList>
<BetDetail>
<BetTime>2014-01-01T00:00:00</BetTime>
<PayoutTime>2014-01-01T00:01:12</PayoutTime>
<Username>DemoUser001</Username>
<HostID>123</HostID>
<Detail />
<GameID>1234567890123456</GameID>
<Round>10</Round>
<Set>34</Set>
<BetID>1234567890</BetID>
<BetAmount>123.45</BetAmount>
<Rolling>123.45</Rolling>
<Balance>434456.35</Balance>
<ResultAmount>246.90</ResultAmount>
<GameType>bac</GameType>
<BetType>123</BetType>
<BetSource>2</BetSource>
<TransactionID>-1</TransactionID>
<State>true</State>
</BetDetail>
</BetDetailList>
<ErrorMsgId>0</ErrorMsgId>
<ErrorMsg>Success</ErrorMsg>
</GetAllBetDetailsResponse>
5.3.2 GetAllBetDetailsForTimeIntervalDV
This web service will fetch bet details of a lobby for a time interval maximum 24 hours. The frequency of the call should be made to this API 5 times per 5 minutes otherwise it will throw an error.
Copyright © SA Gaming 2019 All right reserved 27/84
TECHNICAL GUIDE
Parameters:
Name Description Type and Limit Required?
method must be “GetAllBetDetailsForTimeIntervalDV”
String (32) Y
Key secret key String (32) Y
Time current time in “yyyyMMddHHmmss” format DateTime Y
Username (optional)
User name String (20) N
FromTime Date for details “yyyy-MM-dd hh:mm:ss”
DateTime Y
ToTime Date for details “yyyy-MM-dd hh:mm:ss”
DateTime Y
Result:
Name Description Type and Limit Required?
BetDetailList Bet details structure XML Y
ErrorMsgId Error message 0: Success 108: Username length/format incorrect 111: Query time range out of limitation 112: API recently called 116: Username does not exist 142: Parameter(s) error
Byte Y
ErrorMsg Error message detail String Y
5.3.3 GetAllBetDetailsFor30secondsDV
This web service will fetch bet details of a lobby for last 30 seconds. The frequency of the call should be made to this API 2 times per 30 seconds otherwise it will throw an error.
Parameters:
Name Description Type and Limit Required?
method must be “GetAllBetDetailsFor30secondsDV” String (32) Y
Copyright © SA Gaming 2019 All right reserved 28/84
TECHNICAL GUIDE
Key secret key String (32) Y
Time current time in “yyyyMMddHHmmss” format DateTime Y
Result:
Name Description Type and Limit Required?
BetDetailList Bet details structure XML Y
ErrorMsgId Error message 0: Success 108: Username length/format incorrect 112: API recently called
Byte Y
ErrorMsg Error message detail String Y
5.3.4 GetUserBetItemDV
Retrieve a list of bet record of a user within 7 days.
Parameters:
Name Description Type and Limit Required?
method must be “GetUserBetItemDV” String (32) Y
Key secret key String (32) Y
Time current time in “yyyyMMddHHmmss” format
DateTime Y
Username User name String (20) Y
FromTime Query start time: 2013-11-01 or 2013-11-01 03:02:45
DateTime Y
ToTime Query end time DateTime Y
Offset Query offset id. First query input 0. For the next query, using the offset from result
Int64 Y
Copyright © SA Gaming 2019 All right reserved 29/84
TECHNICAL GUIDE
Result:
Name Description Type and Limit Required?
Username User name String Y
FromTime Query start time DateTime Y
ToTime Query end time DateTime Y
Offset Offset Int64 Y
More True: data still existing for query, using the Offset to start again. False: all data has been send
Bool Y
ItemCount Number of item queried Int Y
UserBetItemList User betted item detail list XML Y
ErrorMsgId Error message 0: Success 111: Query time range out of limitation 116: Username does not exist
Byte Y
ErrorMsg Error message detail String Y
Output:
<?xml version="1.0" encoding="utf-8"?>
<GetUserBetItemResponse xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Username>DemoUser001</Username>
<FromTime>2014-01-01 00:00:00</FromTime>
<ToTime>2014-02-01 23:59:59</ToTime>
<Offset>0</Offset>
<More>false</More>
<ItemCount>2</ItemCount>
<UserBetItemList>
<UserBetItem>
<BetID>1</BetID>
<BetTime>2014-04-24T11:20:49</BetTime>
<GameID>135450624</GameID>
<HostID>301</HostID>
<HostName>百家樂1</HostName>
<GameType>bac</GameType>
<Set>1</Set>
<Round>2</Round>
<BetType>2</BetType>
<BetAmount>5</BetAmount>
<Rolling>5</Rolling>
Copyright © SA Gaming 2019 All right reserved 30/84
TECHNICAL GUIDE
<GameResult>
<BaccaratResult>
<PlayerCard1>
<Suit>2</Suit>
<Rank>3</Rank>
</PlayerCard1>
<PlayerCard2>
<Suit>4</Suit>
<Rank>J</Rank>
</PlayerCard2>
<BankerCard1>
<Suit>1</Suit>
<Rank>9</Rank>
</BankerCard1>
<BankerCard2>
<Suit>3</Suit>
<Rank>K</Rank>
</BankerCard2>
<ResultDetail>
<BRTie>false</BRTie>
<BRPlayerWin>false</BRPlayerWin>
<BRBankerWin>true</BRBankerWin>
<BRPlayerPair>true</BRPlayerPair>
<BRBankerPair>false</BRBankerPair>
<BRSuperSix>false</BRSuperSix>
</ResultDetail>
</BaccaratResult>
</GameResult>
<ResultAmount>0</ResultAmount>
<Balance>0</Balance>
<State>true</State>
</UserBetItem>
<UserBetItem>
<BetID>3</BetID>
<BetTime>2014-04-24T11:23:00</BetTime>
<GameID>269668352</GameID>
<HostID>301</HostID>
<HostName>百家樂1</HostName>
<GameType>bac</GameType>
<Set>1</Set>
<Round>4</Round>
<BetType>2</BetType>
<BetAmount>5</BetAmount>
<Rolling>5</Rolling>
<GameResult>
<BaccaratResult />
</GameResult>
<ResultAmount>0</ResultAmount>
<Balance>0</Balance>
<State>true</State>
</UserBetItem>
</UserBetItemList>
<ErrorMsgId>0</ErrorMsgId>
<ErrorMsg>Success</ErrorMsg>
</GetUserBetItemResponse>
5.3.5 GetUserBetAmountDV
This Web service will fetch the live game stake amount for a lobby.
Parameters:
Copyright © SA Gaming 2019 All right reserved 31/84
TECHNICAL GUIDE
Name Description Type and Limit Required?
method must be “GetUserBetAmounDV” String (32) Y
Key secret key String (32) Y
Time current time in “yyyyMMddHHmmss” format
DateTime Y
Username User name String (20) N
StartDate Start time (default current date) DateTime N
TimeRange Range in hour from 0 to 23 (default 0 = 24 hours)
Int N
Result: A series of follow records will return.
Name Description Type and Limit
Required?
Username user name String (31) Y
StakeAmount Sum of bet amount for all games Decimal Y
ErrorMsgId Error message 0: Success 108: Username length/format incorrect 116: Username does not exist
Byte Y
ErrorMsg Error message detail String Y
Output:
<?xml version="1.0" encoding="utf-8"?>
<GetUserBetAmountResponse xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<BetAmountDetailList>
<BetAmountDetails>
<Username>user001</Username>
<StakeAmount>1105.45</StakeAmount>
</BetAmountDetails>
</BetAmountDetailList>
<ErrorMsgId>0</ErrorMsgId>
<ErrorMsg>Success</ErrorMsg>
</GetUserBetAmountResponse>
Copyright © SA Gaming 2019 All right reserved 32/84
TECHNICAL GUIDE
5.3.6 GetUserWinLost
This API function is to get a user’s win/loss summary for a period of time with maximum of 31 days.
Parameters:
Name Description Type and Limit Required?
method must be “GetUserWinLost ” String (32) Y
Key secret key String (32) Y
Time current time in “yyyyMMddHHmmss” format
DateTime Y
Username User name String (20) Y
FromTime Start date and time DateTime Y
ToTime End of date and time DateTime Y
Type 0 - includes win and loss 1 - only includes win 2 - only includes loss
Int N
Result:
Name Description Type and Limit Required?
Username Username String (20) Y
Winlost Win or loss summary value Decimal Y
ErrorMsgId Error message 0: Success 106: Server not ready 108: Username length/format incorrect 111: Query time range out of limitation 116: Username does not exist 144: Query type invalid
Byte Y
ErrorMsg Error message detail String Y
Copyright © SA Gaming 2019 All right reserved 33/84
TECHNICAL GUIDE
5.3.7 GetTransactionDetails
This web service will fetch the transaction details of a lobby for a time interval maximum 31 days. You may specify an username to query transaction details of a certain user.
Parameters:
Name Description Type and Limit Required?
method must be “GetTransactionDetails ” String (32) Y
Key secret key String (32) Y
Time current time in “yyyyMMddHHmmss” format
DateTime Y
Username (optional)
User name String (20) N
FromTime Start date and time DateTime Y
ToTime End of date and time DateTime Y
Result:
Name Description Type and Limit Required?
Count Number of transactions Integer 32bit Y
Winlost Win/lose Decimal Y
TotalBet Total bet amount Decimal Y
TotalRolling Total rolling amount Decimal Y
ErrorMsgId Error message 0: Success 106: Server not ready 111: Query time range out of limitation 116: Username does not exist
Byte Y
ErrorMsg Error message detail String Y
5.3.8 GetFishermenGoldBetDetails
This Web service will fetch bet details for one fishing game session.
Copyright © SA Gaming 2019 All right reserved 34/84
TECHNICAL GUIDE
Parameters:
Name Description Type and Limit Required?
method must be “GetFishermenGoldBetDetails” String (32) Y
Key secret key String (32) Y
Time current time in “yyyyMMddHHmmss” format
DateTime Y
GameId Fishermen Gold game id String (32) Y
Page Page of record, start from giving 0 Int Y
Result: A series of follow records will be returned.
Name Description Type and Limit Required?
BetAmount Total bet amount (Coin) Int64 Y
WinAmount Total winning amount (Coin) Int64 Y
Currency Currency String (4) Y
ExchangeRate Coin to currency exchange rate Int Y
Count Total bullet record count Int Y
ItemCount Number of item queried Int Y
Limit Number of item per page Int Y
BulletDetailsList List of structure of a bullet details XML Y
ErrorMsgId Error message 0: Success 102: Secret key incorrect 106: Server not ready 152: Game Id does not exist
Byte Y
ErrorMsg Error message detail String Y
BulletDetails:
Copyright © SA Gaming 2019 All right reserved 35/84
TECHNICAL GUIDE
Name Description Type and Limit Required?
Denom Denomination Int Y
ID Bullet ID Int64 Y
Multiplier Multiplier Int Y
Cost Cost of the bullet (Coin) Int Y
Reward Reward of the bullet (Coin) Int Y
Species Fish ID Int Y
FreeBulletTotal Total of free bullet Int Y
FreeBulletRemain Remains of free bullet Int Y
FreeBulletReward Rewarded bullet of this shoot Int Y
Output:
<?xml version="1.0" encoding="utf-8"?>
<GetFishermenGoldBetDetailsResponse
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<BetAmount>2700</BetAmount>
<WinAmount>500</WinAmount>
<Currency>CNY</Currency>
<ExchangeRate>1000</ExchangeRate>
<Count>35</Count>
<ItemCount>20</ItemCount>
<Limit>20</Limit>
<BulletDetailsList>
<BulletDetails>
<Denom>50</Denom>
<ID>00000000010537</ID>
<Multiplier>2</Multiplier>
<Cost>100</Cost>
<Reward>0</Reward>
<Species>10</Species>
<FreeBulletTotal>0</FreeBulletTotal>
<FreeBulletRemain>0</FreeBulletRemain>
<FreeBulletReward>user001</FreeBulletReward>
</BulletDetails>
............
............
............
</BulletDetailsList>
Copyright © SA Gaming 2019 All right reserved 36/84
TECHNICAL GUIDE
<ErrorMsgId>0</ErrorMsgId>
<ErrorMsg>Success</ErrorMsg>
</GetFishermenGoldBetDetailsResponse>
5.4 Miscellaneous Functions
5.4.1 SlotJackpotQuery
This API function is to request to the Slot Jackpot meter in different currencies. The frequency of the call should be made to this API after every 1 minute otherwise it will throw an error.
Parameters:
Name Description Type and Limit Required?
method must be “SlotJackpotQuery ” String (32) Y
Key secret key String (32) Y
Time current time in “yyyyMMddHHmmss” format
DateTime Y
Currency Currency: CNY USD Refer to 11. Supported currencies
String (4) N
Result:
Name Description Type and Limit Required?
Major Major meter (in cents) Int64 Y
Minor Minor meter (in cents) Int64 Y
Mini Mini meter (in cents) Int64 Y
ErrorMsgId Error message 0: Success 104: Service is not available
Short Y
ErrorMsg Error message detail String Y
Copyright © SA Gaming 2019 All right reserved 37/84
TECHNICAL GUIDE
5.5 Transfer Wallet
The Transfer wallet API includes a transfer in, out and order status checking functions. Throughout those functions, there is an OrderID inside each of them. In case a transfer was failed due to network problem and become unsuccessful, be sure to use the same OrderID to initiate another try. We guarantee the same OrderID will be processed twice. Using a new OrderID for the same transfer may cause the duplicated transfer. Even you have checked the OrderID not existing by using CheckOrderID, you should still use the same OrderID.
5.5.1 DebitBalanceDV
Transfer from the user’s balance.
Parameters:
Name Description Type and Limit Required?
method must be “DebitBalanceDV” String (32) Y
Key secret key String (32) Y
Time current time in “yyyyMMddHHmmss” format
DateTime Y
Username User name Alphanumeric (5~20 characters)
String (20) Y
OrderId Order ID: OUT+YYYYMMDDHHMMSS+Username e.g. “OUT20131129130345peter1235”
String (40) Y
DebitAmount Debit amount. Maximum two decimal only.
Decimal Y
Result:
Name Description Type and Limit
Required?
Username User name String Y
Balance Remained active balance Decimal Y
Copyright © SA Gaming 2019 All right reserved 38/84
TECHNICAL GUIDE
DebitAmount Debited amount. Decimal Y
OrderId Order ID String (40) Y
ErrorMsgId Error message 0: Success 106: Server not ready. Try again later. 108: Username length/format incorrect 116: Username does not exist 120: Amount must be larger than zero 121: Not enough points to credit/debit 122: Order ID already exists 124: Database error 127: Invalid order ID format 142: Error Parameter 145: Parameter decimal point greater than 2
Byte Y
ErrorMsg Error message detail String Y
5.5.2 DebitAllBalanceDV
Transfer all amount from the user’s balance.
Parameters:
Name Description Type and Limit Required?
method must be “DebitAllBalanceDV” String (32) Y
Key secret key String (32) Y
Time current time in “yyyyMMddHHmmss” format
DateTime Y
Username User name String (20) Y
OrderId Order ID: OUT+YYYYMMDDHHMMSS+Username e.g. “OUT20131129130345peter1235”
String (40) Y
Copyright © SA Gaming 2019 All right reserved 39/84
TECHNICAL GUIDE
Result:
Name Description Type and Limit Required?
Username User name String Y
DebitAmount Debited amount. Decimal Y
OrderId Order ID String (40) Y
ErrorMsgId Error message 0: Success 106: Server not ready. Try again later. 108: Username length/format incorrect 116: Username does not exist 122: Order ID already exists 124: Database error 127: Invalid order ID format
Byte Y
ErrorMsg Error message detail String Y
5.5.3 CreditBalanceDV
Transfer fund to user’s balance.
Parameters:
Name Description Type and Limit Required?
method must be “CreditBalanceDV” String (32) Y
Key secret key String (32) Y
Time current time in “yyyyMMddHHmmss” format
DateTime Y
Username User name String (20) Y
OrderId Order ID: IN+YYYYMMDDHHMMSS+Username e.g. “IN20131129130345peter1235”
String (40) Y
CreditAmount Credit amount. Decimal Y
Copyright © SA Gaming 2019 All right reserved 40/84
TECHNICAL GUIDE
Result:
Name Description Type and Limit
Required?
Username User name String Y
Balance Remained active balance Decimal Y
CreditAmount Credited amount. Decimal Y
OrderId Order ID String (40) Y
ErrorMsgId Error message 0: Success 106: Server not ready. Try again later. 108: Username length/format incorrect 116: Username does not exist 120: Amount must be larger than zero 121: Not enough points to credit/debit 122: Order ID already exists 124: Database error 127: Invalid order ID format 142: Error Parameter 145: Parameter decimal point greater than 2
Byte Y
ErrorMsg Error message detail String Y
5.5.4 CheckOrderId
Check the OrderId that generated in DebitBalanceDV/DebitAllBalanceDV/CreditBalanceDV is existing or not in our system.
Parameters:
Name Description Type and Limit Required?
method must be “CheckOrderId” String (32) Y
Key secret key String (32) Y
Time current time in “yyyyMMddHHmmss” format
DateTime Y
OrderId The OrderId used in ● DebitBalanceDV ● DebitAllBalanceDV
String (40) Y
Copyright © SA Gaming 2019 All right reserved 41/84
TECHNICAL GUIDE
● CreditBalanceDV
Result:
Name Description Type and Limit Required?
isExist The OrderId exist or not ● true - existing ● false - not existing
Bool Y
ErrorMsgId Error message 0: Success 106: Server not ready. Try again later. 124: Database error
Byte Y
ErrorMsg Error message detail String Y
6. Seamless Wallet Integration
6.1 Introduction
This section is to illustrate the detail of implementing seamless wallet in external partner system. Important: While probably obvious, it’s worth stating that when Seamless Wallet is in use, the CreditBalance/DebitBalance/DebitAllBalance API should not be used to modify a player’s balance.
6.2. Workflow
Basically the partner system have to provide a set of API functions for our system to call:
1. GetUserBalance 2. Fund Transfer
GetUserBalance will be called when the user login to our platform or user click refresh balance in the web client. Fund Transfer function includes four types of transfer:
1. PlaceBet It is sent to the partner system when the user going to place a bet. The function will be timed out after 3 seconds and PlaceBetCancel will be sent.
2. PlayerWin
Copyright © SA Gaming 2019 All right reserved 42/84
TECHNICAL GUIDE
When a bet placed before is winning, the total amount (including stakes) will send to partner system. 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 retired by the operator through the back office.
3. PlayerLost When a bet placed before is losing, this request will be sent to the partner system. Although it is no amount adjustment, it is still worth to let partner system to update the state of an open transaction. 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.
4. PlaceBetCancel PlaceBetCancel will only be sent 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.
All above Fund Transfer functions provide a unique transaction ID and partner system should only process once and only once, but must always respond. SA Gaming platform assumes that the partner system will handle duplicate transaction request properly and send back a success response for a request that had already been processed. Operator should provide these five individual aspx, php, etc. to allow SA Gaming platform to call: E.g.
/GetUserBalance.aspx, /PlaceBet.aspx, /PlayerWin.aspx, /PlayerLost.aspx and /PlaceBetCancel.aspx
** Operator can only use ONE type of extension, no multiple extension is allowed.
6.3 Seamless Wallet Protocol
SA Gaming platform will use HTTP POST request to communicate with the external wallet. All of the parameters will be encrypted and pass as a text value. The following is an example of a request string that SA Gaming platform sends to external wallet before encryption:
Copyright © SA Gaming 2019 All right reserved 43/84
TECHNICAL GUIDE
username=peter1234¤cy=CNY
6.3.1 Encryption procedures
We will use DES CBC encryption. The following are the example of DES Encrypt/Decrypt function:
ASP.Net version
protected byte [] EncryptKey = ASCIIEncoding .ASCII.GetBytes( "ask_us_for_key" );
public string DESEncrypt( string inString)
{
MemoryStream ms = new MemoryStream ();
CryptoStream cs = new CryptoStream (ms, new
DESCryptoServiceProvider ().CreateEncryptor(EncryptKey, EncryptKey),
CryptoStreamMode .Write);
StreamWriter sw = new StreamWriter (cs);
sw.Write(inString);
sw.Flush();
cs.FlushFinalBlock();
sw.Flush();
return Convert.ToBase64String(ms.GetBuffer(), 0, ( int )ms.Length);
}
public string DESDecrypt( string inString)
{
try
{
return new StreamReader ( new CryptoStream ( new MemoryStream (
Convert .FromBase64String(inString)), new
DESCryptoServiceProvider ().CreateDecryptor(EncryptKey, EncryptKey),
CryptoStreamMode .Read)).ReadToEnd();
}
catch
{
}
return "";
}
PHP version
DES Encrypt/Decrypt function in PHP <?php
class DES
{
var $key;
var $iv;
function __construct ( $key, $iv=0 ) {
$this ->key = $key;
Copyright © SA Gaming 2019 All right reserved 44/84
TECHNICAL GUIDE
if ( $iv == 0 ) {
$this ->iv = $key;
} else {
$this ->iv = $iv;
}
}
function encrypt ($str) {
return base64_encode( openssl_encrypt($str, 'DES-CBC' , $this ->key,
OPENSSL_RAW_DATA, $this ->iv ) );
}
function decrypt ($str) {
$str = openssl_decrypt(base64_decode($str), 'DES-CBC' , $this ->key,
OPENSSL_RAW_DATA | OPENSSL_NO_PADDING, $this ->iv);
return rtrim($str, '\x1\x2\x3\x4\x5\x6\x7\x8' );
}
function pkcs5Pad ($text, $blocksize) {
$pad = $blocksize - (strlen ( $text ) % $blocksize);
return $text . str_repeat ( chr ( $pad ), $pad );
}
}
?>
6.3.2 POST
After encrypted the request string, we will POST the encrypted string with urlencoded as plain text:
POST / HTTP/1.0
Content-Type: text/plain
kuVJgHRMSXOT7a7enWsOyki0NTSd7tTraFXJ%2F7xui4V5nWyik20DSurYFWlkzdMGMhbbqkrO5A2o
SUpPWXyrW1yFWFCOdU1GasqDd3WtnWv6htNdXqGw3uIcj%2Bc%2BYUDP2IQIVNL1hQrpytFPyIJisb
Eobll66Wb2IodCT%2Bqq3iDsQeu%2FVd2%2Bb7%2FZjExJOlGisn264ogMCoDsw5ya%2Bo9RDOOLZ6
RS2WHxI99nIOvmkPccx1wGWhT0%2Fw%3D%3D
Partner system have to url decode and decrypt the string by the provided key and perform the requested function.
6.3.3 Response data
Partner system should respond the request in XML format:
<?xml version="1.0" encoding="utf-8"?>
<RequestResponse>
<username>peter1234</username>
Copyright © SA Gaming 2019 All right reserved 45/84
TECHNICAL GUIDE
<currency>CNY</currency>
<amount >1532.36</amount >
<error>0</error>
</RequestResponse>
6.4 GetUserBalance
This request is send to the partner system to retrieve the balance of a user.
Input parameters:
Name Description Type and Limit
Required?
username Username of the user String (20) Y
currency ISO 3 characters e.g. CNY/USD. Except mXBT String (4) Y
E.g.
username=peter1234¤cy=CNY
Response parameters:
Copyright © SA Gaming 2019 All right reserved 46/84
TECHNICAL GUIDE
Name Description Type and Limit
Required?
username Username of the user String (20) Y
currency ISO 3 characters e.g. CNY/USD. Except mXBT String (4) Y
amount Decimal format and max. 2 decimal places Decimal Y
error Error code Int Y
6.5 Fund Transfer
SA Gaming platform makes different fund transfer request to partner system to modify the balance of the player, either to withdraw funds for a bet, or to deposit funds for a win.
6.5.1 PlaceBet
When a player makes a bet in a game, SA Gaming platform will send this request to partner system. This request must be responded within 3 seconds, otherwise it is defined as timeout and PlaceBetCancel will be sent to cancel/refund the unsuccessful bet.
Name Description Type and Limit
Required?
username Username of the user String (20) Y
currency ISO 3 characters e.g. CNY/USD String (4) Y
amount Amount to bet (decimal format and max. 2 decimal places)
Decimal Y
txnid A unique id for all fund transfer String (16) Y
gametype Game type bac - Baccarat dtx - Dragon & Tiger sicbo - Sic Bo rot - Roulette ftan - Fan Tan slot - EGame minigame - Mini Game multiplayer - Fishermen Gold
String Y
platform 0 - desktop Byte Y
Copyright © SA Gaming 2019 All right reserved 47/84
TECHNICAL GUIDE
1 - mobile
gamecode When gametype is “slot”, “minigame” or “multiplayer”, it is the game code of the game
String N
hostid Host ID, please refer to Section 10. Only valid for bac/dtx/sicbo/rot/ftan game types
Int N
gameid Game ID String Y
E.g.
username=peter1234¤cy=CNY&amount=10.00&txnid=843828123434&gametype=bac&g
ameid=133849980
Response parameters:
Name Description Type and Limit
Required?
username Username of the user String (20) Y
currency ISO 3 characters e.g. CNY/USD. Except mXBT String (4) Y
amount Amount after adjustment (decimal format and max. 2 decimal places)
Decimal Y
error Error code Int Y
Copyright © SA Gaming 2019 All right reserved 48/84
TECHNICAL GUIDE
Copyright © SA Gaming 2019 All right reserved 49/84
TECHNICAL GUIDE
6.5.2 PlayerWin
When a game completed and the player win (even bet return when the result is Tie in Baccarat) PlayerWin will send to partner system to adjust the balance of the player. This request will keep trying if the partner system no response or respond error.
Copyright © SA Gaming 2019 All right reserved 50/84
TECHNICAL GUIDE
Name Description Type and Limit
Required?
username Username of the user String (20) Y
currency ISO 3 characters e.g. CNY/USD String (4) Y
amount Amount to add back (decimal format and max. 2 decimal places)
Decimal Y
txnid A unique id for all fund transfer String (16) Y
gametype Game type bac - Baccarat dtx - Dragon & Tiger sicbo - Sic Bo rot - Roulette ftan - Fan Tan slot - EGame minigame - Mini Game multiplayer - Fishermen Gold
String Y
gamecode When gametype is “slot”, “minigame” or “multiplayer”, it is the game code of the game
String N
PayoutTime
Time of the payout DateTime Y
hostid Host ID, please refer to Section 10. Only valid for bac/dtx/sicbo/rot/ftan game types
Int N
gameid Game ID String Y
E.g.
username=peter1234¤cy=CNY&amount=20.00&txnid=843828125323&gametype=bac&g
ameid=133849980&hostid=123
Response parameters:
Name Description Type and Limit
Required?
username Username of the user String (20) Y
currency ISO 3 characters e.g. CNY/USD. Except mXBT String (4) Y
Copyright © SA Gaming 2019 All right reserved 51/84
TECHNICAL GUIDE
amount Amount after adjustment (decimal format and max. 2 decimal places)
Decimal Y
error Error code Int Y
6.5.3 PlayerLost
When a game completed and the player lost (no winning amount,) PlayerLost will be sent to the partner system. Since it is a loss so there is no amount parameter in the request. This request will keep trying if the partner system no response or responding error.
Name Description Type and Limit
Required?
username Username of the user String (20) Y
currency ISO 3 characters e.g. CNY/USD String (4) Y
txnid A unique id for all fund transfer String (16) Y
gametype Game type bac - Baccarat dtx - Dragon & Tiger sicbo - Sic Bo rot - Roulette ftan - Fan Tan slot - EGame minigame - Mini Game multiplayer - Fishermen Gold
String Y
gamecode When gametype is “slot” or “minigame”, it is the game code of the game
String N
PayoutTime
Time of the payout DateTime Y
hostid Host ID, please refer to Section 10. Only valid for bac/dtx/sicbo/rot/ftan game types
Int N
gameid Game ID String Y
E.g.
Copyright © SA Gaming 2019 All right reserved 52/84
TECHNICAL GUIDE
username=peter1234¤cy=CNY&txnid=8438234356625&gametype=bac&gameid=133849
980
Response parameters:
Name Description Type and Limit
Required?
username Username of the user String (20) Y
currency ISO 3 characters e.g. CNY/USD. Except mXBT String (4) Y
amount Amount after adjustment (decimal format and max. 2 decimal places)
Decimal Y
error Error code Int Y
6.5.4 PlaceBetCancel
If a PlaceBet request timeout or partner system responded an error, a PlaceBetCancel request will send to partner system. SA Gaming platform will treat it as bet failed and report to the player that his bet has been failed. Partner system must handle this request once and only once and must respond to our platform. In case you cannot find the previous transaction by the txn_reverse_id, you have to send us error = 0, else we will keep sending this request.
Name Description Type and Limit
Required?
username Username of the user String (20) Y
currency ISO 3 characters e.g. CNY/USD String (4) Y
amount Amount to reverse (decimal format and max. 2 decimal places)
Decimal Y
txnid A unique id for all fund transfer String (16) Y
gametype Game type bac - Baccarat dtx - Dragon & Tiger sicbo - Sic Bo rot - Roulette ftan - Fan Tan
String Y
Copyright © SA Gaming 2019 All right reserved 53/84
TECHNICAL GUIDE
slot - EGame minigame - Mini Game multiplayer - Fishermen Gold
gamecode When gametype is “multiplayer”, it is the game code of the game
String N
hostid Host ID, please refer to Section 10. Only valid for bac/dtx/sicbo/rot/ftan game types
Int N
gameid Game ID String Y
txn_reverse_id Previous txnid in PlaceBet request which the response was not received within 3 seconds or responded with an error.
String (16) Y
E.g.
username=peter1234¤cy=CNY&amount=20.00&txnid=4345234534534&gametype=bac&
gameid=133849980&txn_reverse_id=843828123434
Response parameters:
Name Description Type and Limit
Required?
username Username of the user String (20) Y
currency ISO 3 characters e.g. CNY/USD. Except mXBT String (4) Y
amount Amount after adjustment (decimal format and max. 2 decimal places)
Decimal Y
error Error code Int Y
Copyright © SA Gaming 2019 All right reserved 54/84
TECHNICAL GUIDE
Copyright © SA Gaming 2019 All right reserved 55/84
TECHNICAL GUIDE
6.6 Important notice
Normally, the PlaceBet and PlayerWin/PlayerLost are paired in the live game, the slot game, and the fishing game. However, the fishing game does have an exception. In case a player played a round of fishing game with free bullets remain and logged out. When the player logs into the fishing game later and shoots some bullet, no matter he won or not, if he logged out without transferring fund, a PlayerWin/PlayerLost will send. In this scenario, there is no PlaceBet but PlayerWin/PlayerLost send. It may void your checking for a PlayerWin/PlayerLost to match a PlaceBet by GameID. It is important that you must take care of this situation and make sure you can process the PlayerWin/PlayerLost correctly.
6.7 Error code list
Partner system should report to our platform with the following error codes:
ID Description
0 Success
1000 User account doesn’t exist
1001 Invalid currency
1002 Invalid amount
1003 Locked account
1004 Insufficient balance
1005 General error
1006 Decryption error
1007 Session expired error
9999 System error
Copyright © SA Gaming 2019 All right reserved 56/84
TECHNICAL GUIDE
7. Error message code reference
Common error message code
ID Description
100 Username error
101 Account locked
102 Secret key incorrect
104 Service not available
105 Client side error
106 Server busy. Try again later.
107 Username empty
108 Username length/format incorrect
110 User not online
111 Query time range out of limitation
112 API recently called
113 Username duplicated
114 Currency not exist
116 Username does not exist
120 Amount must greater than zero
121 Not enough points to credit/debit/bet
122 Order ID already exists
125 Kick user fail
127 Invalid order ID format
128 Decryption error
129 System under maintenance
Copyright © SA Gaming 2019 All right reserved 57/84
TECHNICAL GUIDE
130 User account is locked (disabled)
131 Wrong network
132 Sign unmatch
133 Create user failed
134 Game code not found
135 Game access denied
136 Not enough point to bet
137 Bet string error
138 Bet time ended or not started
142 Parameter(s) error
144 Query type invalid
145 Parameter decimal point greater than 2
146 API access denied
147 BetLimit does not existed
148 MaxBalance not zero or smaller than user balance
149 Input amount under minimum value
150 Function has been deprecated
151 Duplicate login
152 Fishermen Gold game id not existing
Copyright © SA Gaming 2019 All right reserved 58/84
TECHNICAL GUIDE
8. Game Launching Procedures
Live Game
The Token is required for each login. Please construct a query string with the following parameters and using GET to send to app.aspx (e.g. xx.sa-api.net/app.aspx.)
Parameter Description Required?
username The username display in the client. Y
token The token returned from LoginRequest. Y
lobby The lobby code we provided, it is to show the correct logo while loading.
Y
lang Default language to be used in the client. Check in the table below for details.
N
returnurl Optional parameter. The URL will be invoked when client logout.
N
mobile Optional parameter. true - Start the client in HTML5 mobile version.
N
h5web Optional parameter: true - Start the client in HTML5 desktop version. It will ignore “h5web” parameter if both h5web and mobile is true.
N
options Optional parameters to enable feature while entering lobby (URL Encoding will be needed)
1. defaulttable=<table_id> ○ To go into table directly (601~616/630~632/640) ○ To go into slot lobby directly (401) ○ To go into multiple bet view (multibet)
2. hidelive=1 ○ To remove all live game icons
3. hideslot=1 ○ To remove the slot lobby icon
4. hidemultiplayer=1 ○ To remove the fishing game icon
5. skipslotintro=1 ○ To skip slot game introduction video from playing
Each parameter have to use comma to separate:
N
Copyright © SA Gaming 2019 All right reserved 59/84
TECHNICAL GUIDE
options=defaulttable=612,hideslot=1,skipslotintro=1
For example: http://xx.sa-api.net/app.aspx?username=demo888&token=e93a9aeb9981da12b3&lobby=A999&lang=en_US&returnurl=http://yourdomain.com/yourlocation
lang Description
zh_TW Traditional Chinese
zh_CN Simplified Chinese
en_US English
jp Japanese
th Thai
vn Vietnamese
id Bahasa Indonesia
ms Malay
es Spanish
EGame
You may use the GameURL returned from LoginRequest or LoginRequestForFun directly to launch the slot game. The following are all parameters used. You are free to append extra parameters to have your needs.
Parameter Description Type Preset?
token Token String Y
name DisplayName or you can specify String Y
language Language to launch the slot, see below String Y
mobile HTML mode (optional) Bool (true/false) Y
lobbycode Lobby code String Y
Copyright © SA Gaming 2019 All right reserved 60/84
TECHNICAL GUIDE
returnurl The URL will be invoked when the slot logout (optional)
String N
skipintro To skip the introduction video (optional) Bool (1/0) N
Fishermen Gold
The returned GameURL has been constructed to use directly, however, you may append returnurl=https://www.yourdomain.com/somewhere parameter the same as Live Game or EGame. Moreover, you can control the displayed username in the fishing game client by adding un=your_username, it will override the actual username in our system.
Parameter Description Type
returnurl The URL will be invoked when the Fishermen Gold logout (optional)
String
un To override the displayed username come from system (optional)
String
Copyright © SA Gaming 2019 All right reserved 61/84
TECHNICAL GUIDE
9. UserBetItem
Name Description Type and Limit Required?
BetID Bet record Id Int64 Y
BetTime Bet time DateTime Y
PayoutTime Payout time DateTime Y
GameID Game ID String Y
HostID Host table Id (0 for Multiplayer game) Int16 Y
HostName Host table name String Y
GameType Game type name (see below) String Y
Detail EGame: Slot game code Multiplayer: Game name
String N
Set Set Int Y
Round Round Int Y
BetType Bet item (details in other table) Baccarat Dragon Tiger Roulette Sicbo Fantan
Byte Y
BetAmount Bet amount (correct to cent) Decimal Y
Rolling Rolling (correct to cent) Decimal Y
GameResult Result of the game (details in other table) Baccarat Dragon Tiger Roulette Sicbo Fantan
String Y
ResultAmount Win or Lost amount (correct to cent) Decimal Y
Balance Remain balances (correct to cent) Decimal Y
Copyright © SA Gaming 2019 All right reserved 62/84
TECHNICAL GUIDE
GameType
Code name Description
bac Baccarat
dtx Dragon Tiger
sicbo Sic Bo
ftan Fan Tan
rot Roulette
slot Slot Game
minigame Mini game
multiplayer Multi-player games
Baccarat
GameResult of Baccarat
Name Description Type and Limit
PlayerCard1 CardDetail Structure
PlayerCard2 CardDetail Structure
PlayerCard3 CardDetail (may not exist) Structure
BankerCard1 CardDetail Structure
BankerCard2 CardDetail Structure
BankerCard3 CardDetail (may not exist) Structure
ResultDetail Details of the result Structure
CardDetail
Suit ♠ = 1 ♥ = 2 ♣ = 3 ♦ = 4 Byte
Rank A = 1 2 = 2
Byte
Copyright © SA Gaming 2019 All right reserved 63/84
TECHNICAL GUIDE
… 10 = 10 J = 11 Q = 12 K = 13
BetType for Baccarat
ID Description
0 Tie
1 Player
2 Banker
3 Player Pair
4 Banker Pair
25 NC. Tie
26 NC.Player
27 NC. Banker
28 NC. Player Pair
29 NC. Banker Pair
30 SuperSix
36 Player Natural
37 Banker Natural
40 NC. Player Natural
41 NC. Banker Natural
42 Cow Cow Player
43 Cow Cow Banker
44 Cow Cow Tie
Copyright © SA Gaming 2019 All right reserved 64/84
TECHNICAL GUIDE
ResultDetail for Baccarat
Name Description Type and Limit
BRTie Tie Bool
BRPlayerWin Player Bool
BRBankerWin Banker Bool
BRPlayerPair Player Pair Bool
BRBankerPair Banker Pair Bool
BRSSTie NC. Tie Bool
BRSSPlayerWin NC. Player Bool
BRSSBankerWin NC. Bander Bool
BRSSPlayerPair NC. Player Pair Bool
BRSSBankerPair NC. Banker Pair Bool
BRSSSuperSix SuperSix Bool
BRPlayerNatural Player Natural Bool
BRBankerNatural Banker Natural Bool
BRSSPlayerNatural NC. Player Natural Bool
BRSSBankerNatural NC. Banker Natural Bool
BRCowPlayerWin Cow Cow Player Bool
BRCowBankerWin Cow Cow Banker Bool
BRCowTie Cow Cow Tie Bool
Dragon Tiger
GameResult of Dragon Tiger
Name Description Type and Limit
Copyright © SA Gaming 2019 All right reserved 65/84
TECHNICAL GUIDE
DragonCard CardDetail Structure
TigerCard CardDetail Structure
ResultDetail Details of the result Structure
BetType for Dragon Tiger
ID Description
0 Tie
1 Dragon
2 Tiger
ResultDetail for Dragon Tiger
Name Description Type and Limit
DTRTie Tie game Bool
DTRDragonWin Dragon win Bool
DTRTigerWin Tiger win Bool
Copyright © SA Gaming 2019 All right reserved 66/84
TECHNICAL GUIDE
Sic Bo
GameResult of Sic Bo
Name Description Type and Limit
Dice1 Dice 1 Int
Dice2 Dice 2 Int
Dice3 Dice 3 Int
ResultDetail Details of the result Structure
BetType for Sic Bo
ID Description ID Description
0 Small 55 Three Even
1 Big 56 1 2 3 4
2 Odd 57 2 3 4 5
3 Even 58 2 3 5 6
4 Number 1 59 3 4 5 6
5 Number 2 60 112
6 Number 3 61 113
7 Number 4 62 114
8 Number 5 63 115
9 Number 6 64 116
10 All 1 65 221
11 All 2 66 223
12 All 3 67 224
13 All 4 68 225
14 All 5 69 226
Copyright © SA Gaming 2019 All right reserved 67/84
TECHNICAL GUIDE
15 All 6 70 331
16 All same 71 332
17 Point 4 72 334
18 Point 5 73 335
19 Point 6 74 336
20 Point 7 75 441
21 Point 8 76 442
22 Point 9 77 443
23 Point 10 78 445
24 Point 11 79 446
25 Point 12 80 551
26 Point 13 81 552
27 Point 14 82 553
28 Point 15 83 554
29 Point 16 84 556
30 Point 17 85 661
31 Specific double 1, 2 86 662
32 Specific double 1, 3 87 663
33 Specific double 1, 4 88 664
34 Specific double 1, 5 89 665
35 Specific double 1, 6 90 126
36 Specific double 2, 3 91 135
37 Specific double 2, 4 92 234
38 Specific double 2, 5 93 256
39 Specific double 2, 6 94 346
40 Specific double 3, 4 95 123
Copyright © SA Gaming 2019 All right reserved 68/84
TECHNICAL GUIDE
41 Specific double 3, 5 96 136
42 Specific double 3, 6 97 145
43 Specific double 4, 5 98 235
44 Specific double 4, 6 99 356
45 Specific double 5, 6 100 124
46 Pair 1 101 146
47 Pair 2 102 236
48 Pair 3 103 245
49 Pair 4 104 456
50 Pair 5 105 125
51 Pair 6 106 134
52 Three Odd 107 156
53 Two Odd One Even 108 246
54 Two Even One Odd 109 345
ResultDetail for Sic Bo
Name Description Type and Limit
SRBigSmall 0 - Triple 1 - Big 2 - Small
Byte
SROddEven 0 - Triple 1 - Odd 2 - Even
Byte
SRTripleArmyOne Triple army 1 Bool
SRTripleArmyTwo Triple army 2 Bool
SRTripleArmyThree Triple army 3 Bool
SRTripleArmyFour Triple army 4 Bool
Copyright © SA Gaming 2019 All right reserved 69/84
TECHNICAL GUIDE
SRTripleArmyFive Triple army 5 Bool
SRTripleArmySix Triple army 6 Bool
SRTriple 0 - NA 1 - Triple 1 2 - Triple 2 3 - Triple 3 4 - Triple 4 5 - Triple 5 6 - Triple 6
Byte
SRAllTriple All triple Bool
SRPoint 0 - NA 4 - Point 4 5 - Point 5 6 - Point 6 7 - Point 7 8 - Point 8 9 - Point 9 10 - Point 10 11 - Point 11 12 - Point 12 13 - Point 13 14 - Point 14 15 - Point 15 16 - Point 16 17 - Point 17
Byte
SRLongOneTwo Long 1 2 Bool
SRLongOneThree Long 1 3 Bool
SRLongOneFour Long 1 4 Bool
SRLongOneFive Long 1 5 Bool
SRLongOneSix Long 1 6 Bool
SRLongTwoThree Long 2 3 Bool
SRLongTwoFour Long 2 4 Bool
SRLongTwoFive Long 2 5 Bool
SRLongTwoSix Long 2 6 Bool
SRLongThreeFour Long 3 4 Bool
Copyright © SA Gaming 2019 All right reserved 70/84
TECHNICAL GUIDE
SRLongThreeFive Long 3 5 Bool
SRLongThreeSix Long 3 6 Bool
SRLongFourFive Long 4 5 Bool
SRLongFourSix Long 4 6 Bool
SRLongFiveSix Long 5 6 Bool
SRShort 0 - NA 1 - Short 1 2 - Short 2 3 - Short 3 4 - Short 4 5 - Short 5 6 - Short 6
Byte
SROddEvenCombination 0 - Three Odd 1 - Two Odd One Even 2 - Two Even One Odd 3 - Three Even
Byte
SR_1_2_3_4 1 2 3 4 Bool
SR_2_3_4_5 2 3 4 5 Bool
SR_2_3_5_6 2 3 5 6 Bool
SR_3_4_5_6 3 4 5 6 Bool
SRCombination 0 - NA 1 - 112 2 - 113 3 - 114 4 - 115 5 - 116 6 - 221 7 - 223 8 - 224 9 - 225 10 - 226 11 - 331 12 - 332 13 - 334 14 - 335 15 - 336 16 - 441
Byte
Copyright © SA Gaming 2019 All right reserved 71/84
TECHNICAL GUIDE
17 - 442 18 - 443 19 - 445 20 - 446 21 - 551 22 - 552 23 - 553 24 - 554 25 - 556 26 - 661 27 - 662 28 - 663 29 - 664 30 - 665 31 - 126 32 - 135 33 - 234 34 - 256 35 - 346 36 - 123 37 - 136 38 - 145 39 - 235 40 - 356 41 - 124 42 - 146 43 - 236 44 - 245 45 - 456 46 - 125 47 - 134 48 - 156 49 - 246 50 - 345
Copyright © SA Gaming 2019 All right reserved 72/84
TECHNICAL GUIDE
Fan Tan
GameResult of Fan Tan
Name Description Type and Limit
Point Remain buttons count: 1, 2, 3 or 4 Int
ResultDetail Details of the result Structure
BetType for Fan Tan
ID Description ID Description
0 Odd 21 4 Nim 3
1 Even 22 12 Kwok
2 1 Zheng 23 14 Kwok
3 2 Zheng 24 23 Kwok
4 3 Zheng 25 34 Kwok
5 4 Zheng 26 1 Tong 23
6 1 Fan 27 1 Tong 24
7 2 Fan 28 1 Tong 34
8 3 Fan 29 2 Tong 13
9 4 Fan 30 2 Tong 14
10 1 Nim 2 31 2 Tong 34
11 1 Nim 3 32 3 Tong 12
12 1 Nim 4 33 3 Tong 14
13 2 Nim 1 34 3 Tong 24
14 2 Nim 3 35 4 Tong 12
15 2 Nim 4 36 4 Tong 13
16 3 Nim 1 37 4 Tong 23
Copyright © SA Gaming 2019 All right reserved 73/84
TECHNICAL GUIDE
17 3 Nim 2 38 123 Chun
18 3 Nim 4 39 124 Chun
19 4 Nim 1 40 134 Chun
20 4 Nim 2 41 234 Chun
ResultDetail for Fan Tan
Name Description Type and Limit
FTROdd Odd Bool
FTREven Even Bool
FTRZhengOne 1 Zheng Bool
FTRZhengTwo 2 Zheng Bool
FTRZhengThree 3 Zheng Bool
FTRZhengFour 4 Zheng Bool
FTRFanOne 1 Fan Bool
FTRFanTwo 2 Fan Bool
FTRFanThree 3 Fan Bool
FTRFanFour 4 Fan Bool
FTROneNimTwo 1 Nim 2 Bool
FTROneNimThree 1 Nim 3 Bool
FTROneNimFour 1 Nim 4 Bool
FTRTwoNimOne 2 Nim 1 Bool
FTRTwoNimThree 2 Nim 3 Bool
FTRTwoNimFour 2 Nim 4 Bool
FTRThreeNimOne 3 Nim 1 Bool
FTRThreeNimTwo 3 Nim 2 Bool
FTRThreeNimFour 3 Nim 4 Bool
Copyright © SA Gaming 2019 All right reserved 74/84
TECHNICAL GUIDE
FTRFourNimOne 4 Nim 1 Bool
FTRFourNimTwo 4 Nim 2 Bool
FTRFourNimThree 4 Nim 3 Bool
FTRKwokOneTwo 12 Kwok Bool
FTRKwokOneFour 14 Kwok Bool
FTRKwokTwoThree 23 Kwok Bool
FTRKwokThreeFour 34 Kwok Bool
FTROneTongTwoThree 23 Tong 1 Bool
FTROneTongTwoFour 24 Tong 1 Bool
FTROneTongThreeFour 34 Tong 1 Bool
FTRTwoTongOneThree 13 Tong 2 Bool
FTRTwoTongOneFour 14 Tong 2 Bool
FTRTwoTongThreeFour 34 Tong 2 Bool
FTRThreeTongOneTwo 12 Tong 3 Bool
FTRThreeTongOneFour 14 Tong 3 Bool
FTRThreeTongTwoFour 24 Tong 3 Bool
FTRFourTongOneTwo 12 Tong 4 Bool
FTRFourTongOneThree 13 Tong 4 Bool
FTRFourTongTwoThree 23 Tong 4 Bool
FTRChunOneTwoThree 123 Chun Bool
FTRChunOneTwoFour 124 Chun Bool
FTRChunOneThreeFour 134 Chun Bool
FTRChunTwoThreeFour 234 Chun Bool
Roulette
Copyright © SA Gaming 2019 All right reserved 75/84
TECHNICAL GUIDE
GameResult of Roulette
Name Description Type and Limit
Point 0 to 36 Int
ResultDetail Details of the result Structure
BetType for Roulette
ID Description ID Description
0~36 0~36 97 0,1,2
37 0,1 98 0,2,3
38 0,2 99 1,2,3
39 0,3 100 4,5,6
40 1,2 101 7,8,9
41 1,4 102 10,11,121
42 2,3 103 13,14,15
43 2,5 104 16,17,18
44 3,6 105 19,20,21
45 4,5 106 22,23,24
46 4,7 107 25,26,27
47 5,6 108 28,29,30
48 5,8 109 31,32,33
49 6,9 110 34,35,36
50 7,8 111 1,2,4,5
51 7,10 112 2,3,5,6
52 8,9 113 4,5,7,8
53 8,11 114 5,6,8,9
Copyright © SA Gaming 2019 All right reserved 76/84
TECHNICAL GUIDE
54 9,12 115 7,8,10,11
55 10,11 116 8,9,11,12
56 10,13 117 10,11,13,14
57 11,12 118 11,12,14,15
58 11,14 119 13,14,16,17
59 12,15 120 14,15,17,18
60 13,14 121 16,17,19,20
61 13,16 122 17,18,20,21
62 14,15 123 19,20,22,23
63 14,17 124 20,21,23,24
64 15,18 125 22,23,25,26
65 16,17 126 23,24,26,27
66 16,19 127 25,26,28,29
67 17,18 128 26,27,29,30
68 17,20 129 28,29,31,32
69 18,21 130 29,30,32,33
70 19,20 131 31,32,34,35
71 19,22 132 32,33,35,36
72 20,21 133 1,2,3,4,5,6
73 20,23 134 4,5,6,7,8,9
74 21,24 135 7,8,9,10,11,12
75 22,23 136 10,11,12,13,14,15
76 22,25 137 13,14,15,16,17,18
77 23,24 138 16,17,18,19,20,21
78 23,26 139 19,20,21,22,23,24
79 24,27 140 22,23,24,25,26,27
Copyright © SA Gaming 2019 All right reserved 77/84
TECHNICAL GUIDE
80 25,26 141 25,26,27,28,29,30
81 25,28 142 28,29,30,31,32,33
82 26,27 143 31,32,33,34,35,36
83 26,29 144 1st 12 (1~12)
84 27,30 145 2nd 12 (13~24)
85 28.29 146 3rd 12 (25~36)
86 28,31 147 1st Row (1~34)
87 29,30 148 2nd Row (2~35)
88 29,32 149 3rd Row (3~36)
89 30,33 150 1~18 (Small)
90 31,32 151 19~36 (Big)
91 31,34 152 Odd
92 32,33 153 Even
93 32,35 154 Red
94 33,36 155 Black
95 34,35 156 0,1,2,3
96 35,36
ResultDetail for Roulette
Name Description Type and Limit
RRZero 0 Bool
RROne 1 Bool
RRTwo 2 Bool
RRThree 3 Bool
RRFour 4 Bool
RRFive 5 Bool
Copyright © SA Gaming 2019 All right reserved 78/84
TECHNICAL GUIDE
RRSix 6 Bool
RRSeven 7 Bool
RREight 8 Bool
RRNine 9 Bool
RRTen 10 Bool
RREleven 11 Bool
RRTwelve 12 Bool
RRThirteen 13 Bool
RRForteen 14 Bool
RRFifthteen 15 Bool
RRSixteen 16 Bool
RRSeventeen 17 Bool
RREighteen 18 Bool
RRNineteen 19 Bool
RRTwenty 20 Bool
RRTwentyOne 21 Bool
RRTwentyTwo 22 Bool
RRTwentyThree 23 Bool
RRTwentyFour 24 Bool
RRTwentyFive 25 Bool
RRTwentySix 26 Bool
RRTwentySeven 27 Bool
RRTwentyEight 28 Bool
RRTwentyNine 29 Bool
RRThirty 30 Bool
RRThirtyOne 31 Bool
Copyright © SA Gaming 2019 All right reserved 79/84
TECHNICAL GUIDE
RRThirtyTwo 32 Bool
RRThirtyThree 33 Bool
RRThirtyFour 34 Bool
RRThirtyFive 35 Bool
RRThirtySix 36 Bool
RRSet1 1st 12 (1~12) Bool
RRSet2 2nd 12 (13~24) Bool
RRSet3 3rd 12 (25~36) Bool
RRRow1 1st Row (1~34) Bool
RRRow2 2nd Row (2~35) Bool
RRRow3 3rd Row (3~36) Bool
RR1To18 Small Bool
RR19To36 Big Bool
RROdd Odd Bool
RREven Even Bool
RRRed Red Bool
RRBlack Black Bool
Copyright © SA Gaming 2019 All right reserved 80/84
TECHNICAL GUIDE
Multiplayer games
Fishermen Gold
This game requires fund to transfer from SA Platform to Fishermen Gold while starting up the game, and all funds will be transferred back to SA Platform when the game finished. If there is paid bet (not free bullet) or payout occurred (e.g. by free bullet), a bet record will be existing. The Details of this transaction will contain the name “Fishermen Gold” string.
Copyright © SA Gaming 2019 All right reserved 81/84
TECHNICAL GUIDE
10. Host ID to Game mapping
ID Game
401 EGame
402 Mini game
601 Baccarat 1
602 Baccarat 2
603 Baccarat 3
604 Baccarat 4
605 Baccarat 5
606 Baccarat 6
607 Baccarat 7
608 Baccarat 8
609 Baccarat 9
610 Baccarat 10
619 Baccarat 11
620 Baccarat 12
621 Baccarat 13
611 (remove on 4/15) Baccarat 11
612 (remove on 4/15) Baccarat 12
613 (remove on 4/15) Baccarat 13
614 Baccarat 14
615 Baccarat 15
616 Baccarat 16
630 Roulette
Copyright © SA Gaming 2019 All right reserved 82/84
TECHNICAL GUIDE
631 Sic Bo
632 Fan Tan
640 Dragon & Tiger
11. EGame ID/Game Code to Game mapping
➤ EGame Please contact our customer service representative to get the latest list of EGame game codes and graphics materials. ➤ Fishermen Gold multiplayer game
Game Game code
Fishermen Gold FishermenGold
12. Supported currencies
The following is the list of currencies we supported. Please notice that currency has to be enabled in your api account before you can use it, you may contact our CS for queries.
Currency ISO name Currency
CNY Chinese yen
USD US Dollar
EUR Euro
JPY Japanese yen
VND* Vietnamese Dong
AUD Australian Dollar
TWD Taiwan New Dollar
Copyright © SA Gaming 2019 All right reserved 83/84
TECHNICAL GUIDE
MYR Malaysian Ringgit
IDR* Indonesian Rupiah
SGD Singapore Dollar
GBP British Pound
THB Thai Baht
TRY Turkish Lira
UAH Ukrainian Hryvnia
mXBT milli Bitcoin
BND Bruneian Dollar
CAD Canadian Dollar
MMK* Burmese Kyat
NOK Norwegian Krone
SEK Swedish Krone
ZAR South Africa Rand
BDT Bangladeshi Taka
LKR Sri Lankan Rupee
INR Indian Rupee
RUB Russian Ruble
PLN Polish Zloty
AED Emirati Dirham
KHR* Cambodian Riel
BRL Brazilian Real
In our system, currency with * is divided by 1000 from real world currency.
Copyright © SA Gaming 2019 All right reserved 84/84