Web Service API v1.0.2

Technical Guide

1.Introduction

The Web Service API interface is for accessing the SimplePlay 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

VersionDescriptionDate
1.0.0Initial version2019/05/09
1.0.1Added support to launch game lobby function in LoginRequest and LoginRequestForFun2019/08/30
1.0.2Seamless wallet PlaceBet, PlayerWin, PlayerLost and PlaceBetCancel contains timestamp
Seamless wallet PlaceBet contains IP
2020/03/25

3.API Calling Restriction Information

The following APIs have calling restriction.

Name of APIFrequency of calls
GetAllBetDetailsEvery 5 minutes no more than 5 calls
GetAllBetDetailsForTimeIntervalEvery 5 minutes no more than 5 calls
JackpotQueryEvery 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

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:

  • Secret Key
  • EncrypKey
  • MD5Key
  • API URL
  • Lobby game client loader
  • Lobby name (supplied during startup the client)

Example DES Encrypt function in ASP.Net C#:

Example DES Encrypt function in PHP:

Example in PHP:

Example MD5 function in ASP.Net C#:

Example MD5 function in PHP:

4.2.Encryption Procedures

  • Construct a Query String (QS) with required parameters (including the web service method name itself (e.g. method=RegUserInfo)
  • DES encrypt the Query String with the supplied EncryptKey and obtain the encrypted query string (q)
  • Build an MD5 hash according to (QS) and other parameters to form a signature (s)
  • Use HTTP POST request to call the web service.
  • Obtain the resulting XML response.

4.3.Example to call API

Let’s take RegUserInfo as an example.

Encryption requires the following 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):

For example, q = ‘j4tjorjwarfj3trwise0safrwg2wt4awari0fwjfeoh’

Example MD5 String for building the signature (QS + md5key + Time + Key):

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

4.4.Error handling

If there are decryption error or the md5 not matching, a generic error response will be output.

ErrorMsgId 128 for decryption error.
ErrorMsgId 132 for md5 sign unmatch.

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
NameDescriptionType and LimitRequired?
methodMust be "RegUserInfo"String (32)Y
KeySecret keyString (32)Y
TimeCurrent time in "yyyyMMddHHmmss" formatDateTimeY
UsernameUser name. Alphanumeric (5~20 characters)String (20)Y
CurrencyTypeCurrency:
USD
Refer to Supported currencies
String (4)Y
Result
NameDescriptionType and LimitRequired?
UsernameUser nameStringY
ErrorMsgIdError message:
0: Success
108: Username length/format incorrect
113: Username duplicated
114: Currency not exist
133: Create user failed
ByteY
ErrorMsgError message detailsStringY

5.1.2.VerifyUsername

Check if a username is already existing in database of a lobby.

Parameters
NameDescriptionType and LimitRequired?
methodMust be “VerifyUsername"String (32)Y
KeySecret keyString (32)Y
TimeCurrent time in “yyyyMMddHHmmss” formatDateTimeY
UsernameUser nameString (20)Y
Result
NameDescriptionType and LimitRequired?
IsExistUser existing?
True: user existing
False: user not existing
BoolY
UsernameUser nameString (20)Y
ErrorMsgIdError message:
0: Success
108: Username length/format incorrect
ByteY
ErrorMsgError message detailsStringY

Output

 

5.1.3.GetUserStatus

The status of a user including:

  • Online/offline
  • Bet exist
  • Bet amount and remain balance
  • Maximum balance
  • Maximum daily winning
Parameters
NameDescriptionType and LimitRequired?
methodMust be "GetUserStatus"String (32)Y
KeySecret keyString (32)Y
TimeCurrent time in "yyyyMMddHHmmss" formatDateTimeY
UsernameUsernameString (20)Y
Result
NameDescriptionType and LimitRequired?
IsSuccessSuccess?
True: Success
False: Failed
BoolY
UsernameUsernameStringY
BalanceActive balance, excluding betted amount. Correct to cent.DecimalY
OnlineOnline?BoolY
BettedBetted?BoolY
BettedAmountTotal betted amountDecimalY
MaxBalanceThe upper limit in user's balance to place betDecimalY
MaxWinningDaily winning limitation to allow place betDecimalY
WithholdAmountAmount withhold in the system from the balanceDecimal Y
ErrorMsgIdError message
0: Success
100: Username error
108: Username length/format incorrect
116: Username does not exist
ByteY
ErrorMsgError message detailStringY

