Skip to content

Cancel Bets POST

Provider will send the user's cancel information when bet have a problem or timeout.

HTTP Request

POST {{ YOUR_API_URL }}/cancelBets

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

Cancel Bet transaction parameters (txns)

PropertyTypeRequiredDescription
idstringRequiredTransaction ID
statusstringRequiredAdjust status, have 2 values:
1. REFUND: The cancel status, this status come after the OPEN status. When your system got this status, you need to cancel the OPEN transaction and refund the balance to the user.
2. REJECT: The reject status, this status come after the WAITING status. This status mean the sport's provider reject the bet.The causes of this status are:
2.1. Odds changing before your bet was confirmed.
2.2. Market already closed.
2.3. System or risk control rejecting the wager.
roundIdstringRequiredRound id
betAmountnumberRequiredStake amount, you can use this value to refund to your player's balance.
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.
transactionTypestringRequiredThe value that indicate transaction action, have 2 values:
1. BY_TRANSACTION: This type, you have to consider the action is a transaction-level.
2. BY_ROUND: This type, you have to consider the action is a round-level.
Find entire transactions that belongs to roundId and actions all transactions at once.

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 cancel
balanceAfternumberRequiredPlayer's balance after cancel
usernamestringRequiredUser id on agent system

Request Example

Request Body

json
{
  "id": "c7197ce4-5a50-4397-a903-d78b135ade4v",
  "productId": "{{ Product ID }}",
  "username": "foobar",
  "currency": "THB",
  "timestampMillis": 1712767745000,
  "txns": [
    {
      "id": "R-0001",
      "status": "REFUND",
      "roundId": "R-0001",
      "betAmount": 200,
      "gameCode": "10300",
      "playInfo": "Golden Coyote",
      "transactionType": "BY_ROUND"
    }
  ]
}

JSON response example:

json
{
  "id": "c7197ce4-5a50-4397-a903-d78b135ade4c",
  "statusCode": 0,
  "timestampMillis": 1712767745100,
  "productId": "{{ Product ID }}",
  "currency": "THB",
  "balanceBefore": 14800,
  "balanceAfter": 10000,
  "username": "foobar"
}

JSON response Fail example:

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