logo
API REFERENCE

Callback Requests

If you use Money Transfer Mode, you don't need to read this page.

All callback requests are sent as JSON data using the POST method.

Retry Request Process

  • In case of balance deposit (win, cancel)

First 1 time + 3 retries request every 2-4 seconds

  • In case of balance confirmation (balance)

First 1 time + 2 retries

  • In case of balance withdraw (bet)

First time + forward cancellation request

Request Header

KeyValueDescription
Callback-Token[CALLBACK_TOKEN]Callback Token string issued by our API. You can find this in [Settings] page within our back office.
Acceptapplication/jsonJSON data
Content-Typeapplication/jsonJSON data

Verifying Callback Token

You need to verify that the CALLBACK_TOKEN string matches your Callback Token string. If the verification is successful, proceed with parsing the request data.

If the verification fails, you should respond with the following JSON data.

{ "result": 100, "status": "ERROR" }

Request Body

The request body is formatted as JSON data and contains 4 main keys: command, data, timestamp and check.

{% code overflow="wrap" %}

{
  "command": "authenticate",
  "data": { "account": "test1234" },
  "timestamp": "1676116606",
  "check": "21"
}

command

This is a string value that specifies the action your server needs to perform. It helps differentiate between various types of requests. For example, the command might indicate whether the request is to authenticate a player, update a balance, or perform another specific action.

data

This key contains a JSON object that includes all the necessary information required for your server to process the request. The contents of this object will vary depending on the command and might include details such as player ID, transaction amounts, or other relevant data.

timestamp

This is a string representing the current timestamp when the request was made. It helps in tracking and logging the timing of the request, ensuring that the data is processed in a timely manner.

check

This value specifies the type of verification required. Your server should validate the corresponding data based on this value. When multiple validations are required, this value will be a string containing multiple integers separated by commas. For example: "21,22,31".

Callback Request Types

User Authentication

This request is sent by our API to verify a player's authentication, such as when creating a new user or launching a game.

{
  "command": "authenticate",
  "data": { "account": "test1234" },
  "timestamp": "1676116606",
  "check": "21"
}

Confirmation of Balance Amount

This request is sent by our API to retrieve a player's balance while they are actively playing the game.

{
  "command": "balance",
  "data": { "account": "test1234" },
  "timestamp": "1600000001",
  "check": "21,22"
}

Betting Request

This request is sent by our API when a player places a bet while playing a game. The data field contains transaction details generated by our API.

The trans_id is a unique integer assigned to each transaction, whereas the round_id can appear in two transactions because each round includes both a bet and a win/loss transaction.

{
  "command": "bet",
  "data": {
    "account": "test1234",
    "trans_id": 1676358190,
    "call_id": 0,
    "round_id": "818395446",
    "provider_id": 1,
    "game_code": "vswaysdogs",
    "game_name": "The Dog House Megaways",
    "game_type": "Slots",
    "amount": 1000,
    "type": 1
  },
  "timestamp": "1600000001",
  "check": "21,22,41,31"
}

Handling Betting Results (Win/Loss)

This request is sent by our API when a user either wins or loses money as an outcome of their gameplay. The data field contains transaction details generated by our API.

When a user wins, the amount is greater than 0; otherwise, it is 0. Win/Loss requests both use the same command value "win".

{
  "command": "win",
  "data": {
    "account": "test1234",
    "trans_id": 1676358191,
    "call_id": 0,
    "round_id": "818395446",
    "provider_id": 1,
    "game_code": "vswaysdogs",
    "game_name": "The Dog House Megaways",
    "game_type": "Slots",
    "amount": 1000,
    "type": 2
  },
  "timestamp": "1600000001",
  "check": "21,22,41"
}

Individual Cancellation of Betting/Result

This request is sent by our API to cancel a previous transaction and refund money to a player when their bet or win/loss action fails due to network issues or other problems.

When the command cancel is sent from our API?

Previous command is timed out.

When 500 error is returned from your casino backend.

{
  "command": "cancel",
  "data": {
    "account": "test1234",
    "trans_id": 1676358190,
    "round_id": "818395446",
    "provider_id": 1,
    "game_code": "vswaysdogs",
    "game_name": "The Dog House Megaways",
    "game_type": "Slots"
  },
  "timestamp": "1600000001",
  "check": "21,22,42"
}

Processing Status

This request is sent by our API to verify whether a transaction was successful during a player's gameplay.

{
  "command": "status",
  "data": { "account": "test1234", "trans_id": 1676358190 },
  "timestamp": "1600000001",
  "check": "21,42"
}

For instructions on how to parse and respond to our callback requests, please refer to the Callback Responses page.

Last updated 1 year ago