Skip to content

Settle Bets POST

This request usually sent to your system after /placeBets was called and response success. SuperAPI sent the round result. You can check the payoutAmount and increase the player's balance after that please response success to our system to allow player play in a next round.

Some product (e.g. PGSOFT, etc) has only this request to complete the round, the round do not start by /placeBets we will sent both betAmount and payoutAmount to your system. You have to check player's balance by betAmount first. If they have enough balance to player, check the payoutAmount to identified is player win or lose (normally, if betAmount > 0 and payoutAmount > betAmount, the player is win)

Product Single State

Product IDProduct Name
PGSOFTPG Soft
BOOMINGBooming
GIOCOGioco Plus
I8I8
AFB1188_SLOTAFB1188 (Slot)
FACHAIFachai
759GAMING759 Gaming
ASKMEBETAskmebet
MINILUCKMiniluck

HTTP Request

POST {{ YOUR_API_URL }}/settleBets

Content Type

Type: application/json

Parameter Description

PropertyTypeRequiredDescription
idstringRequiredRequest id
timestampMillisnumberRequiredRequesting time
productIdstringRequiredProduct id associated with the request Product
currencystringRequiredPlayer's currency code in ISO 4217 (Example: "THB")
usernamestringRequiredUser id on agent system
txnsTxn[]RequiredTransaction Id on agent system

Settle Bet transaction parameters (txns)