Output

5.1.4.SetUserMaxBalance

Set the maximum balance limit to a user. This only apply to transfer wallet.

Parameters
NameDescriptionType and LimitRequired?
methodMust be "SetUserMaxBalance"String (32)Y
KeySecret keyString (32)Y
TimeCurrent time in "yyyyMMddHHmmss" formatDateTimeY
UsernameUsernameString (20)Y
MaxBalanceMaximum balanceDecimalY
Result
NameDescriptionType and LimitRequired?
ErrorMsgIdError message:
0: Success
116: Username does not exist
142: Parameter(s) error
148: MaxBalance not zero or smaller than user balance
ByteY
ErrorMsgError message detailStringY

5.1.5.SetUserMaxWinning

Set the user’s maximum daily winning. User cannot place bet if his winning exceed this setting.

Parameters
NameDescriptionType and LimitRequired?
methodMust be "SetUserMaxWinning"String (32)Y
KeySecret keyString (32)Y
TimeCurrent time in "yyyyMMddHHmmss" formatDateTimeY
UsernameUsernameString (20)Y
MaxWinningMaximum daily winningDecimalY
Result
NameDescriptionType and LimitRequired?
ErrorMsgIdError message:
0: Success
116: Username does not exist
142: Parameter(s) error
ByteY
ErrorMsgError message detailStringY

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
NameDescriptionType and LimitRequired?
methodMust be “LoginRequest”String (32)Y
KeySecret keyString (32)Y
Timecurrent time in “yyyyMMddHHmmss” formatDateTimeY
UsernameUser name
(5 ~ 20 characters)
String (20)Y
CurrencyTypeCurrency:
USD
Refer to Supported currencies
String (4)Y
GameCode(Optional)
Without GameCode will return a GameURL to enter "Game Lobby"
With GameCode will reuturn a GameURL to directly enter "Slot Game" or "Fishing Game"

Game code string, refer to Game code section
String (16)N
LangLanguage codeStringN
MobileMobile version
1 - Enable mobile
0 - Disable mobile
BoolN
Lang parameter
CodeDescription
zh_TWTraditional Chinese
zh_CNSimplified Chinese
en_USEnglish
thThai
vnVietnamese
jpJapanese
idBahasa Indonesia
itItaliano*
msMalay*
esSpanish*

* Only support Fishing game.

Result
NameDescriptionType and LimitRequired?
Token#Token for loginStringY
DisplayName*Internal assigned usernameString (31)Y
GameURLComplete URL to launch "Game Lobby", "Slot Game" or "Fishing Game".

Follow the different instruction to launch the games:
Game Lobby
Slot Game
Fishing Game
StringN
ErrorMsgIdError 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
ByteY
ErrorMsgError message detailStringY

# 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!

5.2.2.LoginRequestForFun

Login to the system in Fun mode. The username will be generated automatically.

Parameters
NameDescriptionType and LimitRequired?
methodMust be “LoginRequestForFun”String (32)Y
KeySecret keyString (32)Y
Timecurrent time in “yyyyMMddHHmmss” formatDateTimeY
AmountInitial amountDecimalY
CurrencyTypeCurrency:
USD
Refer to Supported currencies
String (4)Y
GameCode(Optional)
Without GameCode will return a GameURL to enter "Game Lobby"
With GameCode will reutnr a GameURL to directly enter "Slot Game" or "Fishing Game"

Game code string, refer to Game code section
String (16)N
LangLanguage codeStringN
MobileMobile version
1 - Enable mobile
0 - Disable mobile
BoolN
Result
NameDescriptionType and LimitRequired?
Token#Token for loginStringY
DisplayName*Internal assigned usernameString (31)Y
GameURLComplete URL to launch "Game Lobby", "Slot Game" or "Fishing Game".

Follow the different instruction to launch the games:
Game Lobby
Slot Game
Fishing Game
StringN
ErrorMsgIdError message:
0: Success
129: System under maintenance
134: Game code not found
135: Game access denied
ByteY
ErrorMsgError message detailStringY

