With this API, Naga Games will send the playerToken, gameCode, betId, bet amount (amount), betType, currency, and transactionId to the Operator for a round.
Request
API URL : {OperatorAPIDomain}/{OperatorEndpoint}
HTTP Method : POST
Body Parameters
- data (JSON)
must contain all fields below.
Name | Description | Data type | Status |
---|---|---|---|
betId | Unique ID of the bet | String (length: 36) | Required |
currency | Currency of the player | String | Required |
gameCode | Code of the game | String (length: 255) | Required |
groupCode | Auto-generated code of the group in the Naga Games system | String (length: 4) | Required |
playerToken | Unique token of the player | String (length: 255) | Required |
transactionId | Unique ID of the bet transaction | String (length: 36) | Required |
amount | Amount of the bet Note: For free spins, a bet request with a zero bet amount will be sent. | Decimal (20,2) | Required |
parentBetId | Unique ID of the parent bet If the bet type is NORMAL and did not generate any free spins during the spin, it will result in ParentBetId = NULL. When a player wins the free spins. parentBetId will be equal to the betId. When a bet includes free spins, the ParentBetId will not be NULL and will not be equal to the betId. | String (length: 36) | Optional |
brandCode | Auto-generated code of the brand in the Naga Games database | String (length: 4) | Required |
betType | Type of the Bet | String | Optional |
isLastFreeSpins | This indicates to the operator that this bet is the last free spin in the entire free spin round. | Boolean | Optional |
- dataHash (String)
All request data coming from Naga Games would be hashed using SHA-256 as a data checksum and signed with the Private Key, which was generated for each operator using the RSA signing algorithm.
Header Parameters
- x-signature (String)
Must be generated from signing process with correct order of data fields & private Key.
About Signing & Verifying dataHash & Signature
Please check at How to signing & verify dataHash and signature for Seamless mode?
About Data & Signagure in Request Operator will receive
An operator must process the data in the same order ( data order and the number of data fields passed ) as specified by Naga Games to get the result from the API. Please make sure that the signature generated is valid before requesting, as different data will generate different signature and will result in error ( happens if any order or any data is missing or invalid during the signature generation process ).
Refer ➡️ Data Order before Stringify & Hashing.
Bet Type
Type | Description |
---|---|
NORMAL | Bet from base game |
PREPAID | Bet from marketing tool |
WIN_FREESPIN | Bet from free game |
BUY_FREESPIN | Bet from buy feature |
GAMBLE | Bet from gamble feature |
JACKPOT | Bet from jackpot feature |
GAMBLE_LAST | Last Bet from gamble feature |
WIN_FREESPIN_LAST | Last bet from free game |
BUY_FREESPIN_LAST | Last bet from Buy feature |
Example
curl --location 'https://api-demo-operator.stg.game.topplatform.asia/vendor/placebet' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'x-signature: XRm4olA+PIQIhCKqoscsMGX7In4bFQ3tprVCZxe1/I4RqjvFCGHftdPww0djh8LOwG/H3/0BQC3eX58aV7rOroDZP6Q9BaL5ydIi20s1DVD/QMd3xJhFVfJWraWOBNlH7K2jiozTEUAnjbshz5pIWdDGdPSbCpj18ed+YkkgSvE=' \
--data '{
"data": {
"betId": "3a93be66-ec1c-dac5-a765-858f7dc86c12",
"currency": "THB",
"gameCode": "fulong",
"playerToken": "49aea340db7fc8851d8facaa7a84d62a",
"groupCode": "dpae",
"transactionId": "3a93be66-ec1c-dac5-a765-858f7dc86c12-101-1682652126658",
"amount": 10,
"parentBetId": null,
"brandCode": "dtdr",
"isLastFreeSpins": null
},
"dataHash": "0ad7b2a651f3f025246ff07fe6a4d04478e1946f7ef0ff711a8d84791561af01"
}'
Response
Response Structure
For Response code please refer here Success Response Structure and Failure Response Structure
Data Response
Name | Description | Data type |
---|---|---|
currency | Currency of the player | String |
balance | Balance of the player | Decimal (20,2) |
Example
Success Response Example (HTTP status code 200)
{
"data": {
"balance": 99999990,
"currency": "THB"
}
}
Failure Response Example (HTTP status code 400)
{
"data": null,
"error": {
"statusCode": 400,
"message": "Cannot verify data!"
}
}