PropertyTypeRequiredDescription
idstringRequiredTransaction ID
statusstringRequiredBet status (Always SETTLED)
roundIdstringRequiredRound ID
betAmountnumberRequiredStake amount (Sometimes this value equal to 0 because we can't identify the betAmount from /placeBets request)
payoutAmountnumberRequiredPayout amount (stake + win amount)
gameCodestringRequiredGame code
playInfostringRequiredInformation regarding the player was chosen. If Live-casino game this should be the position that player wager on that round if system can identified the position (e.g. player, banker). Other games, the value should be the game name, if we can't identified game name or game code, we will send 'UNKNOWN' into this value.
turnOvernumberRequiredTurn over (some product call valid stake, valid bet, etc.) for each round.
If system can identify turn-over from provider, this value should not be 0 (Default value is 0).
Note: Please test each product to check the real turn-over value before use this value.
isSingleStatebooleanRequiredValue indicates whether the round for this request is end in single /settleBets request (No /placeBets, it's mean the round has no OPEN status) Product
transactionTypestringRequiredThe value that indicate transaction action, have 2 values:
1. BY_TRANSACTION: This type, you have to consider the action is a transaction-level.Example
Find the transaction inside your data storage using id and action only found transaction.
2. BY_ROUND: This type, you have to consider the action is a round-level.Example
Find entire transactions that belongs to roundId and actions all transactions at once.
isEndRoundbooleanOptionalValue indicates whether a round is end round or not (The default value is false)
isFeaturebooleanOptionalThe value indicates request is feature spin/game from provider.
If isFeature: true possibly coming with betAmount: 0 (default value: false)
isFeatureBuybooleanOptionalThe value indicates request is "buying" feature spin/game from provider. (default value: false)
skipBalanceUpdatebooleanOptionalFlag indicating whether a round is this transaction need to update user's balance or not
true: Don't update user's balance
false: Update user's balance with betAmount or payoutAmount.
Usually occur in SPORT game type, when provider considering the player's wagering on the game.
(default value: false)

Response Description

PropertyTypeRequiredDescription
idstringRequiredRequest ID
statusCodenumberRequiredStatus from StatusCode
timestampMillisnumberRequiredResponding time
productIdstringRequiredProduct ID associated with the response Product
currencystringRequiredPlayer's currency codein ISO 4217 (Example: "THB")
balanceBeforenumberRequiredPlayer's balance before settle
balanceAfternumberRequiredPlayer's balance after settle
usernamestringRequiredUser id on agent system

Request Example

Request Body

json
{
  "id": "26cf1ce1-8ee1-4bbf-9d42-872631054bcf",
  "productId": "{{ Product ID }}",
  "username": "foobar",
  "currency": "THB",
  "timestampMillis": 1712767012000,
  "txns": [
    {
      "id": "T-002",
      "status": "SETTLED",
      "roundId": "R-0001",
      "betAmount": 0,
      "turnOver": 0,
      "payoutAmount": 5000,
      "gameCode": "10300",
      "playInfo": "Golden Coyote",
      "isEndRound": false,
      "isSingleState": false,
      "skipBalanceUpdate": false,
      "transactionType": "BY_ROUND"
    }
  ]
}

JSON response example:

json
{
  "id": "37e10565-ca3f-4367-b3ad-c6aa2f01ffd0",
  "statusCode": 0,
  "productId": "{{ Product ID }}",
  "timestampMillis": 1712767012100,
  "username": "foobar",
  "currency": "THB",
  "balanceBefore": 9800,
  "balanceAfter": 14800
}

JSON response Fail example:

json
{
  "id": "c7197ce4-5a50-4397-a903-d78b135ade4c",
  "statusCode": 10001,
  "productId": "{{ Product ID }}",
  "timestampMillis": 1631599542878
}

Request Example (BY_TRANSACTION)

Request Body

json
{
  "id": "26cf1ce1-8ee1-4bbf-9d42-872631054bcf",
  "productId": "{{ Product ID }}",
  "currency": "THB",
  "timestampMillis": 1756114564361,
  "username": "testuser1",
  "txns": [
    {
      "id": "x425atj33k8psk",
      "status": "OPEN",
      "roundId": "j6nfiubzcer1c8",
      "betAmount": 10,
      "gameCode": "d5qfgs4amfxf6",
      "playInfo": "Respin Mania",
      "skipBalanceUpdate": false
    }
  ]
}
------------------------------------------------
{
  "id": "26cf1ce1-8ee1-4bbf-9d42-872631054bcf",
  "productId": "{{ Product ID }}",
  "currency": "THB",
  "timestampMillis": 1756114564453,
  "username": "testuser1",
  "txns": [
    {
      "id": "z2l8kx8zzjxrm3",
      "status": "OPEN",
      "roundId": "j6nfiubzcer1c8",
      "betAmount": 5,
      "gameCode": "d5qfgs4amfxf6",
      "playInfo": "Respin Mania",
      "skipBalanceUpdate": false
    }
  ]
}
------------------------------------------------
{
  "id": "26cf1ce1-8ee1-4bbf-9d42-872631054bcf",
  "productId": "{{ Product ID }}",
  "currency": "THB",
  "timestampMillis": 1756114564453,
  "username": "testuser1",
  "txns": [
    {
      "id": "7f1e0i1lesr9yv",
      "status": "OPEN",
      "roundId": "j6nfiubzcer1c8",
      "betAmount": 20,
      "gameCode": "d5qfgs4amfxf6",
      "playInfo": "Respin Mania",
      "skipBalanceUpdate": false
    }
  ]
}
------------------------------------------------
{
  "id": "26cf1ce1-8ee1-4bbf-9d42-872631054bcf",
  "productId": "{{ Product ID }}",
  "currency": "THB",
  "timestampMillis": 1756114564735,
  "username": "testuser1",
  "txns": [
    {
      "id": "x425atj33k8psk",
      "status": "SETTLED",
      "roundId": "j6nfiubzcer1c8",
      "betAmount": 0,
      "payoutAmount": 20,
      "gameCode": "d5qfgs4amfxf6",
      "playInfo": "Respin Mania",
      "isSingleState": false,
      "transactionType": "BY_TRANSACTION",
      "turnOver": 0
    }
  ]
}
------------------------------------------------
{
  "id": "26cf1ce1-8ee1-4bbf-9d42-872631054bcf",
  "productId": "{{ Product ID }}",
  "currency": "THB",
  "timestampMillis": 1756114564820,
  "username": "testuser1",
  "txns": [
    {
      "id": "z2l8kx8zzjxrm3",
      "status": "SETTLED",
      "roundId": "j6nfiubzcer1c8",
      "betAmount": 0,
      "payoutAmount": 0,
      "gameCode": "d5qfgs4amfxf6",
      "playInfo": "Respin Mania",
      "isSingleState": false,
      "transactionType": "BY_TRANSACTION",
      "turnOver": 0
    }
  ]
}
------------------------------------------------
{
  "id": "26cf1ce1-8ee1-4bbf-9d42-872631054bcf",
  "productId": "{{ Product ID }}",
  "currency": "THB",
  "timestampMillis": 1756114564820,
  "username": "testuser1",
  "txns": [
    {
      "id": "7f1e0i1lesr9yv",
      "status": "SETTLED",
      "roundId": "j6nfiubzcer1c8",
      "betAmount": 0,
      "payoutAmount": 10,
      "gameCode": "d5qfgs4amfxf6",
      "playInfo": "Respin Mania",
      "isSingleState": false,
      "transactionType": "BY_TRANSACTION",
      "turnOver": 0
    }
  ]
}

Request Example (BY_ROUND)

Request Body

json
{
  "id": "26cf1ce1-8ee1-4bbf-9d42-872631054bcf",
  "productId": "{{ Product ID }}",
  "currency": "THB",
  "timestampMillis": 1756114564361,
  "username": "testuser1",
  "txns": [
    {
      "id": "x425atj33k8psk",
      "status": "OPEN",
      "roundId": "j6nfiubzcer1c8",
      "betAmount": 10,
      "gameCode": "d5qfgs4amfxf6",
      "playInfo": "Respin Mania",
      "skipBalanceUpdate": false
    }
  ]
}
------------------------------------------------
{
  "id": "26cf1ce1-8ee1-4bbf-9d42-872631054bcf",
  "productId": "{{ Product ID }}",
  "currency": "THB",
  "timestampMillis": 1756114564453,
  "username": "testuser1",
  "txns": [
    {
      "id": "z2l8kx8zzjxrm3",
      "status": "OPEN",
      "roundId": "j6nfiubzcer1c8",
      "betAmount": 5,
      "gameCode": "d5qfgs4amfxf6",
      "playInfo": "Respin Mania",
      "skipBalanceUpdate": false
    }
  ]
}
------------------------------------------------
{
  "id": "26cf1ce1-8ee1-4bbf-9d42-872631054bcf",
  "productId": "{{ Product ID }}",
  "currency": "THB",
  "timestampMillis": 1756114564453,
  "username": "testuser1",
  "txns": [
    {
      "id": "7f1e0i1lesr9yv",
      "status": "OPEN",
      "roundId": "j6nfiubzcer1c8",
      "betAmount": 20,
      "gameCode": "d5qfgs4amfxf6",
      "playInfo": "Respin Mania",
      "skipBalanceUpdate": false
    }
  ]
}
------------------------------------------------
{
  "id": "26cf1ce1-8ee1-4bbf-9d42-872631054bcf",
  "productId": "{{ Product ID }}",
  "currency": "THB",
  "timestampMillis": 1756114565578,
  "username": "testuser1",
  "txns": [
    {
      "id": "zkudwpstubzc3f",
      "status": "SETTLED",
      "roundId": "uskpir866lcc6l",
      "betAmount": 0,
      "payoutAmount": 50,
      "gameCode": "d5qfgs4amfxf6",
      "playInfo": "Respin Mania",
      "isSingleState": false,
      "transactionType": "BY_ROUND",
      "turnOver": 0
    }
  ]
}