Seamless Wallet 2.0 document

[ v 1.0.2 ]

[Back to api document]

What is Seamless Wallet?

Seamless wallet allows your players to play seamlessly across all of our products from the account and credit that they already registered on your site.
If you are interested in this feature, please contact us for further assistance.


How it works?

When a user place a bet

First, we will check the balance on user account. We will invoke the API request, and you should send the balance of the account back to us.
Please refer to Get member balance

If user don't have enough amount of balance, we will not accept the bet.
If user has enough amount of balance to place bet, we will inquire you to deduct the stake from user account.
Please refer to Deduct stake

After the bet was accepted

We will send the result of bet for you. Please refer to Settle bet
If we rollback the bet, we will send rollback request to inform you. Please refer to Rollback
If we canceled the bet, we will send cancel request to inform you. Please refer to Cancel bet


What is the different between Seamless Wallet and Seamless Wallet 2.0?

Seamless Wallet 2.0 can be used in all of the SBO products such like Sports, Live Casinos, SBO Games and either 3rd Party Games (also named Seamless Game Provider's Games), but the old version can only support Sports, Live Casino and SBO Games.
Although the flow are the same in these two versions, the response parameters in Seamless Wallet 2.0 will not be the same as the old vserion, so please be awared that Seamless Wallet and Seamless Wallet 2.0 can not be used in one service together.
According to the above reason, we are recommand your side to implement the Seamless Wallet 2.0.


Note: When open Sv388Cockfighting games need to implement ReturnStake API

Seamless Wallet API Testing Web Site

You can follow these steps below, and use this web site to test your seamless wallet api

seamlessWalletTestingFlow

Flow chart

seamlessWalletFlow

Bet Status

Bet status in your system should be implemented as following figure: running, settled and void.

betStatus

Protocol


All the API request is made through HTTP post

 ● All the request will come with the following format:
    1.Header:
        Content-Type: application/json; charset=UTF-8
    2.Body:
        {"CompanyKey":"7b277d9ad9f146a591a6d40bf4290d62c65bf0bcda32b50404a011733cfb7b1e", "Username":"test"}

 ● All the API response should be in the form:
    1.Header: Content-Type: application/json; charset=UTF-8
    2.Body:
        {"AccountName":"test","Balance":"9463.50002","ErrorCode":"0","ErrorMessage":"No Error"}

Here's an example, using Postman to demo.


Get member balance

We will use this API to get member's balance.
*You have to implement this API to handle our request. Please implement the ResponseBody as the example below.
Name Sample
Path
{Your domain}/GetBalance
Method
 POST 
Header
Content-Type : application/json; charset=UTF-8
RequestBody
{
    "CompanyKey":"difjwifjwejfdisdfkidsjfiojwiowej213kiorfj23o5sdfkj9",
    "Username":"Player01",
    "ProductType" : 1,
    "GameType" : 1,
    "Gpid" : -2
} 
ResponseBody
{
    "AccountName":"Player01",
    "Balance":9483.500000000002,
    "ErrorCode":0,
    "ErrorMessage":"No Error"
}
Remark
Request Field Name Type Required Description
CompanyKey string Yes The key pre-agreed between fund provider and white label system.
Username (Post) string Yes Username cannot be longer than 20 chars. Only numeric, alphabet and _ is allowed in Username. Username must be unique among all users in fund provider.
ProductType int Yes ProductType means the product's category.
Please check the Product Type below.
GameType int Yes GameType means the different games under same product's category.
Please check the Game Type below.
AccountName (Call Back) string Yes Username cannot be longer than 20 chars. Only numeric, alphabet and _ is allowed in Username. Username must be unique among all users in fund provider.
Balance decimal Yes Member's account balance.(If errorCode is not 0 , balance should be 0 )
ErrorCode int Yes Please check the Error list below.
ErrorMessage string Yes Please check the Error list below.
Gpid int No Please check the Game Provider list below.
			
public class GetBalanceRequest
{
    public string CompanyKey { get; set; }
    public string Username { get; set; }
    public int ProductType { get; set; }
    public int GameType { get; set; }
    public int Gpid { get; set; }
}

public class GetBalanceResponse
{
    public int ErrorCode { get; set; }
    public string ErrorMessage { get; set; }
    public string AccountName { get; set; }
    public decimal Balance { get; set; }
}

[Route("GetBalance")]
[HttpPost]
public GetBalanceResponse GetBalance(GetBalanceRequest req)
{
    // Validation companyKey and other data
    // If encounter error, return error code and not null balance
    // Connect to database
    // Get Balance from database and return
}
            
			
public class GetBalanceRequest {
    private String companyKey;
    private String username;
    private int productType;
    private int gameType;
    private int gpid;

    // Implement Getters and Setters for each property
}

public class GetBalanceResponse {
    private int errorCode;
    private String errorMessage;
    private String accountName;
    private BigDecimal balance;

    // Implement Getters and Setters for each property
}

@POST
@Path("/GetBalance")
public GetBalanceResponse GetBalance(GetBalanceRequest req)
{
    // Validation companyKey and other data
    // If encounter error, return error code and not null balance
    // Connect to database
    // Get Balance from database and return
}
            
			
class GetBalanceRequest
{
    public $CompanyKey;
    public $username;
    public $productType;
    public $GameType;
    public $Gpid;
}

class GetBalanceResponse
{
    public $ErrorCode;
    public $ErrorMessage;
    public $AccountName;
    public $Balance;
}

$app->post('/GetBalance', function () use ($app) {
    # Decode request
    # Validation companyKey and other data
    # If encounter error, return error code and not null balance
    # Connect to database
    # Get Balance from database and return
});

$app->run();
            

Deduct stake

We will use this API to inform you to deduct the user's stake when bet is placed by member,
We will reject user's bet if the errorCode is not 0 from your response.
This API may be requested by us many times under the same bet, which means that user raise their bet.
In different product type Deduct api has different logic.
In Sports, the same transferCode can't Deduct twice.
In Casino and RNG Games, the same transferCode can Deduct twice, but 2nd Deduct amount must be greater than 1st Deduct.
In VirtualSports, the same transferCode can't Deduct twice.
In 3rd Wan Mei, the same transferCode and same transactionId can't Deduct twice, but same transferCode can Deduct another transactionId.
*You have to implement this API to handle our request. Please implement the ResponseBody as the example below.
Name Sample
Path
{Your domain}/Deduct
Method
 POST 
Header
Content-Type : application/json; charset=UTF-8
RequestBody
{
    "Amount": 1.5,
    "TransferCode": "3998211",
    "TransactionId": "3998211",
    "BetTime": "2021-06-01T00:23:25.9143053-04:00",
    "GameRoundId": null,
    "GamePeriodId": null,
    "OrderDetail": null,
    "PlayerIp": "1.2.3.4",
    "GameTypeName": null,
    "CompanyKey": "5021432A40D240EF8624D249874303C9",
    "Username": "Player01",
    "ProductType": 1,
    "GameType": 1,
    "GameId": 1,
    "Gpid": -2,
    "ExtraInfo":{
        "sportType":"Football",
        "marketType":"Over/Under",
        "league":"ITALY SERIE A",
        "match":"Lecce vs Sampdoria",
        "betOption":"Over",
        "kickoffTime":"2021-06-01T00:23:25",
        "isHalfWonLose": true,
        "winlostDate": null
    },
    "SeamlessGameExtraInfo":{
        "FeatureBuyStatus":0,
        "EndRoundStatus":0
    }
}
ResponseBody
{
    "AccountName":"Player01",
    "Balance":8262,
    "ErrorCode":0,
    "ErrorMessage":"No Error",
    "BetAmount":1.5
}
Remark
Request Field Name Type Required Description
CompanyKey string Yes The key pre-agreed between fund provider and white label system.
Username (Post) string Yes Username cannot be longer than 20 chars. Only numeric, alphabet and _ is allowed in Username. Username must be unique among all users in fund provider.
ProductType int Yes ProductType means the product's category.
Please check the Product Type below.
GameType int Yes GameType means the different games under same product's category.
Please check the Game Type below.
GameId int No The GameId of the game. Can check 8.1 get-game-list API
GamePeriodId string Yes Seamless The round id of the game..
OrderDetail string Yes player's Order detail of Seamless Games
GameTypeName string Yes The game type of the bet
AccountName (Call Back) string Yes Username cannot be longer than 20 chars. Only numeric, alphabet and _ is allowed in Username. Username must be unique among all users in fund provider.
Amount (Post) decimal Yes Amount of bet.
BetAmount (Call back) decimal Yes Amount of bet.
TransferCode string Yes Everytime when a member place a bet, it generates a unique transfer code refering to the bet, so each bet has their own transfer code.
TransactionId string Yes When ProductType : 1 or 3 or 7 (Sports, Games, Casino), will have the same value with transferCode.
When ProductType : 9 (Seamless Game Provider), will send the Round Id in order to identify the round in specific third party games.
BetTime dateTime Yes Time for member to place bet.
Balance decimal Yes Member's account balance.(If errorCode is not 0 , balance should be 0 )
PlayerIp string No Player's ip address
GameRoundId string No Seamless Games The sub-round id of the game.
ErrorCode int Yes Please check the Error list below.
ErrorMessage string Yes Please check the Error list below.
Gpid int No Please check the Game Provider list below.
ExtraInfo Object No Only support Sports.
Field Type Description
sportType string Please check 9.5 Sport Type.
The value is 'Mix Parlay' when the bet is mix parlay.
marketType string Please check 9.6 Market Type.
The value is 'Null' when the bet is mix parlay.
league string Name of league of the match. The value is 'Null' when the bet is mix parlay.
match string Name of match. The value is 'Null' when the bet is mix parlay.
betOption string The option player bet. The value is 'Null' when the bet is mix parlay.
kickoffTime dateTime The start time of the game. the value is 'Null' when the bet is mix parlay.
isHalfWonLose bool This bet is half win lose or not.
winlostDate dateTime(nullable) Win lost date of the bet.(only have correct value in Settle/Cancel api)
SeamlessGameExtraInfo Object No
Field Type Description
FeatureBuyStatus int 0 : No Implement Feature
1 : The bet is buy FreeSpin
2 : The bet is not buy FreeSpin
EndRoundStatus int 0 : No Implement Feature
1 : The bet is EndRound
2 : The bet is not EndRound
			
public class DeductRequest
{
    public string CompanyKey { get; set; }
    public string Username { get; set; }
    public int ProductType { get; set; }
    public int GameType { get; set; }
    public decimal Amount { get; set; }
    public string TransferCode { get; set; }
    public string TransactionId { get; set; }
    public DateTime BetTime { get; set; }
    public string GameRoundId { get; set; }
    public string GamePeriodId { get; set; }
    public string OrderDetail { get; set; }
    public string PlayerIp { get; set; }
    public string GameTypeName { get; set; }
    public int GameId { get; set; }
    public int Gpid { get; set; }
    public ExtraInfo ExtraInfo { get; set; }
    public object SeamlessGameExtraInfo { get; set; }
}

public class ExtraInfo
{
    public string sportType { get; set; }
    public string marketType { get; set; }
    public string league { get; set; }
    public string match { get; set; }
    public string betOption { get; set; }
    public DateTime? kickoffTime { get; set; }
    public bool isHalfWonLose { get; set; }
    public DateTime? winlostDate { get; set; }
}

public class DeductResponse
{
    public int ErrorCode { get; set; }
    public string ErrorMessage { get; set; }
    public string AccountName { get; set; }
    public decimal Balance { get; set; }
    public decimal BetAmount { get; set; }
}

[Route("Deduct")]
[HttpPost]
public DeductResponse Deduct(DeductRequest req)
{
    // Validation companyKey and other data
    // If encounter error, return error code and not null balance
    // Connect to database
    // Duduct stake amount from player balance
    // Insert bet info, need to handle multiple rasie bets
    // Return player balance
}

            
			
public class DeductRequest {
    private String companyKey;
    private String username;
    private int productType;
    private int gameType;
    private Decimal amount;
    private String transferCode;
    private String transactionId;
    private Date betTime;
    private String gameRoundId;
    private String gamePeriodId;
    private String orderDetail;
    private String playerIp;
    private String gameTypeName;
    private int gameId;
    private int gpId;
    private ExtraInfo extraInfo;
    private Object seamlessGameExtraInfo;

    // Implement Getters and Setters for each property
}

public class ExtraInfo {
    private String sportType;
    private String marketType;
    private String league;
    private String match;
    private String betOption;
    private Date kickoffTime;
    private boolean isHalfWonLose;
    private Date winlostDate;

    // Implement Getters and Setters for each property
}

public class DeductResponse {
    private int errorCode;
    private String errorMessage;
    private String accountName;
    private BigDecimal balance;
    private BigDecimal betAmount;

    // Implement Getters and Setters for each property
}

@POST
@Path("/Deduct")
public DeductResponse Deduct(DeductRequest req)
{
    // Validation companyKey and other data
    // If encounter error, return error code and not null balance
    // Connect to database
    // Duduct stake amount from player balance
    // Insert bet info, need to handle multiple rasie bets
    // Return player balance
}
            
			
class DeductRequest {
    public $CompanyKey;
    public $Username;
    public $ProductType;
    public $GameType;
    public $Amount;
    public $TransferCode;
    public $TransactionId;
    public $BetTime;
    public $GameRoundId;
    public $GamePeriodId;
    public $OrderDetail;
    public $PlayerIp;
    public $GameTypeName;
    public $GameId;
    public $GpId;
    public $ExtraInfo;
    public $SeamlessGameExtraInfo;
}

class ExtraInfo {
    public $sportType;
    public $marketType;
    public $league;
    public $match;
    public $betOption;
    public $kickoffTime;
    public $isHalfWonLose;
    public $winlostDate;
}

class DeductResponse {
    public $ErrorCode;
    public $ErrorMessage;
    public $AccountName;
    public $Balance;
    public $BetAmount;
}

$app->post('/Deduct', function () use ($app) {
    // Validation companyKey and other data
    // If encounter error, return error code and not null balance
    // Connect to database
    // Duduct stake amount from player balance
    // Insert bet info, need to handle multiple rasie bets
    // Return player balance
});

$app->run();
            

Settle bet


    We will use this API to send the result of bet for you to settle the bet.
    Please noted that we might resettle the bet when needed.
    You need to handle the case for us.

    When we settle the bet:
    1. The bet should be in running status at first.
    1. We call Settle. You need to make the bet to Settled status.

    When we resettle the bet:
    1. The bet should be in settled status at first.
    1. We call Rollback. You need to make the bet back to running status.
    2. We call Settle to resettle the bet. You need to make the bet to Settled status.

    *You have to implement this API to handle our request. Please implement the ResponseBody as the example below.
Name Sample
Path
{Your domain}/Settle
Method
 POST 
Header
Content-Type : application/json; charset=UTF-8
RequestBody

{
    "TransferCode": "3998211",
    "WinLoss": 0.000000,
    "ResultType": 1,
    "ResultTime": "2021-06-01T23:33:49.0404216-04:00",
    "CommissionStake": 0.0,
    "GameResult": "",
    "CompanyKey": "Mm6DDwrTx4uKHgTVgVahxkbXB92HsrgKSZrX3nX8NqrQXHrGrbUuanpMBPAFHDxm",
    "Username": "Player01",
    "ProductType": 1,
    "GameType": 1,
    "Gpid": -2,
    "IsCashOut": true,
    "ExtraInfo":{
        "sportType":"Football",
        "marketType":"Over/Under",
        "league":"ITALY SERIE A",
        "match":"Lecce vs Sampdoria",
        "betOption":"Over",
        "kickoffTime":"2024-06-01T00:23:25",
        "isHalfWonLose": true,
        "winlostDate": "2024-06-01T00:00:00"
    },
    "SeamlessGameExtraInfo":{
        "FeatureBuyStatus":0,
        "EndRoundStatus":0
    }
}

ResponseBody
{
    "AccountName":"Player01",
    "Balance":8242,
    "ErrorCode":0,
    "ErrorMessage":"No Error"
}
Remark
Request Field Name Type Required Description
CompanyKey string Yes The key pre-agreed between fund provider and white label system.
Username (Post) string Yes Username cannot be longer than 20 chars. Only numeric, alphabet and _ is allowed in Username. Username must be unique among all users in fund provider.
ProductType int Yes ProductType means the product's category.
Please check the Product Type below.
GameType int Yes GameType means the different games under same product's category.
Please check the Game Type below.
AccountName (Call Back) string Yes Username cannot be longer than 20 chars. Only numeric, alphabet and _ is allowed in Username. Username must be unique among all users in fund provider.
CommissionStake decimal Yes commissionable stake for this bet
GameResult string Yes GameResult of seamlessBet
TransferCode string Yes Everytime when a member place a bet, it generates a unique transfer code refering to the bet, so each bet has their own transfer code.
Balance decimal Yes Member's account balance.(If errorCode is not 0 , balance should be 0 )
WinLoss decimal Yes Win or loss, include the member's stake.
ResultType int Yes Please check the Result Type below.
ResultTime dateTime Yes The time that bet was settled.
ErrorCode int Yes Please check the Error list below.
ErrorMessage string Yes Please check the Error list below.
Gpid int No Please check the Game Provider list below.
IsCashOut bool Yes When value is True, this bet has been cashed out
ExtraInfo Object No Only support Sports.
Field Type Description
sportType string Please check 9.5 Sport Type.
The value is 'Mix Parlay' when the bet is mix parlay.
marketType string Please check 9.6 Market Type.
The value is 'Null' when the bet is mix parlay.
league string Name of league of the match. The value is 'Null' when the bet is mix parlay.
match string Name of match. The value is 'Null' when the bet is mix parlay.
betOption string The option player bet. The value is 'Null' when the bet is mix parlay.
kickoffTime dateTime The start time of the game. the value is 'Null' when the bet is mix parlay.
winlostDate dateTime(nullable) Win lost date of the bet.(only have correct value in Settle/Cancel api)
SeamlessGameExtraInfo Object No
Field Type Description
FeatureBuyStatus int 0 : No Implement Feature
1 : The bet is buy FreeSpin
2 : The bet is not buy FreeSpin
EndRoundStatus int 0 : No Implement Feature
1 : The bet is EndRound
2 : The bet is not EndRound

Rollback

If any situation force us to rollback the settlement, after we've rollback the bet, we will send this API request to inform you.
Rollback means the settled bet in a game will go back to running state, and will have to be settled again.
*You have to implement this API to handle our request. Please implement the ResponseBody as the example below.
Name Sample
Path
{Your domain}/Rollback
Method
 POST 
Header
Content-Type : application/json; charset=UTF-8
RequestBody
{
    "CompanyKey":"difjwifjwejfdisdfkidsjfiojwiowej213kiorfj23o5sdfkj9",
    "Username":"Player01",
    "TransferCode":"3998211",
    "ProductType": 1,
    "GameType": 1,
    "Gpid": -2,
    "ExtraInfo":{
        "sportType":"Football",
        "marketType":"Over/Under",
        "league":"ITALY SERIE A",
        "match":"Lecce vs Sampdoria",
        "betOption":"Over",
        "kickoffTime":"2021-06-01T00:23:25",
        "isHalfWonLose": true,
        "winlostDate": null
    }
}
ResponseBody
{
    "AccountName":"Player01",
    "Balance":8222,
    "ErrorCode":0,
    "ErrorMessage":"No Error"
}
Remark
Request Field Name Type Required Description
CompanyKey string Yes The key pre-agreed between fund provider and white label system.
Username (Post) string Yes Username cannot be longer than 20 chars. Only numeric, alphabet and _ is allowed in Username. Username must be unique among all users in fund provider.
ProductType int Yes ProductType means the product's category.
Please check the Product Type below.
GameType int Yes GameType means the different games under same product's category.
Please check the Game Type below.
AccountName (Call Back) string Yes Username cannot be longer than 20 chars. Only numeric, alphabet and _ is allowed in Username. Username must be unique among all users in fund provider.
TransferCode string Yes Everytime when a member place a bet, it generates a unique transfer code refering to the bet, so each bet has their own transfer code.
Balance decimal Yes Member's account balance.(If errorCode is not 0 , balance should be 0 )
ErrorCode int Yes Please check the Error list below.
ErrorMessage string Yes Please check the Error list below.
Gpid int No Please check the Game Provider list below.
ExtraInfo Object No Only support Sports.
Field Type Description
sportType string Please check 9.5 Sport Type.
The value is 'Mix Parlay' when the bet is mix parlay.
marketType string Please check 9.6 Market Type.
The value is 'Null' when the bet is mix parlay.
league string Name of league of the match. The value is 'Null' when the bet is mix parlay.
match string Name of match. The value is 'Null' when the bet is mix parlay.
betOption string The option player bet. The value is 'Null' when the bet is mix parlay.
kickoffTime dateTime The start time of the game. the value is 'Null' when the bet is mix parlay.
winlostDate dateTime(nullable) Win lost date of the bet.(only have correct value in Settle/Cancel api)

Cancel bet

If any situation force us to cancel the bet, after we've canceled the bet, we will send this API request to inform you.
Cancel means the running or settled bet in a game will be void , and will not be accepted anymore.
1. The bet should be in either Running or Settled status at first.
(If you cancel a bet on an running order, you can cancel the raise order. If you cancel a bet on a settled order, you can only cancel the entire order, and you cannot cancel the raise order separately.)
2. We call Cancel. You need to make the bet to Void status.
*You have to implement this API to handle our request. Please implement the ResponseBody as the example below.
Name Sample
Path
{Your domain}/Cancel
Method
 POST 
Header
Content-Type : application/json; charset=UTF-8
RequestBody
{
    "CompanyKey":"difjwifjwejfdisdfkidsjfiojwiowej213kiorfj23o5sdfkj9",
    "Username":"Player01",
    "TransferCode":"3998211",
    "ProductType": 1,
    "GameType": 1,
    "IsCancelAll" : true,
    "TransactionId":"3998211",
    "Gpid":-2,
    "ExtraInfo":{
        "sportType":"Football",
        "marketType":"Over/Under",
        "league":"ITALY SERIE A",
        "match":"Lecce vs Sampdoria",
        "betOption":"Over",
        "kickoffTime":"2024-06-01T00:23:25",
        "isHalfWonLose": true,
        "winlostDate": "2024-06-01T00:00:00"
    }
}
ResponseBody
{
    "AccountName":"Player01",
    "Balance":8242,
    "ErrorCode":0,
    "ErrorMessage":"No Error"
}
Remark
Request Field Name Type Required Description
CompanyKey string Yes The key pre-agreed between fund provider and white label system.
ProductType int Yes ProductType means the product's category.
Please check the Product Type below.
GameType int Yes GameType means the different games under same product's category.
Please check the Game Type below.
Username (Post) string Yes Username cannot be longer than 20 chars. Only numeric, alphabet and _ is allowed in Username. Username must be unique among all users in fund provider.
AccountName (Call Back) string Yes Username cannot be longer than 20 chars. Only numeric, alphabet and _ is allowed in Username. Username must be unique among all users in fund provider.
TransferCode string Yes Everytime when a member place a bet, it generates a unique transfer code refering to the bet, so each bet has their own transfer code.
TransactionId string Yes When ProductType : 1 or 3 or 7 (Sports, Games, Casino), will have the same value with transferCode.
When ProductType : 9 (Seamless Game Provider), will send the Round Id in order to identify the round in specific third party games.
IsCancelAll bool Yes true : Cancel all the subbets that under same transferCode
false : Cancel the bet that only match transferCode and transactionId
Balance decimal Yes Member's account balance.(If errorCode is not 0 , balance should be 0 )
ErrorCode int Yes Please check the Error list below.
ErrorMessage string Yes Please check the Error list below.
Gpid int No Please check the Game Provider list below.
ExtraInfo Object No Only support Sports.
Field Type Description
sportType string Please check 9.5 Sport Type.
The value is 'Mix Parlay' when the bet is mix parlay.
marketType string Please check 9.6 Market Type.
The value is 'Null' when the bet is mix parlay.
league string Name of league of the match. The value is 'Null' when the bet is mix parlay.
match string Name of match. The value is 'Null' when the bet is mix parlay.
betOption string The option player bet. The value is 'Null' when the bet is mix parlay.
kickoffTime dateTime The start time of the game. the value is 'Null' when the bet is mix parlay.
winlostDate dateTime(nullable) Win lost date of the bet.(only have correct value in Settle/Cancel api)

Bonus

When player having or getting some bonus/jackpot/promotion in game, we will use this api to send request to increase player's balance in their wallet directly.
*You would have to implement the interface to handle our request. Please implement the ResponseBody as the example below.
Name Sample
Path
{Your domain}/Bonus
Method
 POST 
Header
Content-Type : application/json; charset=UTF-8
RequestBody
{
    "CompanyKey":"difjwifjwejfdisdfkidsjfiojwiowej213kiorfj23o5sdfkj9",
    "Username":"Player01",
    "Amount":10,
    "BonusTime":"2018-06-06T23:00:00.0007712-04:00",
    "IsGameProviderPromotion": false,
    "ProductType": 1,
    "GameType": 1,
    "TransferCode":"3998211",
    "TransactionId":"3998211",
    "GameId":1,
    "Gpid":-2,
    "SeamlessGameExtraInfo":{
        "FeatureBuyStatus":0,
        "EndRoundStatus":0
    }
}
ResponseBody
{
    "AccountName":"Player01",
    "Balance":8242,
    "ErrorCode":0,
    "ErrorMessage":"No Error"
}
Remark
Request Field Name Type Required Description
CompanyKey string Yes The key pre-agreed between fund provider and white label system.
ProductType int Yes ProductType means the product's category.
Please check the Product Type below.
GameType int Yes GameType means the different games under same product's category.
Please check the Game Type below.
Username (Post) string Yes Username cannot be longer than 20 chars. Only numeric, alphabet and _ is allowed in Username. Username must be unique among all users in fund provider.
AccountName (Call Back) string Yes Username cannot be longer than 20 chars. Only numeric, alphabet and _ is allowed in Username. Username must be unique among all users in fund provider.
Amount decimal Yes Amount of bonus/jackpot/promotion.
TransferCode string Yes Everytime when a member received a bonus/jackpot/promotion, it generates a unique transfer code refering to the transaction, so each bet has their own transfer code.
TransactionId string Yes When ProductType : 1 or 3 or 7 (Sports, Games, Casino), will have the same value with transferCode.
When ProductType : 9 (Seamless Game Provider), will send the Round Id in order to identify the round in specific third party games.
BonusTime dateTime Yes The time that player received a bonus/jackpot/promotion.
IsGameProviderPromotion bool No Flag mark the bonus is provided by game provider
Balance decimal Yes Member's account balance.(If errorCode is not 0 , balance should be 0 )
ErrorCode int Yes Please check the Error list below.
ErrorMessage string Yes Please check the Error list below.
GameId int No The GameId of the game. Can check 8.1 get-game-list API
Gpid int No Please check the Game Provider list below.
SeamlessGameExtraInfo Object No
Field Type Description
FeatureBuyStatus int 0 : No Implement Feature
1 : The bet is buy FreeSpin
2 : The bet is not buy FreeSpin
EndRoundStatus int 0 : No Implement Feature
1 : The bet is EndRound
2 : The bet is not EndRound
			
[HttpPost]
[Route("Bonus")]
public BonusResponse Bonus(BonusRequest request)
{
    BonusResponse response = new BonusResponse();
    //Validation companyKey and other data
    //If encounter error, return error code,and not null balance
    //Connect to database,and get BetStatus form DB
    response = GetBonusFromDB(request);
    return response;


}

private BonusResponse GetBonusFromDB(BonusRequest request)
{
    // ToDo: Need to implement the database query logic here.
    throw new NotImplementedException();
}

public class BonusRequest
{
    public decimal Amount { get; set; }
    public string TransferCode { get; set; }
    public string TransactionId { get; set; }
    public DateTime BonusTime { get; set; }
    public int GameId { get; set; }
    public int GPId { get; set; }
    public bool IsPromotion { get; set; }
    public string CompanyKey { get; set; }
    public string Username { get; set; }
    public int ProductType { get; set; }
    public int GameType { get; set; }
    public object SeamlessGameExtraInfo { get; set; }
}

public class BonusResponse
{
    public string AccountName { get; set; }
    public decimal Balance { get; set; }
    public int ErrorCode { get; set; }
    public string ErrorMessage { get; set; }

}
                                
                            
			
@Path("/Bonus")
@POST
public BonusResponse Bonus(BonusRequest request) {
        BonusResponse response = new BonusResponse();
        // Validation companyKey and other data
        // If encounter error, return error code, and not null balance
        // Connect to the database and get BetStatus from DB
        response = getBonusFromDB(request);
        return response;
    }

    private BonusResponse getBonusFromDB(BonusRequest request) {
        // ToDo: Need to implement the database query logic here.
        throw new UnsupportedOperationException();
    }

public class BonusRequest {
    public BigDecimal Amount;
    public String TransferCode;
    public String TransactionId;
    public Date BonusTime;
    public int GameId;
    public int GPId;
    public boolean IsPromotion;
    public String CompanyKey;
    public String Username;
    public int ProductType;
    public int GameType;
    public Object SeamlessGameExtraInfo;
 // Implement Getters and Setters for each property
}

public class BonusResponse {
    public String AccountName;
    public BigDecimal Balance;
    public int ErrorCode;
    public String ErrorMessage;
 // Implement Getters and Setters for each property
}

                                
                            
			
public function Bonus(Request $request)
    {
        $response = new BonusResponse();
        // Validate companyKey and other data here.
        // If any validation error occurs, return the corresponding error code and message.
        // Connect to the database and retrieve the bet status.
        $response = $this->getBonusFromDB($request->all());
        return response()->json($response);
    }

    private function getBonusFromDB($request)
    {
        // Implement your database query logic here
    }

class BonusRequest
{
    public $Amount;
    public $TransferCode;
    public $TransactionId;
    public $BonusTime;
    public $GameId;
    public $GPId;
    public $IsPromotion;
    public $CompanyKey;
    public $Username;
    public $ProductType;
    public $GameType;
    public $SeamlessGameExtraInfo;
}

class BonusResponse
{
    public $AccountName;
    public $Balance;
    public $ErrorCode;
    public $ErrorMessage;
}
                                
                            

Return Stake


    When player place bet on some game that will not accept all stake but reduce some stake, we will call return stake to reduce bet's stake, after that will have normal settle behavior.
Note: When open Sv388Cockfighting games need to implement ReturnStake API
Name Sample
Path
{Your domain}/ReturnStake
Method
 POST 
Header
Content-Type : application/json; charset=UTF-8
RequestBody
        {
            "CompanyKey":"difjwifjwejfdisdfkidsjfiojwiowej213kiorfj23o5sdfkj9",
            "Username":"Player01",
            "CurrentStake":10,
            "ReturnStakeTime":"2018-06-06T23:00:00.0007712-04:00",
            "ProductType": 1,
            "GameType": 1,
            "TransferCode":"3998211",
            "TransactionId":"3998211"
        }
        
ResponseBody
        {
            "AccountName":"Player01",
            "Balance":8242,
            "ErrorCode":0,
            "ErrorMessage":"No Error"
        }
        
Remark
Request Field Name Type Required Description
CompanyKey string Yes The key pre-agreed between fund provider and white label system.
ProductType int Yes ProductType means the product's category.
Please check the Product Type below.
GameType int Yes GameType means the different games under same product's category.
Please check the Game Type below.
UserName (Post) string Yes Username cannot be longer than 20 chars. Only numeric, alphabet and _ is allowed in username. Username must be unique among all users in fund provider.
AccountName (Call Back) string Yes Username cannot be longer than 20 chars. Only numeric, alphabet and _ is allowed in username. Username must be unique among all users in fund provider.
CurrentStake decimal Yes Amount of latest stake that a bet should have, need to return balance if a bet's stake higher than currentStake.
TransferCode string Yes Everytime when a member received a bonus/jackpot/promotion, it generates a unique transfer code refering to the transaction, so each bet has their own transfer code.
TransactionId string Yes When ProductType : 1 or 3 or 7 (Sports, Games, Casino), will have the same value with transferCode.
When ProductType : 9 (Seamless Game Provider), will send the Round Id in order to identify the round in specific third party games.
ReturnStakeTime dateTime Yes The time that player received a returnStak.
Balance decimal Yes Member's account balance.(If errorCode is not 0 , balance should be 0 )
ErrorCode int Yes Please check the Error list below.
ErrorMessage string Yes Please check the Error list below.

Get bet status

We will use this API request to sync up bet status between us, normally for checking and debugging purpose.
For example, if a bet in 568win system is settled, but the wallet status in your system is still running, then we can find out the bet has problem.
*You would have to implement the interface to handle our request. Please implement the ResponseBody as the example below.
Name Sample
Path
{Your domain}/GetBetStatus
Method
 POST 
Header
Content-Type : application/json; charset=UTF-8
RequestBody
{
    "CompanyKey":"difjwifjwejfdisdfkidsjfiojwiowej213kiorfj23o5sdfkj9",
    "Username":"Player01",
    "ProductType": 1,
    "GameType": 1,
    "TransferCode":"3998211",
    "TransactionId":"3998211",
    "Gpid":-2
}
ResponseBody
{
    "TransferCode":"3998211",
    "TransactionId":"3998211",
    "Status":"settled",
    "WinLoss":120,
    "Stake": 100,
    "ErrorCode":0,
    "ErrorMessage":"No Error"
}
Remark
Request Field Name Type Required Description
CompanyKey string Yes The key pre-agreed between fund provider and white label system.
ProductType int Yes ProductType means the product's category.
Please check the Product Type below.
GameType int Yes GameType means the different games under same product's category.
Please check the Game Type below.
Username (Post) string Yes Username cannot be longer than 20 chars. Only numeric, alphabet and _ is allowed in Username. Username must be unique among all users in fund provider.
AccountName (Call Back) string Yes Username cannot be longer than 20 chars. Only numeric, alphabet and _ is allowed in Username. Username must be unique among all users in fund provider.
TransferCode string Yes Everytime when a member place a bet, it generates a unique transfer code refering to the bet, so each bet has their own transfer code.
TransactionId string Yes When ProductType : 1 or 3 or 7 (Sports, Games, Casino), will have the same value with transferCode.
When ProductType : 9 (Seamless Game Provider), will send the Round Id in order to identify the round in specific third party games.
Status string Yes Represent the bet status: {running,settled,void}
WinLoss decimal Yes Win or loss, include the member's stake.
Stake decimal Yes member's stake.
ErrorCode int Yes Please check the Error list below.
ErrorMessage string Yes Please check the Error list below.
Gpid int No Please check the Game Provider list below.
			
[HttpPost]
[Route("GetBetStatus")]
public GetBetStatusResponse GetBetstatus(GetBetStatusRequest request)
{
    GetBetStatusResponse response = new GetBetStatusResponse();

    // Validate companyKey and other data here.
    // If any validation error occurs, return the corresponding error code and message.
    // Connect to the database and retrieve the bet status.
    response = GetStatusFromDB(request);
    return response;
}

private GetBetStatusResponse GetStatusFromDB(GetBetStatusRequest request)
{
    // ToDo: Need to implement the database query logic here.
    throw new NotImplementedException();
}

public class GetBetStatusRequest
{
    public string CompanyKey { get; set; }
    public string Username { get; set; }
    public int ProductType { get; set; }
    public int GameType { get; set; }
    public string TransferCode { get; set; }
    public string TransactionId { get; set; }
    public int Gpid { get; set; }
}

public class GetBetStatusResponse
{
    public string TransferCode { get; set; }
    public string TransactionId { get; set; }
    public string Status { get; set; }
    public decimal WinLoss { get; set; }
    public decimal Stake { get; set; }
    public int ErrorCode { get; set; }
    public string ErrorMessage { get; set; }
}
                            
                        
			
public class GetBetStatusRequest {
    public String CompanyKey;
    public String Username;
    public int ProductType;
    public int GameType;
    public String TransferCode;
    public String TransactionId;
    public int Gpid;
    // Implement Getters and Setters for each property
}

public class GetBetStatusResponse {
    public String TransferCode;
    public String TransactionId;
    public String Status;
    public BigDecimal WinLoss;
    public BigDecimal Stake;
    public int ErrorCode;
    public String ErrorMessage;
    // Implement Getters and Setters for each property
}

@Path("/GetBetStatus")
@POST
public GetBetStatusResponse getBetStatus(GetBetStatusRequest request) {
    GetBetStatusResponse response = new GetBetStatusResponse();
    // Validation companyKey and other data
    // If encounter error, return error code
    // Connect to the database, and get BetStatus from DB
    response = getStatusFromDB(request);
    return response;
}

private GetBetStatusResponse getStatusFromDB(GetBetStatusRequest request) {
    // ToDo: Need to implement the database query logic here.
    throw new UnsupportedOperationException();
}

                            
                        
			
public function getBetStatus(Request $request)
{
    $response = new GetBetStatusResponse();
    // Validate companyKey and other data here.
    // If any validation error occurs, return the corresponding error code and message.
    // Connect to the database and retrieve the bet status.
    $response = $this->getStatusFromDB($request->all());
    return response()->json($response);
}

private function getStatusFromDB($request)
{
    // Implement your database query logic here
}


class GetBetStatusRequest
{
    public $CompanyKey;
    public $Username;
    public $ProductType;
    public $GameType;
    public $TransferCode;
    public $TransactionId;
    public $Gpid;
}

class GetBetStatusResponse
{
    public $TransferCode;
    public $TransactionId;
    public $Status;
    public $WinLoss;
    public $Stake;
    public $ErrorCode;
    public $ErrorMessage;
}

                            
                        

Error List

Error Code Error Message Description
0 No Error The request has been correctly response
1 Member not exist The member is not exist
2 Invalid Ip The IP is invalid
3 Username empty Username is empty
4 CompanyKey Error The CompanyKey is error
5 Not enough balance Member's balance is not enough
6 Bet not exists Return this error code will stop the resend any request from 568win.
7 Internal Error *
2001 Bet Already Settled Return this error code will stop the resend settle request from 568win.
2002 Bet Already Canceled Return this error code will stop the resend cancel request from 568win.
2003 Bet Already Rollback Return this error code will stop the resend rollback request from 568win.
5003 Bet With Same RefNo Exists Bet with same refNo already exists.
5008 Bet Already Returned Stake Bet already returned stake.
For other error, you can define yourself.

Game Provider

List of Third Party Providers refer to this link: Third Party Providers Information

Note: When open Sv388Cockfighting games need to implement ReturnStake API

Product Type

Product Type Product Name Product Chinese Name
1 Sports Book 体育博彩
3 SBO Games 电子游戏
5 Virtual Sports 虚拟运动
7 SBO Live Casino 真人赌场
9 Seamless Game Provider 无缝游戏

Game Types

For product type 9 (Seamless Game Provider), please reference to Appendix 9.13.1 New Seamless Game Provider Game Type in Api Document.
Product Type Game Type Game Name Game Chinese Name Device
1 0 Unknown(Use in GetBalance and Settle)
GetBalance may use 0 as parameter to call,
Settle please base on TransferCode to process only.
未知游戲(使用在GetBalance和Settle)
GetBalance會使用0當作參數來呼叫
Settle請根據TransferCode結算
Desktop, Mobile
1 1 Sports Book 体育博彩 Desktop, Mobile
1 2 In Between 射龍門 Desktop, Mobile
1 3 568 Sports Book 568 体育博彩 Desktop, Mobile
3 0 Unknown(Use in GetBalance and Settle)
GetBalance may use 0 as parameter to call,
Settle please base on TransferCode to process only.
未知游戲(使用在GetBalance和Settle)
GetBalance會使用0當作參數來呼叫
Settle請根據TransferCode結算
Desktop, Mobile
3 161 Money Roll 錢滾錢 Desktop, Mobile
3 201 Royal Baccarat 皇家百家乐 Desktop
3 203 Royal Roulettle 皇家轮盘 Desktop
3 204 Royal Blackjack 皇家21点 Desktop
3 205 Royal Sic Bo 皇家骰宝 Desktop
3 207 Royal 5 Box Blackjack 皇家多手21点 Desktop
3 208 Dragon Bonus 龙宝 Desktop
3 511 Royal Baccarat 皇家百家乐 Mobile
3 513 Royal Roulettle 皇家轮盘 Mobile
3 514 Royal Blackjack 皇家21点 Mobile
3 515 Royal Sic Bo 皇家骰宝 Mobile
3 517 Royal 5 Box Blackjack 皇家多手21点 Mobile
3 518 Dragon Bonus 龙宝 Mobile
3 601 Live Bingo! 活力宾果! Desktop
5 0 Unknown(Use in GetBalance and Settle)
GetBalance may use 0 as parameter to call,
Settle please base on TransferCode to process only.
未知游戲(使用在GetBalance和Settle)
GetBalance會使用0當作參數來呼叫
Settle請根據TransferCode結算
Desktop, Mobile
5 201601 Virtual Football 虚拟足球 Desktop
5 201604 Virtual Basketball 虚拟篮球 Desktop
5 201607 Virtual Euro Cup 虚拟歐洲杯 Desktop
5 201608 Virtual Asian Cup 虚拟亞洲杯 Desktop
5 201609 Virtual Champions Cup 虚拟冠軍杯 Desktop
5 202601 Virtual Football 虚拟足球 Mobile
5 202602 Virtual Basketball 虚拟篮球 Mobile
5 202607 Virtual Euro Cup 虚拟歐洲杯 Mobile
5 202608 Virtual Asian Cup 虚拟亞洲杯 Mobile
5 202609 Virtual Champions Cup 虚拟冠軍杯 Mobile
5 202610 Bundesliga 德国足球甲级联赛虚拟杯 Mobile
5 201600 MixParlay 混合过关 Desktop
5 202600 MixParlay 混合过关 Mobile
7 0 Unknown(Use in GetBalance and Settle)
GetBalance may use 0 as parameter to call,
Settle please base on TransferCode to process only.
未知游戲(使用在GetBalance和Settle)
GetBalance會使用0當作參數來呼叫
Settle請根據TransferCode結算
Desktop, Mobile
7 1 Baccarat 百家乐 Desktop, Mobile
7 3 Roulette 大轮盘 Desktop, Mobile
7 5 SicBo 骰宝 Desktop, Mobile
7 9 DragonTiger 龙宝 Desktop, Mobile
7 10 MultipleTableBaccarat 多桌百家乐 Desktop,Mobile
7 12 SpeedBaccarat 极速百家乐 Desktop,Mobile

Result Type

Result Type Description
0 won
1 lose
2 tie