# 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!

5.2.3.KickUser

Kick user to offline.

Parameters
NameDescriptionType and LimitRequired?
methodMust be "KickUser"String (32)Y
KeySecret keyString (32)Y
TimeCurrent time in "yyyyMMddHHmmss" formatDateTimeY
UsernameUser nameString (20)Y
Result
NameDescriptionType and LimitRequired?
ErrorMsgIdError message:
0: Success
104: Service not available
108: Username length/format incorrect
116: Username does not exist
125: Kick user fail
ByteY
ErrorMsgError message detailStringY

Output

5.3.Bet Records Query

5.3.1.GetAllBetDetails

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
NameDescriptionType and LimitRequired?
methodMust be "GetAllBetDetails"String (32)Y
KeySecret keyString (32)Y
TimeCurrent time in "yyyyMMddHHmmss" formatDateTimeY
UsernameUser nameString (20)N
DateDate for details “yyyy-MM-dd”
DateN
Result
NameDescriptionType and LimitRequired?
BetDetailListBet details structureXMLY
ErrorMsgIdError message:
0: Success
108: Username length/format incorrect
112: API recently called
116: Username does not exist
142: Parameter(s) error
ByteY
ErrorMsgError message detailStringY
BetDetail structure
NameDescriptionType and LimitRequired?
BetTimeBet start timeDate TimeY
PayoutTimePayout timeDate TimeY
UsernamePlayer nameString(31)Y
DetailGame code
StringN
GameIDGame IDStringY
BetIDBet IDInt64Y
BetAmountBet amountDecimalY
RollingRollingDecimalY
ResultAmountPayoutDecimalY
BalanceBalance after this betDecimalY
GameTypeGame type.
slot - Slot Game
multiplayer - Fishing Game
StringY
BetSource
2/2114/2640Web
16/600/8792/8793Mobile Web
1160/1161/5248/5249iOS app
1288/1289/5376/5377Android app
IntY
TransactionIDSeamless wallet PlaceBet transaction ID.
-1 if not using seamless wallet
Int64Y

Output

5.3.2.GetAllBetDetailsForTimeInterval

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 is 5 times per 5 minutes otherwise it will throw an error.

Parameters
NameDescriptionType and LimitRequired?
methodMust be "GetAllBetDetailsForTimeInterval"String (32)Y
KeySecret keyString (32)Y
TimeCurrent time in "yyyyMMddHHmmss" formatDateTimeY
UsernameUser nameString (20)N
FromTimeDate for details “yyyy-MM-dd HH:mm:ss”
Date TimeY
ToTimeDate for details “yyyy-MM-dd HH:mm:ss”
Date TimeY
Result
NameDescriptionType and LimitRequired?
BetDetailListBet details structureXMLY
ErrorMsgIdError 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
ByteY
ErrorMsgError message detailStringY

BetDetails is the same as GameAllBetDetails.

5.3.3.GetUserBetAmount

This Web service will fetch the stake amount for a lobby.

Parameters
NameDescriptionType and LimitRequired?
methodMust be "GetUserBetAmount"String (32)Y
KeySecret keyString (32)Y
TimeCurrent time in "yyyyMMdddHHmmss" formatDateTimeY
UsernameUsernameString (20)N
StartDateStart time (default current date):
"yyyy-MM-dd HH:mm:ss"
DateTimeN
TimeRangeRange in hour from 0 to 23
(default 0 = 24 hours)
IntN
Result
NameDescriptionType and LimitRequired?
UsernameUsernameString (20)Y
StakeAmountSum of bet amount for all gamesDecimalY
ErrorMsgIdError message:
0: Success
108: Username length/format incorrect
116: Username does not exist
ByteY
ErrorMsgError message detailStringY

5.3.4.GetUserWinLost

This API function is to get a user’s win/loss summary for a period of time with maximum of 31 days.

Parameters
NameDescriptionType and LimitRequired?
methodMust be "GetUserWinLost"String (32)Y
KeySecret keyString (32)Y
TimeCurrent time in "yyyyMMddHHmmss" formatDateTimeY
UsernameUsernameString (20)Y
FromTimeStart date and time:
"yyyy-MM-dd HH:mm:ss"
DateTimeY
ToTimeEnd of date and time:
"yyyy-MM-dd HH:mm:ss"
DateTimeY
Type0 - includes win and loss
1 - only includes win
2 - only includes loss
IntN
Result
NameDescriptionType and LimitRequired?
UsernameUsernameString (20)Y
WinlostWin or loss summary valueDecimalY
ErrorMsgIdError 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
ByteY
ErrorMsgError message detailStringY

5.3.5.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
NameDescriptionType and LimitRequired?
methodMust be "GetTransactionDetails"String (32)Y
KeySecret keyString (32)Y
TimeCurrent time in "yyyyMMddHHmmss" formatDateTimeY
Username Username String (20)N
FromTimeStart date and time:
"yyyy-MM-dd HH:mm:ss"
DateTimeY
ToTimeEnd date and time:
"yyyy-MM-dd HH:mm:ss"
DateTimeY
Result
NameDescriptionType and LimitRequired?
CountNumber of transactionsInteger 32bitY
WinlostWin/loseDecimalY
TotalBetTotal bet amountDecimalY
ErrorMsgIdError message:
0: Success
106: Server not ready
111: Query time range out of limitation
116: Username does not exist
ByteY
ErrorMsgError message detailStringY

5.3.6.GetSlotDetailsURL

This web service will generate the URL for display the game details of one Bet ID.

Parameters:
NameDescriptionType and LimitRequired?
methodmust be “GetSlotDetailsURL ”String (32)Y
Keysecret keyString (32)Y
Timecurrent time in “yyyyMMddHHmmss” formatDateTimeY
BetIDBet ID of the slot gameString (20)Y
Result:
NameDescriptionType and LimitRequired?
URLFull URL to display the details reportStringY
ErrorMsgIdError message
0: Success
153: Bet ID not existing
ByteY
ErrorMsgError message detailStringY

5.3.7.GetFishermenGoldBetDetails

This Web service will fetch bet details for one fishing game session.

Parameters
NameDescriptionType and LimitRequired?
methodMust be "GetFishermenGoldBetDetails"String (32)Y
KeySecret keyString (32)Y
TimeCurrent time in "yyyyMMddHHmmss" formatDateTimeY
GameIdFishermen Gold game id.String (32)Y
PagePage of records, starting from 0IntY
Result
NameDescriptionType and LimitRequired?
BetAmountTotal bet amount (Coin)Int64Y
WinAmountTotal winning amount (Coin)Int64Y
CurrencyCurrencyString (4)Y
ExchangeRateCoin to currency exchange rateIntY
CountTotal bullet record countIntY
ItemCountNumber of item queriedIntY
LimitNumber of item per pageIntY
BulletDetailsListList of structure of a bullet detailsXMLY
ErrorMsgIdError message:
0: Success
102: Secret key incorrect
106: Server not ready
152: Game Id does not exist
ByteY
ErrorMsgError message detailStringY
BulletDetails structure
NameDescriptionType and LimitRequired?
DenomDenominationIntY
IDBullet IDInt64Y
MultiplierMultiplierIntY
CostCost of the bullet (Coin)IntY
RewardReward of the bullet (Coin)IntY
SpeciesFish IDIntY
FreeBulletTotalTotal of free bullet IntY
FreeBulletRemainRemains of free bulletIntY
FreeBulletRewardRewarded bullet of this shootIntY

 

5.4.Miscellaneous Functions

5.4.1.JackpotQuery

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
NameDescriptionType and LimitRequired?
methodMust be "JackpotQuery"String (32)Y
KeySecret keyString (32)Y
TimeCurrent time in "yyyyMMddHHmmss" formatDateTimeY
CurrencyCurrency:
USD
Refer to Supported currencies
String (4)N
Result
NameDescriptionType and LimitRequired?
MajorMajor meter (in cents)Int64Y
MinorMinor meter (in cents)Int64Y
MiniMini meter (in cents)Int64Y
ErrorMsgIdError message:
0: Success
104: Service is not available
ByteY
ErrorMsgError message detailStringY

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 not be processed twice. Using a new OrderID for the same transfer may cause a duplicate transfer. Even you have checked the OrderID not existing by using CheckOrderID, you should still use the same OrderID.

5.5.1.DebitBalance

Transfer from the user’s balance.

Parameters
NameDescriptionType and LimitRequired?
methodMust be "DebitBalance"String (32)Y
KeySecret keyString (32)Y
TimeCurrent time in "yyyyMMddHHmmss" formatDateTimeY
UsernameUsername
Alphanumeric (5~20 characters)
String (20)Y
OrderIdOrder ID: OUT+YYYYMMDDHHMMSS+Username
e.g. “OUT20131129130345peter1235”
String (40)Y
DebitAmountDebit amount. Maximum two decimal only.DecimalY
Result
NameDescriptionType and LimitRequired?
UsernameUsernameStringY
BalanceRemained active balanceDecimalY
DebitAmountDebited amountDecimalY
OrderIdOrder ID String (40)Y
ErrorMsgIdError 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
ByteY
ErrorMsgError message detailStringY

5.5.2.DebitAllBalance

Transfer all amount from the user’s balance.

Parameters
NameDescriptionType and LimitRequired?
methodMust be "DebitAllBalance"String (32)Y
KeySecret keyString (32)Y
TimeCurrent time in "yyyyMMddHHmmss" formatDateTimeY
UsernameUsernameString (20)Y
OrderIdOrder ID: OUT+YYYYMMDDHHMMSS+Username
e.g. “OUT20131129130345peter1235”
String (40)Y
Result
NameDescriptionType and LimitRequired?
UsernameUsernameStringY
DebitAmountDebited amountDecimalY
OrderIdOrder ID String (40)Y
ErrorMsgIdError message:
0: Success
106: Server not ready. Try again later.
116: Username does not exist
122: Order ID already exists
124: Database error
127: Invalid order ID format
ByteY
ErrorMsgError message detailStringY

5.5.3.CreditBalance

Transfer fund to user’s balance.

Parameters
NameDescriptionType and LimitRequired?
methodMust be "CreditBalance"String (32)Y
KeySecret keyString (32)Y
TimeCurrent time in "yyyyMMddHHmmss" formatDateTimeY
UsernameUsernameString (20)Y
OrderIdOrder ID: IN+YYYYMMDDHHMMSS+Username
e.g. “IN20131129130345peter1235”
String (40)Y
CreditAmountCredit amount. DecimalY
Result
NameDescriptionType and LimitRequired?
UsernameUsernameStringY
BalanceRemained active balanceDecimalY
CreditAmountCredited amount.DecimalY
OrderIdOrder IDStringY
ErrorMsgIdError 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
ByteY
ErrorMsgError message detailStringY

5.5.4.CheckOrderId

Check the OrderId that generated in DebitBalance/DebitAllBalance/CreditBalance is existing or not in our system.

Parameters
NameDescriptionType and LimitRequired?
methodMust be "CheckOrderId"String (32)Y
KeySecret keyString (32)Y
TimeCurrent time in "yyyyMMddHHmmss" formatDateTimeY
OrderIdThe OrderId used in
  • DebitBalance
  • DebitAllBalance
  • CreditBalance
String (40)Y
Result
NameDescriptionType and LimitRequired?
isExistThe OrderId exist or not
  • True - Existing
  • False - Not existing
boolY
ErrorMsgIdError message:
0: Success
106: Server not ready. Try again later.
124: Database error
127: Invalid order ID format
ByteY
ErrorMsgError message detailStringY

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:

  • GetUserBalance
  • 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
    • 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. SimplePlay 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 SimplePlay platform to call:

E.g.:

  • /GetUserBalance.aspx
  • /PlaceBet.aspx
  • /PlayerWin.aspx
  • /PlayerLost.aspx
  • /PlaceBetCancel.aspx

** Operator can only use ONE type of extension, no multiple extension is allowed.

6.3.Seamless Wallet Protocol

SimplePlay 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 SimplePlay platform sends to external wallet before encryption:

6.3.1.Encryption procedures

We will use DES CBC encryption. The following are the example of DES Encrypt/Decrypt function:

ASP.Net version

PHP version

 

6.3.2.POST

After encrypted the request string, we will POST the encrypted string with urlencoded as plain text:

Partner system have to urldecode 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:

6.4.GetUserBalance

This request is send to the partner system to retrieve the balance of a user.

Input parameters:
NameDescriptionType and LimitRequired?
usernameUsername of the userString (20)Y
currencyISO 3 characters e.g. USD. Except mXBTString (4)Y

E.g.

Response parameters:
NameDescriptionType and LimitRequired?
usernameUsername of the userString (20)Y
currencyISO 3 characters e.g. USD. Except mXBTString (4)Y
amountDecimal format and max. 2 decimal placesDecimalY
errorError codeIntY

6.5.Fund Transfer

SimplePlay 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, SimplePlay 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.

Parameters:
NameDescriptionType and LimitRequired?
usernameUsername of the userString (20)Y
currencyISO 3 characters e.g. USDString (4)Y
amountAmount to bet (decimal format and max. 2 decimal places)DecimalY
txnidA unique id for all fund transferString (16)Y
timestampTimestamp in yyyy-MM-dd HH:mm:ss.fff (GMT +8)
E.g. 2020-03-22 12:34:56.123
DateTimeY
ipIP of the user StringY
gametypeGame type
slot - Slot Game
multiplayer - Fishing Game
StringY
platform0 - desktop
1 - mobile
ByteY
gamecodeGame code of the gameStringN
gameidGame IDStringY
Response parameters:
NameDescriptionType and LimitRequired?
usernameUsername of the userString (20)Y
currencyISO 3 characters e.g. USD. Except mXBTString (4)Y
amount Amount after adjustment (decimal format and max. 2 decimal places)DecimalY
errorError codeIntY

6.5.2.PlayerWin

When a game completed and the player win (even bet return when result is Tie in Baccarat) PlayerWin will send to partner system to adjust the balance of the player. This request will keep trying if partner system no response or respond error.

Parameters:
NameDescriptionType and LimitRequired?
usernameUsername of the userString (20)Y
currencyISO 3 characters e.g. USDString (4)Y
amountAmount to add back (decimal format and max. 2 decimal places)DecimalY
txnidA unique id for all fund transferString (16)Y
timestampTimestamp in yyyy-MM-dd HH:mm:ss.fff (GMT +8)
E.g. 2020-03-22 12:34:56.123
DateTimeY
gametypeGame type
slot - Slot Game
multiplayer - Fishing Game
StringY
gamecodeGame code of the gameStringN
PayouttimeTime of the payoutDateTimeY
gameidGame IDStringY
Response parameters:
NameDescriptionType and LimitRequired?
usernameUsername of the userString (20)Y
currencyISO 3 characters e.g. USD. Except mXBTString (4)Y
amount Amount after adjustment (decimal format and max. 2 decimal places)DecimalY
errorError codeIntY

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.

Parameters:
NameDescriptionType and LimitRequired?
usernameUsername of the userString (20)Y
currencyISO 3 characters e.g. USDString (3)Y
txnidA unique id for all fund transferString (16)Y
timestampTimestamp in yyyy-MM-dd HH:mm:ss.fff (GMT +8)
E.g. 2020-03-22 12:34:56.123
DateTimeY
gametypeGame type
slot - Slot Game
multiplayer - Fishing Game
StringY
gamecodeGame code of the gameStringN
PayouttimeTime of the payoutDateTimeY
gameidGame IDStringY
Response parameters:
NameDescriptionType and LimitRequired?
usernameUsername of the userString (20)Y
currencyISO 3 characters e.g. USD. Except mXBTString (4)Y
amount Amount after adjustment (decimal format and max. 2 decimal places)DecimalY
errorError codeIntY

6.5.4.PlaceBetCancel

If a PlaceBet request timeout or partner system responded an error, a PlaceBetCancel request will send to partner system. The SimplePlay 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.

Parameters:
NameDescriptionType and LimitRequired?
usernameUsername of the userString (20)Y
currencyISO 3 characters e.g. USDString (4)Y
amountAmount to add back (decimal format and max. 2 decimal places)DecimalY
txnidA unique id for all fund transferString (16)Y
timestampTimestamp in yyyy-MM-dd HH:mm:ss.fff (GMT +8)
E.g. 2020-03-22 12:34:56.123
DateTimeY
gametypeGame type
slot - Slot Game
multiplayer - Fishing Game
StringY
gamecodeGame code of the gameStringN
gameidGame IDStringY
txn_reverse_idPrevious txnid in PlaceBet request which the response was not received within 3 seconds or responded with an error.String (16)Y
Response parameters:
NameDescriptionType and LimitRequired?
usernameUsername of the userString (20)Y
currencyISO 3 characters e.g. USD. Except mXBTString (4)Y
amount Amount after adjustment (decimal format and max. 2 decimal places)DecimalY
errorError codeIntY

6.6.Important notice

Normally, the PlaceBet and PlayerWin / PlayerLost are paired in the slot game and the fishing game. However, the fishing game does have an exception.

In case a player played a round of the 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:

IDDescription
0Success
1000User account doesn’t exist
1001Invalid currency
1002Invalid amount
1003Locked account
1004Insufficient balance
1005General error
1006Decryption error
1007Session expired error
9999System error

7.Error message code reference

Common error message code

IDDescription
100Username error
101Account locked
102Secret key incorrect
104Service not available
105Client side error
106Server busy. Try again later.
107Username empty
108Username length/format incorrect
110User not online
111Query time range out of limitation
112API recently called
113Username duplicated
114Currency not exist
116Username does not exist
120Amount must greater than zero
121Not enough points to credit/debit/bet
122Order ID already exists
125Kick user fail
127Invalid order ID format
128Decryption error
129System under maintenance
130User account is locked (disabled)
132Sign unmatch
133Create user failed
134Game code not found
135Game access denied
136Not enough point to bet
142Parameter(s) error
144Query type invalid
145Parameter decimal point greater than 2
146API access denied
148MaxBalance not zero or smaller than user balance
149Input amount under minimum value
150Function has been deprecated
151Duplicate login
152Game id not existing
153Bet ID not existing

8.Game Launching Procedures

8.1.Game Lobby

You may use the GameURL returned from LoginRequest or LoginRequestForFun to enter the game lobby. The following are all parameters used. You are free to append extra parameters to have your needs.

ParameterDescriptionTypePreset?
tokenTokenStringY
nameDisplayName or you can specifyStringY
languageLanguage to launch the slot, see belowStringY
mobileHTML mobile modeBool (true/false)Y
lobbycodeLobby codeStringY
returnurlThe URL will be invoked when the slot game logged out (optional)StringN

8.2.Slot Game

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.

ParameterDescriptionTypePreset?
tokenTokenStringY
nameDisplayName or you can specifyStringY
languageLanguage to launch the slot, see belowStringY
mobileHTML mobile modeBool (true/false)Y
lobbycodeLobby codeStringY
returnurlThe URL will be invoked when the slot game logged out (optional)StringN
skipintroTo skip the introduction video of some slot games (optional)
1 - skip
Bool (1/0)N

8.3.Fishing Game

The returned GameURL has been constructed to use directly, however, you may append returnurl=https://www.yourdomain.com/somewhere parameter the same as Slot Game. 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.

ParameterDescriptionType
returnurlThe URL will be invoked when the Fishermen Gold logout (optional)String
unTo override the displayed username come from system (optional)String

9.Slot Game ID/Game Code to Game mapping

GameGame code
Slot GamePlease refer to this page for details.
Fishing GameEG-FISHING-001

10.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 nameCurrency
CNYChinese yen
USDUS Dollar
EUREuro
JPYJapanese yen
VND*Vietnamese Dong
AUDAustralian Dollar
TWDTaiwan New Dollar
MYRMalaysian Ringgit
IDR*Indonesian Rupiah
SGDSingapore Dollar
GBPBritish Pound
THBThai Baht
TRYTurkish Lira
UAHUkrainian Hryvnia
mXBTmilli Bitcoin
BNDBruneian Dollar
CADCanadian Dollar
MMK*Burmese Kyat
NOKNorwegian Krone
SEKSwedish Krone
ZARSouth Africa Rand
BDTBangladeshi Taka
LKRSri Lankan Rupee
INRIndian Rupee
RUBRussian Ruble
PLNPolish Zloty
AEDEmirati Dirham
KHR*Cambodian Riel
BRLBrazilian Real
CHFSwiss Franc
NZDNew Zealand Dollar
HUFHungarian Forint

In our system, currency with * is divided by 1000 from real-world currency.

Suggest Edit