Seamless Document

Version Description
1.1.0 Init Document
1.1.1 transaction.providerTxId can be empty
1.2.0 Add Create free round and Get free round
1.2.1 Create free round should return freeGameId
1.2.2 Add Cancel free round, update create free round response
1.3.0 Update history response

Table of contents

  1. Callback / Void
  2. List games
  3. Launch game
  4. History
  5. Create Player
  6. List Providers
  7. Game Logs
  8. Appendix
  9. lang
  10. Create free round
  11. Get free round
  12. Cancel free round

1. Callback / Void

You will have to implement 3 callback functions

  1. Balance
  2. Callback
  3. Void

Agent Callback Key

You will be provided with this document. Please validate this key before continue the process.

Error Codes

Code Description
INSUFFICIENT_CREDIT player balance not enough

Result

All result will be in the below format but data field is vary depending on each callback.

Params Value Description
ok bool true if success, false if fail
message string reason of failure
data object data of api

Balance Callback

We will call this callback in order to retrieve player’s balance

POST {{callback_url}}/balance

Request Params

Params Value Description
key string Agent callback key
username string Username of the player

Request Example

{
	"key": "agent_callback_key",
	"username": "player001"
}

Response Params

Params Value Description
balance string decimal format

Response Example

{
	"ok": true,
	"data": {
		"balance": "100.00"
	}
}

Callback Rules

We will call this callback when there are some actions that need to be done. The actions will always send in batch. The batch transactions should process in order. If one of the transaction is failed, we will retry the whole requests.

Scenerio Example: In case of allowBetMore is false

IdemtKey:txId ProviderTxId Action Detail Wallet Before Balance After Balance
batch0001:txId-1 transaction-1 bet should process normally -10 100 90
batch0001:txId-2 transaction-2 bet should process normally -10 90 80
batch0002:txId-1 transaction-1 bet should not process and return success and return before/after balance of transaction-1 0 80 80
batch0001:txId-3 transaction-1 settle should process normally 20 80 100

Scenerio Example: In case of allowBetMore is true

IdemtKey ProviderTxId Action Detail Wallet Before Balance After Balance
batch0001:txId-1 transaction-1 bet should process normally -10 100 90
batch0001:txId-2 transaction-2 bet should process normally -10 90 80
batch0002:txId-3 transaction-1 bet should process normally with more bet amount -5 80 75
batch0001:txId-4 transaction-1 settle should process normally 20 75 95

Common Actions

Bet

Scenerio Example

IdemtKey ProviderTxId Action ReverseTxId ReverseAction Wallet Before Balance After Balance
batch0001:txId-1 transaction-1 bet -10 100 90
batch0002:txId-2 transaction-1 cancelBet txId-1 bet 10 90 100
batch0003:txId-3 transaction-2 cancelBet txId-4 bet 0 100 100
batch0003:txId-4 transaction-2 bet 0 100 100

Settle

ReSettle

CancelBet

Scenerio Example

IdemtKey ProviderTxId Action ReverseTxId ReverseAction Amount Wallet Before Balance After Balance
batch0001:txId-1 transaction-1 bet -10 -10 100 90
batch0002:txId-2 transaction-1 cancelBet txId-1 bet 5 5 90 95

CancelSettle

Scenerio Example

IdemtKey ProviderTxId Action ReverseTxId ReverseAction Wallet Before Balance After Balance
batch0001:txId-1 transaction-1 settle 20 100 120
batch0002:txId-2 transaction-1 cancelSettle txId-1 settle -20 120 100

Bonus

Tip

Scenerio Example

IdemtKey ProviderTxId Action ReverseTxId ReverseAction Wallet Before Balance After Balance
batch0001:txId-1 transaction-1 tip -10 100 90
batch0002:txId-2 transaction-1 cancelTip txId-1 tip 10 90 100
batch0003:txId-3 transaction-2 cancelTip txId-4 tip 0 100 100
batch0003:txId-4 transaction-2 tip 0 100 100

CancelTip

Deposit

Withdraw

Rollback

Scenerio Example

IdemtKey ProviderTxId Action ReverseTxId ReverseAction Detail Wallet Before Balance After Balance
batch0001:txId-1 transaction-1 bet should process normally -10 100 90
batch0002:txId-2 transaction-1 cancelBet txId-1 bet should process normally 10 90 100
batch0003:txId-3 transaction-1 rollback txId-2 cancelBet should process normally -10 100 90

Asynchronous Actions

Some batch actions, we will not wait for wallet result and assume the transaction always succeeded. If agent return error (http is not 200 OK or ok is false), we will retry the actions until success using exponential backoff starting with 10 seconds and maximum 600 seconds. We will stop sending request after 7 days.

The effected actions are

These 4 actions require agent to use generated transactionId items[].transaction.txId as agent transactionId. For other actions, agent can generate the txId themselves

POST {{callback_url}}/callback

Request Params

*string - mandatory string - optional

Transaction Object
Params Value Description
txId *string please use this txId to reference with your wallet transaction and return txId as operatorTxId in response
providerId *string providerId of this providerTxId
providerTxId *string unique transaction with action (providerId, providerTxId, action)
reverseTxId string txId to reverse
reverseAction string action of the previous reverseTxId
gameId string some action has no gameId
roundId string some action has no roundId
timestamp *string the time when the transaction occured (RFC3339 format)
Info Object
Params Value Description
roundClosed *bool if this round if finish
buyFeature *bool if this round is from feature buy
freeSpin *bool when detect free spin from provider
freeRound *bool when player's are given free round from free round API
freeRoundCode string when freeRound is true, freeRoundCode is returned
jackpot *bool when jackpot win is detected when settle
realAmount *string amount in decimal string of player currency (the actual bet amount)
betType *string bet type of this transaction, can be normal or tournament
betTypeInfo *object additional info of betType it can be key value map type of any keys
BetTypeInfo Keys
Key Value Description
tournamentId *string tournament id of this bet if betType is tournament
extendedInfo *string additional info of betType (json string type)
Item Object
Params Value Description
username *string username of a player that operator has pre-registered
currency *string currency of this player wallet
amount *string amount in decimal string of player currency
allowNegative *bool can be true/false, if true, should not allow deduct negative balance
allowBetMore *bool can be true/false, if true, will allow duplicate of providerTxId
action *string see Common Actions
transaction Transaction see Transaction Object
info Info see Info Object
Batch Request
Params Value Description
key *string agent key, operator should validate agent key to match when registered
idemptKey *string unique key of the request
items []Item list of Item Object

Request Example: Example basic bet

Bet Request

{
	"idemKey": "6wbt0ygjhkv",
	"key": "agent key",
	"items": [
		{
			"username": "player001",
			"amount": "-10",
			"currency" : "THB",
			"action": "bet",
			"allowNegative": false,
			"allowBetMore": false,
			"transaction": {
				"txId": "unique-111",
				"providerId": "ae",
				"providerTxId": "x5ep4bqwpok",
				"gameId": "ae_00001",
				"roundId": "p3tapalghk",
				"timestamp": "2023-05-12T08:49:11.563Z"
			},
			"info": {
				"roundClosed": false,
				"freeSpin": false,
				"buyFeature": false,
				"freeRound": false,
				"freeRoundCode": "",
				"jackpot": false,
				"realAmount": "-10"
			}
		}
	]
}

Bet Response

{
	"ok": true,
	"result": [
		{
			"txId": "unique-111",
			"beforeBalance": "1000",
			"afterBalance": "990"
		}
	]
}

Request Example: In-Out Bet + Result

Bet Request

{
	"idemKey": "la3fhts56ai",
	"key": "agent key",
	"items": [
		{
			"username": "player001",
			"amount": "-10",
			"currency" : "THB",
			"action": "bet",
			"transaction": {
				"txId": "unique-111",
				"providerId": "pg",
				"providerTxId": "33y8cru14to",
				"gameId": "pg_00001",
				"roundId": "2imoj1n5byi",
				"amount": "-10",
				"timestamp": "2023-05-12T08:49:10.072Z"
			},
			"info": {
				"roundClosed": false,
				"freeSpin": false,
				"buyFeature": false,
				"freeRound": false,
				"freeRoundCode": "",
				"jackpot": false,
				"realAmount": "-10"
			}
		},
		{
			"username": "player001",
			"amount": "20",
			"currency": "THB",
			"action": "settle",
			"transaction": {
				"txId": "unique-112",
				"providerId": "pg",
				"providerTxId": "suo7pt600em",
				"gameId": "pg_00001",
				"roundId": "2imoj1n5byi",
				"amount": "20",
				"timestamp": "2023-05-12T08:49:10.072Z"
			},
			"info": {
				"roundClosed": false,
				"freeSpin": false,
				"buyFeature": false,
				"freeRound": false,
				"freeRoundCode": "",
				"jackpot": false,
				"realAmount": "20"
			}
		}
	]
}

Bet Response

{
	"ok": true,
	"result": [
		{
			"txId": "unique-111",
			"beforeBalance": "1000",
			"afterBalance": "990"
		},
		{
			"txId": "unique-112",
			"beforeBalance": "990",
			"afterBalance": "1010"
		}
	]
}

Request Example: Multiple bets with single players

Bet Request

{
	"idemKey": "stbztx1wznd",
	"key": "agent key",
	"items": [
		{
			"username": "player001",
			"amount": "-10",
			"currency" : "THB",
			"action": "bet",
			"transaction": {
				"txId": "unique-111",
				"providerId": "ae",
				"providerTxId": "33y8cru14to",
				"gameId": "ae_00001",
				"roundId": "2imoj1n5byi",
				"amount": "-10",
				"timestamp": "2023-05-12T08:49:10.072Z"
			},
			"info": {
				"roundClosed": false,
				"freeSpin": false,
				"buyFeature": false,
				"freeRound": false,
				"freeRoundCode": "",
				"jackpot": false,
				"realAmount": "-10"
			}
		},
		{
			"username": "player001",
			"amount": "-10",
			"currency" : "THB",
			"action": "bet",
			"transaction": {
				"txId": "unique-112",
				"providerId": "ae",
				"providerTxId": "33y8cru14to",
				"gameId": "ae_00001",
				"roundId": "2imoj1n5byi",
				"amount": "-10",
				"timestamp": "2023-05-12T08:49:10.072Z"
			},
			"info": {
				"roundClosed": false,
				"freeSpin": false,
				"buyFeature": false,
				"freeRound": false,
				"freeRoundCode": "",
				"jackpot": false,
				"realAmount": "-10"
			}
		}
	]
}

Bet Response

{
	"ok": true,
	"result": [
		{
			"txId": "unique-111",
			"beforeBalance": "1000",
			"afterBalance": "990"
		},
		{
			"txId": "unique-112",
			"beforeBalance": "990",
			"afterBalance": "980"
		}
	]
}

Request Example: Multiple settle multiple players

Settle Request

{
	"idemKey": "xv8ejhloqy",
	"key": "agent key",
	"items": [
		{
			"username": "player001",
			"amount": "20",
			"currency" : "THB",
			"action": "settle",
			"transaction": {
				"txId": "unique-111",
				"providerId": "ae",
				"providerTxId": "33y8cru14to",
				"gameId": "ae_00001",
				"roundId": "2imoj1n5byi",
				"amount": "20",
				"timestamp": "2023-05-12T08:49:10.072Z"
			},
			"info": {
				"roundClosed": true,
				"freeSpin": false,
				"buyFeature": false,
				"freeRound": false,
				"freeRoundCode": "",
				"jackpot": false,
				"realAmount": "20"
			}
		},
		{
			"username": "player002",
			"amount": "20",
			"currency" : "THB",
			"action": "settle",
			"transaction": {
				"txId": "unique-112",
				"providerId": "ae",
				"providerTxId": "33y8cru14to",
				"gameId": "ae_00001",
				"roundId": "2imoj1n5byi",
				"amount": "20",
				"timestamp": "2023-05-12T08:49:10.072Z"
			},
			"info": {
				"roundClosed": true,
				"freeSpin": false,
				"buyFeature": false,
				"freeRound": false,
				"freeRoundCode": "",
				"jackpot": false,
				"realAmount": "20"
			}
		}
	]
}

Settle Response

{
	"ok": true,
	"result": [
		{
			"txId": "unique-111",
			"beforeBalance": "980",
			"afterBalance": "1000"
		},
		{
			"txId": "unique-112",
			"beforeBalance": "500",
			"afterBalance": "520"
		}
	]
}

Request Example: Bet and CancelBet

Bet Request

{
	"idemKey": "xv8ejhloqy",
	"key": "agent key",
	"items": [
		{
			"username": "player001",
			"amount": "-10",
			"currency" : "THB",
			"action": "bet",
			"transaction": {
				"txId": "unique-111",
				"providerId": "ae",
				"providerTxId": "33y8cru14to",
				"gameId": "ae_00001",
				"roundId": "2imoj1n5byi",
				"amount": "-10",
				"timestamp": "2023-05-12T08:49:10.072Z"
			},
			"info": {
				"roundClosed": false,
				"freeSpin": false,
				"buyFeature": false,
				"freeRound": false,
				"freeRoundCode": "",
				"jackpot": false,
				"realAmount": "-10"
			}
		}
	]
}

Bet Response

{
	"ok": true,
	"result": [
		{
			"txId": "unique-111",
			"beforeBalance": "1000",
			"afterBalance": "990"
		}
	]
}

CancelBet Request

{
	"idemKey": "xv8ejhloqy",
	"key": "agent key",
	"items": [
		{
			"username": "player001",
			"amount": "10",
			"currency" : "THB",
			"action": "cancelBet",
			"transaction": {
				"txId": "unique-112",
				"providerId": "ae",
				"providerTxId": "44y8cru14to",
				"reverseTxId": "unique-111",
				"reverseAction": "bet",
				"gameId": "ae_00001",
				"roundId": "2imoj1n5byi",
				"amount": "10",
				"timestamp": "2023-05-12T08:49:10.072Z"
			},
			"info": {
				"roundClosed": false,
				"freeSpin": false,
				"buyFeature": false,
				"freeRound": false,
				"freeRoundCode": "",
				"jackpot": false,
				"realAmount": "10"
			}
		}
	]
}

CancelBet Response

{
	"ok": true,
	"result": [
		{
			"txId": "unique-112",
			"beforeBalance": "990",
			"afterBalance": "1000"
		}
	]
}

Request Example: CancelSettle

Bet Request

{
	"idemKey": "xv8ejhloqy",
	"key": "agent key",
	"items": [
		{
			"username": "player001",
			"amount": "-10",
			"currency" : "THB",
			"action": "bet",
			"transaction": {
				"txId": "unique-111",
				"providerId": "ae",
				"providerTxId": "33y8cru14to",
				"gameId": "ae_00001",
				"roundId": "2imoj1n5byi",
				"amount": "-10",
				"timestamp": "2023-05-12T08:49:10.072Z"
			},
			"info": {
				"roundClosed": false,
				"freeSpin": false,
				"buyFeature": false,
				"freeRound": false,
				"freeRoundCode": "",
				"jackpot": false,
				"realAmount": "-10"
			}
		}
	]
}

Bet Response

{
	"ok": true,
	"result": [
		{
			"txId": "unique-111",
			"beforeBalance": "1000",
			"afterBalance": "990"
		}
	]
}

Settle Request

{
	"idemKey": "xv8ejhloqy",
	"key": "agent key",
	"items": [
		{
			"username": "player001",
			"amount": "20",
			"currency" : "THB",
			"action": "settle",
			"transaction": {
				"txId": "unique-112",
				"providerId": "ae",
				"providerTxId": "33y8cru14to",
				"gameId": "ae_00001",
				"roundId": "2imoj1n5byi",
				"amount": "20",
				"timestamp": "2023-05-12T08:49:10.072Z"
			},
			"info": {
				"roundClosed": true,
				"freeSpin": false,
				"buyFeature": false,
				"freeRound": false,
				"freeRoundCode": "",
				"jackpot": false,
				"realAmount": "20"
			}
		}
	]
}

Settle Response

{
	"ok": true,
	"result": [
		{
			"txId": "unique-112",
			"beforeBalance": "990",
			"afterBalance": "1010"
		}
	]
}

CancelSettle Request

{
	"idemKey": "xv8ejhloqy",
	"key": "agent key",
	"items": [
		{
			"username": "player001",
			"amount": "-20",
			"currency" : "THB",
			"action": "cancelSettle",
			"transaction": {
				"txId": "unique-113",
				"providerId": "ae",
				"providerTxId": "44y8cru14to",
				"reverseTxId": "unique-112",
				"reverseAction": "settle",
				"gameId": "ae_00001",
				"roundId": "2imoj1n5byi",
				"amount": "-20",
				"timestamp": "2023-05-12T08:49:10.072Z"
			},
			"info": {
				"roundClosed": false,
				"freeSpin": false,
				"buyFeature": false,
				"freeRound": false,
				"freeRoundCode": "",
				"jackpot": false,
				"realAmount": "-20"
			}
		}
	]
}

CancelSettle Response

{
	"ok": true,
	"result": [
		{
			"txId": "unique-113",
			"beforeBalance": "1010",
			"afterBalance": "990"
		}
	]
}

Request Example: Rollback

{
	"idemKey": "xv8ejhloqy",
	"key": "agent key",
	"items": [
		{
			"username": "player001",
			"amount": "-10",
			"currency" : "THB",
			"action": "bet",
			"transaction": {
				"txId": "unique-111",
				"providerId": "ae",
				"providerTxId": "33y8cru14to",
				"gameId": "ae_00001",
				"roundId": "2imoj1n5byi",
				"amount": "-10",
				"timestamp": "2023-05-12T08:49:10.072Z"
			},
			"info": {
				"roundClosed": false,
				"freeSpin": false,
				"buyFeature": false,
				"freeRound": false,
				"freeRoundCode": "",
				"jackpot": false,
				"realAmount": "-10"
			}
		}
	]
}

Bet Response

{
	"ok": true,
	"result": [
		{
			"txId": "unique-111",
			"beforeBalance": "1000",
			"afterBalance": "990"
		}
	]
}

CancelBet Request

{
	"idemKey": "xv8ejhloqy",
	"key": "agent key",
	"items": [
		{
			"username": "player001",
			"amount": "10",
			"currency" : "THB",
			"action": "cancelBet",
			"transaction": {
				"txId": "unique-112",
				"providerId": "ae",
				"providerTxId": "44y8cru14to",
				"reverseTxId": "unique-111",
				"reverseAction": "bet",
				"gameId": "ae_00001",
				"roundId": "2imoj1n5byi",
				"amount": "10",
				"timestamp": "2023-05-12T08:49:10.072Z"
			},
			"info": {
				"roundClosed": false,
				"freeSpin": false,
				"buyFeature": false,
				"freeRound": false,
				"freeRoundCode": "",
				"jackpot": false,
				"realAmount": "10"
			}
		}
	]
}

CancelSettle Response

{
	"ok": true,
	"result": [
		{
			"txId": "unique-112",
			"beforeBalance": "990",
			"afterBalance": "110"
		}
	]
}

Rollback Request

{
	"idemKey": "xv8ejhloqy",
	"key": "agent key",
	"items": [
		{
			"username": "player001",
			"amount": "-10",
			"currency" : "THB",
			"action": "rollback",
			"transaction": {
				"txId": "unique-113",
				"providerId": "ae",
				"providerTxId": "55y8cru14to",
				"reverseTxId": "unique-112",
				"reverseAction": "cancelBet",
				"gameId": "ae_00001",
				"roundId": "2imoj1n5byi",
				"amount": "-10",
				"timestamp": "2023-05-12T08:49:10.072Z"
			},
			"info": {
				"roundClosed": false,
				"freeSpin": false,
				"buyFeature": false,
				"freeRound": false,
				"freeRoundCode": "",
				"jackpot": false,
				"realAmount": "-10"
			}
		}
	]
}

CancelSettle Response

{
	"ok": true,
	"result": [
		{
			"txId": "unique-113",
			"beforeBalance": "1010",
			"afterBalance": "990"
		}
	]
}

Request Example: Allow Bet More

Bet Request

{
	"idemKey": "xv8ejhloqy",
	"key": "agent key",
	"items": [
		{
			"username": "player001",
			"amount": "-10",
			"currency" : "THB",
			"action": "bet",
			"transaction": {
				"txId": "unique-111",
				"providerId": "ae",
				"providerTxId": "33y8cru14to",
				"gameId": "ae_00001",
				"roundId": "2imoj1n5byi",
				"amount": "-10",
				"timestamp": "2023-05-12T08:49:10.072Z"
			},
			"info": {
				"roundClosed": false,
				"freeSpin": false,
				"buyFeature": false,
				"freeRound": false,
				"freeRoundCode": "",
				"jackpot": false,
				"realAmount": "-10"
			}
		}
	]
}

Bet Response

{
	"ok": true,
	"result": [
		{
			"txId": "175e5f9f40ee135f7368ad4c0968dc6b",
			"beforeBalance": "1000",
			"afterBalance": "990"
		}
	]
}

Bet Request (Allow Bet More 5 more bet)

{
	"idemKey": "xv8ejhloqy",
	"key": "agent key",
	"items": [
		{
			"username": "player001",
			"amount": "-5",
			"currency" : "THB",
			"action": "bet",
			"allowBetMore": true,
			"transaction": {
				"txId": "unique-211",
				"providerId": "ae",
				"providerTxId": "33y8cru14to",
				"gameId": "ae_00001",
				"roundId": "2imoj1n5byi",
				"amount": "-5",
				"timestamp": "2023-05-12T08:49:10.072Z"
			},
			"info": {
				"roundClosed": false,
				"freeSpin": false,
				"buyFeature": false,
				"freeRound": false,
				"freeRoundCode": "",
				"jackpot": false,
				"realAmount": "-5"
			}
		}
	]
}

Bet Response

{
	"ok": true,
	"result": [
		{
			"txId": "unique-211",
			"beforeBalance": "990",
			"afterBalance": "985"
		}
	]
}

CancelBet Request (All)

{
	"idemKey": "xv8ejhloqy",
	"key": "agent key",
	"items": [
		{
			"username": "player001",
			"amount": "-10",
			"currency" : "THB",
			"action": "cancelBet",
			"transaction": {
				"txId": "unique-112",
				"providerId": "ae",
				"providerTxId": "44y8cru14to",
				"reverseTxId": "unique-111",
				"reverseAction": "bet",
				"gameId": "ae_00001",
				"roundId": "2imoj1n5byi",
				"amount": "-10",
				"timestamp": "2023-05-12T08:49:10.072Z"
			},
			"info": {
				"roundClosed": false,
				"freeSpin": false,
				"buyFeature": false,
				"freeRound": false,
				"freeRoundCode": "",
				"jackpot": false,
				"realAmount": "-10"
			}
		},
		{
			"username": "player001",
			"amount": "-5",
			"currency" : "THB",
			"action": "cancelBet",
			"transaction": {
				"txId": "unique-212",
				"providerId": "ae",
				"providerTxId": "44y8cru14to",
				"reverseTxId": "unique-211",
				"reverseAction": "bet",
				"gameId": "ae_00001",
				"roundId": "2imoj1n5byi",
				"amount": "-5",
				"timestamp": "2023-05-12T08:49:10.072Z"
			},
			"info": {
				"roundClosed": false,
				"freeSpin": false,
				"buyFeature": false,
				"freeRound": false,
				"freeRoundCode": "",
				"jackpot": false,
				"realAmount": "-5"
			}
		}
	]
}

Response Params

The result consist of array of result with the same length array as batch

[].txId string Transaction ID of fund transfer that can be used to reference with your system. Return same txId for reference. [].beforeBalance string (decimal format) Balance before fund transfer [].afterBalance string (decimal format) Balance after fund transfer

Params Value Description
[].txId string Transaction ID of fund transfer that can be used to reference with your system. Return same txId for asynchronous actions.
[].beforeBalance string Balance before (decimal format) fund transfer
[].afterBalance string Balance (decimal format) after fund transfer

Response Example

{
	"ok": true,
	"result": [
		{
			"txId": "175e5f9f40ee135f7368ad4c0968dc6b",
			"beforeBalance": "1070",
			"afterBalance": "1060"
		},
		{
			"txId": "175e5f9f40ee2c57d0986e53090b13e5",
			"beforeBalance": "1060",
			"afterBalance": "1080"
		}
	]
}

Void Callback

Void callback is called when system wants to revert the previous operation of the specific Idempty. Normally void is called when system didn't get any response from operator or request timeout.

Void Request
Params Value Description
key *string agent key, operator should validate agent key to match when registered
idemptKey *string unique key of the request that wants to be reverted

API

All apis are made in POST and Content-Type is application/json with Authorization header.

Error Codes

Code Message
IP_NOT_ALLOWED ip not allowed
AGENT_NOT_FOUND agent not found
AGENT_NOT_ACTIVE agent not active
AGENT_PROVIDER_NOT_FOUND agent provider not found, provider is not configured for this agent
AGENT_NOT_UNDER agent not under
AGENT_INVALID_TYPE invalid agent type
PLAYER_USERNAME_UNAVAILABLE username unavailable
PLAYER_INACTIVE player not active
Header Value
Authorization Bearer {externalApiKey}

Result

All result will be in the below format but data field is vary depending on each callback.

Params Value Description
ok bool true if success, false if fail
message string reason of failure
data object data of api

2. Games List

To get games list

POST {{api_url}}/games

Request Params

Params Value Description
query string search query from id or name

Request Example

{
	"query": "Fire Joker"
}

Response Params

Game Item

Params Value Description
id string game id used to launch game
name string game name
logoUrl string game logo url
category object game category

Category Item

Params Value Description
id string category id
label string category name

Response Example

{
	"ok": true,
	"result": {
		"items": [
			{
				"id": "png_00072",
				"name": "Fire Joker",
				"logoUrl": "",
				"category": {
					"id": "slot",
					 "label": "Slot"
				}
			},
			{
				"id": "png_00073",
				"name": "Fire Joker Freeze",
				"logoUrl": "",
				"category": {
					"id": "slot",
					"label": "Slot"
				}
			}
		]
	}
}

3. Launch Game

To launch game

POST {{api_url}}/launchGame

Request Params

Note: currency that player will be charged with, might not be the same with currency that player is playing with

Params Value Description
username *string player username
isMobile *bool if user is logged in from mobile, only support in some games
gameId *string game id from games list api
lang *string language code, default is en
playerIp string player ip address
currency *string currency in ISO-4217 (currency that player will be charged with)
lobbyUrl string lobby url to redirect if game has option
cashierUrl string cashier url to redirect if game has option

Request Example

{
	"username": "player0001",
	"isMobile": false,
	"gameId": "pg_00001",
	"lang": "th",
	"currency": "THB"
}

Response Params

Params Value Description
type string "url" or "html"
url string url to launch game if type is "url"
html string html to launch game if type if "html"

Response Example

{
	"ok": true,
	"result": {
		"type": "url",
		"url": "https://m.pg-redirect.net/60/index.html?ot=1234&ops=1234&btt=1"
	}
}

4. History

To get player history

POST {{api_url}}/history

Request Params

Params Value Description
username string player username
gameId string game id from games list api, empty to search all
roundId string round id, empty to search all
from string start date, format is RFC3339
to string end date, format is RFC3339
paginate.page int page number
paginate.perPage int page size (default: 30)

Request Example

{
	"username": "player0001",
	"gameId": "",
	"roundId": "",
	"from": null,
	"to": null,
	"paginate": {
		"page": 1,
		"perPage": 2
	}
}

Response Params

Provider Item

Params Value Description
id string provider id
name string provider name

Game Item

Params Value Description
gameId string game id
name string game name
category string game category

UserInGame Item

Params Value Description
userInGame string username in provider system
playerId string player id
agentId int agent id
agentPrefix string agent prefix
currency string currency in provider system
username string username

TxType Item

Params Value Description
id int tx type id
label string tx type label
flag string tx type flag

Amount Item

Ratio between provider and system currency. Mostly provider and system currency is 1:1 ratio. Sometimes provider currency is different with system currency, so we need to convert it to system currency. Ex. Provider currency is KIDR, system currency is IDR, so we need to convert KIDR to IDR with 1:1000 ratio.

Params Value Description
providerCurrency string currency in provider system ex. KIDR, IDR
playerCurrency string player wallet
amount.providerAmount string amount in provider currency
amount.playerAmount string amount in player currency

History Item

Params Value Description
id string history id
provider object provider object
userInGame object userInGame object
game object game object
roundId string round id
walletTxId string seamless: agent’s transactionId, transfer: wallet transactionId
providerTxId string game reference transactionId
txType object txType object
amount object amount object
walletBeforeBalance string wallet before balance
walletAfterBalance string wallet after balance
receivedAt string received timestamp, format is RFC3339

CurrencyGroup Item is map<string, History[]> where key is currency, values is list of History items

Params Value Description
currencyGroup object histories are grouped in base currency
paginate.page int page number start from 1
paginate.perPage int how many item per page
paginate.next boolean have next page

Response Example

{
    "ok": true,
    "result": {
        "currencyGroup": {
            "EUR": {
                "items": [
                    {
                        "id": "17ed71c33d5d684bd10b18d816c83099",
                        "provider": {
                            "id": "pg",
                            "name": "Pocket Games Soft"
                        },
                        "userInGame": {
                            "userInGame": "2sjcc5qal9bq21ud-IDR",
                            "playerId": "2sjcc5qal9bq21ud",
                            "agentId": 9,
                            "agentPrefix": "2sjcc",
                            "currency": "IDR",
                            "username": "player0001"
                        },
                        "game": {
                            "gameId": "pg_00001",
                            "name": "Leprechaun Riches",
                            "category": "slot"
                        },
                        "roundId": "1825882618634307073",
                        "walletTxId": "17ed71c2e8151189ec73baeab9d19a65",
                        "providerTxId": "1825882618634307073-1825882618634307073-106-0",
                        "txType": {
                            "id": 2,
                            "label": "Settle",
                            "flag": ""
                        },
                        "amount": {
                            "providerCurrency": "IDR",
                            "playerCurrency": "IDR",
                            "amount": {
                                "providerAmount": "0",
                                "playerAmount": "0"
                            }
                        },
                        "walletBeforeBalance": "5011680",
                        "walletAfterBalance": "5011680",
                        "receivedAt": "2024-08-20T13:08:34.280062Z"
                    },
					{
                        "id": "17ed71c33d5d50bdf5f7fafed4683bf7",
                        "provider": {
                            "id": "pg",
                            "name": "Pocket Games Soft"
                        },
                        "userInGame": {
                            "userInGame": "2sjcc5qal9bq21ud-IDR",
                            "playerId": "2sjcc5qal9bq21ud",
                            "agentId": 9,
                            "agentPrefix": "2sjcc",
                            "currency": "IDR",
                            "username": "player0001"
                        },
                        "game": {
                            "gameId": "pg_00001",
                            "name": "Leprechaun Riches",
                            "category": "slot"
                        },
                        "roundId": "1825882618634307073",
                        "walletTxId": "17ed71c2e815058b453e6564348caf09",
                        "providerTxId": "1825882618634307073-1825882618634307073-106-0",
                        "txType": {
                            "id": 1,
                            "label": "Bet",
                            "flag": ""
                        },
                        "amount": {
                            "providerCurrency": "IDR",
                            "playerCurrency": "IDR",
                            "amount": {
                                "providerAmount": "-1.6",
                                "playerAmount": "-1600"
                            }
                        },
                        "walletBeforeBalance": "5011680",
                        "walletAfterBalance": "5010080",
                        "receivedAt": "2024-08-20T13:08:34.280062Z"
                    }
				]
			}
		},
		"paginate": {
			"page": 1,
			"perPage": 20,
			"next": true
		}
	}
}
{
	"ok": false,
	"error": {
		"code": "PLAYER_NOT_FOUND",
		"message": "player not found"
	}
}

5. Create Player

To create player with unique username, username must not contain special characters

POST {{api_url}}/createPlayer

Request Params

Params Value Description
username *string 4 - 30 characters, alphanumeric, lowercase only

Request Example

{
	"username": "player0001"
}

Response Example

{
	"ok": true,
	"result": {}
}
{
	"ok": false,
	"error": {
		"code": "PLAYER_USERNAME_UNAVAILABLE",
		"message": "username unavailable"
	}
}

6. List Providers

To get list of providers

POST {{api_url}}/providers

Request Example

{}

Response Params

Params Value Description
items[].id string providerId
items[].name string provider name
items[].logoUrl string provider logo url
items[].active boolean provider active status
items[].online boolean provider online status
items[].categories[] []object provider categories
items[].categories[].id string category id
items[].categories[].label string category label
{
    "ok": true,
    "result": {
        "items": [
            {
                "id": "pg",
                "name": "Pocket Games Soft",
                "logoUrl": "https://cdn.zgaggregator.com/17e2088b03ac99bf23be7e656d88926d",
                "active": true,
                "online": true,
                "categories": [
                    {
                        "id": "slot",
                        "label": "Slot"
                    }
                ]
            },
            {
                "id": "pp",
                "name": "Pragmatic Play",
                "logoUrl": "https://cdn.zgaggregator.com/17e208872f9db8d10e959de030b465a1",
                "active": true,
                "online": true,
                "categories": [
                    {
                        "id": "slot",
                        "label": "Slot"
                    }
                ]
            }
        ]
    }
}

7. Game Logs

To get game logs

POST {{api_url}}/gameLogs

Request Params

Send historyId or gameId + username + roundId

Params Value Description
historyId string historyId from /history api items[].id
gameId string gameId from /history api items[].game.gameId
username string username from /history api items[].username
roundId string roundId from /history api items[].roundId

Request Example

{
	"historyId": "1"
}

or

{
	"gameId": "habanero_00001",
	"username": "player0001",
	"roundId": "wwsnprklgu"
}

Response Params

Some data might be empty, it depends on provider

Result Item

Params Value Description
logType string see logType
url string iframe url
gameName string game name
gameResult string game result

Transaction Item

Params Value Description
id string transaction id
type string transaction type
providerAmount string transaction amount
providerCurrency string transaction currency
walletCurrency string wallet currency
beforeBalance string before balance
afterBalance string after balance
createdAt string transaction timestamp, format is RFC3339
agentProviderKeyRevisionID string agent provider key revision id

Hands Item

Params Value Description
title string hand title
cards[] string[] hand cards
result string hand result

Pocket Item

Params Value Description
number string pocket number
color string pocket color
evenOdd string pocket evenOdd
Params Value Description
providerId string provider id
gameType string game type
gameName string game name
roundId string round id
result object result object
transactions[] object[] transaction object list
hands[] object[] hands object list
pockets[] object[] pockets object list
dices[] string[] (optional) dice result
rows[].key string (optional) row key
rows[].value string (optional) row value
Log Type Description
nodata no data
iframe will send url iframe
hand will send hands json item, hand results ex. banker hands, player hands
roulette will send pocket json item, result of pocket
dice will send dices json item, array of dices result
table will send rows json item, should show in table view with given key-value

Response Example

{
    "ok": true,
    "result": {
        "providerId": "pg",
        "gameType": "Slot",
        "gameName": "Leprechaun Riches",
        "roundId": "1825882618634307073",
        "result": {
            "logType": "iframe",
            "url": "https://public.pg-staging.com//history/redirect.html?trace_id=17ef3c5a35ff0afb09d65788c2084318&psid=1825882618634307073&sid=1825882618634307073-1825882618634307073-106-0&lang=en&type=operator&t=6269A17A-B45C-4C07-844E-0ABFF3310A6D",
            "gameName": "",
            "gameResult": ""
        },
        "transactions": [
            {
                "id": "1825882618634307073-1825882618634307073-106-0",
                "type": "Bet",
                "providerAmount": "-1.6",
                "providerCurrency": "IDR",
                "walletCurrency": "IDR",
                "beforeBalance": "5011680",
                "afterBalance": "5010080",
                "createdAt": "2024-08-20T13:08:34.280062Z",
                "agentProviderKeyRevisionID": "17ec24536a56fe9e38a6d83fe0745151"
            },
            {
                "id": "1825882618634307073-1825882618634307073-106-0",
                "type": "Settle",
                "providerAmount": "0",
                "providerCurrency": "IDR",
                "walletCurrency": "IDR",
                "beforeBalance": "5011680",
                "afterBalance": "5011680",
                "createdAt": "2024-08-20T13:08:34.280062Z",
                "agentProviderKeyRevisionID": "17ec24536a56fe9e38a6d83fe0745151"
            }
        ]
    }
}

8. Appendix

9. Lang

Lang Description
en English
da Danish
de German
es Spanish
fi Finnish
fr French
id Indonesian
it Italian
ja Japanese
ko Korean
nl Dutch
no Norwegian
pl Polish
pt Portuguese
ro Romanian
ru Russian
sv Swedish
th Thai
tr Turkish
vi Vietnamese
zh Chinese
my Malay

SA Game

BetType for Baccarat

ID Description
0 Tie
1 Player
2 Banker
3 Player Pair
4 Banker Pair
25 NC. Tie
26 NC. Player
27 NC. Banker
28 NC. Player Pair
29 NC. Banker Pair
36 Player Natural
37 Banker Natural
40 NC. Player Natural
41 NC. Banker Natural
42 CC. Player
43 CC. Banker
44 CC. Tie
53 NC. Lucky Six
54 Lucky Six

BetType for Dragon Tiger

ID Description
0 Tie
1 Dragon
2 Tiger

BetType for Sic Bo

ID Description ID Description
0 Small 55 Three Even
1 Big 56 1 2 3 4
2 Odd 57 1 2 3 5
3 Even 58 1 2 3 6
4 Number 1 59 1 2 4 5
5 Number 2 60 1 2 4 6
6 Number 3 61 1 2 5 6
7 Number 4 62 1 3 4 5
8 Number 5 63 1 3 4 6
9 Number 6 64 1 3 5 6
10 All 1 65 1 4 5 6
11 All 2 66 2 3 4 5
12 All 3 67 2 3 4 6
13 All 4 68 2 3 5 6
14 All 5 69 2 4 5 6
15 All 6 70 3 4 5 6
16 All same 71 1 2 3 4 5 6
17 Point 4 72 1 2 3 4 5
18 Point 5 73 1 2 3 4 6
19 Point 6 74 1 2 3 5 6
20 Point 7 75 1 2 4 5 6
21 Point 8 76 1 3 4 5 6
22 Point 9 77 2 3 4 5 6
23 Point 10 78 1 2 3 4
24 Point 11 79 1 2 3 5
25 Point 12 80 1 2 3 6
26 Point 13 81 1 2 4 5
27 Point 14 82 1 2 4 6
28 Point 15 83 1 2 5 6
29 Point 16 84 1 3 4 5
30 Point 17 85 1 3 4 6
31 Specific double 1, 2 86 1 3 5 6
32 Specific double 1, 3 87 1 4 5 6
33 Specific double 1, 4 88 2 3 4 5
34 Specific double 1, 5 89 2 3 4 6
35 Specific double 1, 6 90 2 3 5 6
36 Specific double 2, 3 91 2 4 5 6
37 Specific double 2, 4 92 3 4 5 6
38 Specific double 2, 5 93 1 2 3
39 Specific double 2, 6 94 1 2 4
40 Specific double 3, 4 95 1 2 5
41 Specific double 3, 5 96 1 2 6
42 Specific double 3, 6 97 1 3 4
43 Specific double 4, 5 98 1 3 5
44 Specific double 4, 6 99 1 3 6
45 Specific double 5, 6 100 1 4 5
46 Pair 1 101 1 4 6
47 Pair 2 102 1 5 6
48 Pair 3 103 2 3 4
49 Pair 4 104 2 3 5
50 Pair 5 105 2 3 6
51 Pair 6 106 2 4 5
52 Three Odd 107 2 4 6
53 Two Odd One Even 108 2 5 6
54 Two Even One Odd 109 3 4 5

BetType for Roulette

ID Description ID Description
0~36 0~36 97 0,1,2
37 0,1 98 0,2,3
38 0,2 99 1,2,3
39 0,3 100 4,5,6
40 1,2 101 7,8,9
41 1,4 102 10,11,12
42 2,3 103 13,14,15
43 2,5 104 16,17,18
44 3,6 105 19,20,21
45 4,5 106 22,23,24
46 4,7 107 25,26,27
47 5,6 108 28,29,30
48 5,8 109 31,32,33
49 6,9 110 34,35,36
50 7,8 111 1,2,4,5
51 7,10 112 2,3,5,6
52 8,9 113 4,5,7,8
53 8,11 114 5,6,8,9
54 9,12 115 7,8,10,11
55 10,11 116 8,9,11,12
56 10,13 117 10,11,13,14
57 11,12 118 11,12,14,15
58 11,14 119 13,14,16,17
59 12,15 120 14,15,17,18
60 13,14 121 16,17,19,20
61 13,16 122 17,18,20,21
62 14,15 123 19,20,22,23
63 14,17 124 20,21,23,24
64 15,18 125 22,23,25,26
65 16,17 126 23,24,26,27
66 16,19 127 25,26,28,29
67 17,18 128 26,27,29,30
68 17,20 129 28,29,31,32
69 18,21 130 29,30,32,33
70 19,20 131 31,32,34,35
71 19,22 132 32,33,35,36
72 20,21 133 1,2,3,4,5,6
73 20,23 134 4,5,6,7,8,9
74 21,24 135 7,8,9,10,11,12
75 22,23 136 10,11,12,13,14,15
76 22,25 137 13,14,15,16,17,18
77 23,24 138 16,17,18,19,20,21
78 23,26 139 19,20,21,22,23,24
79 24,27 140 22,23,24,25,26,27
80 25,26 141 25,26,27,28,29,30
81 25,28 142 28,29,30,31,32,33
82 26,27 143 31,32,33,34,35,36
83 26,29 144 1st 12 (1~12)
84 27,30 145 2nd 12 (13~24)
85 28.29 146 3rd 12 (25~36)
86 28,31 147 1st Row
87 29,30 148 2nd Row
88 29,32 149 3rd Row
89 30,33 150 1~18 (Small)
90 31,32 151 19~36 (Big)
91 31,34 152 Odd
92 32,33 153 Even
93 32,35 154 Red
94 33,36 155 Black
95 34,35 156 0,1,2,3

BetType for Pok Deng

ID Description
0 Player 1
1 Player 2
2 Player 3
3 Player 4
4 Player 5
5 Player 1 Pair
6 Player 2 Pair
7 Player 3 Pair
8 Player 4 Pair
9 Player 5 Pair

BetType for Andar Bahar

ID Description
0 Andar
1 Bahar
2 1-5
3 6-10
4 11-15
5 16-20
6 21-25
7 26-30
8 31-35
9 36-49

10. Create free round

To create free rounds for a player for a specific game

POST {{api_url}}/freeRound

Request Params

Params Value Description
currency string currency when player luanch game
bonusCode string unique code to send to provider for reference
username string player's username
gameId string gameId that free game will occure
from string from date that free game will be avialiable. format is RFC3339 (note that some providers will support this parameter)
to string to date that free game will be avialiable. format is RFC3339 (note that some providers will support this parameter)
rounds integer number of free games giving out
betAmount string betAmount giving per game in string decimal format. (note that some providers will be totalBet or line betAmount)

Request Example

{
    "currency": "IDR",
    "bonusCode": "freeRound0001",
    "username": "player0001",
    "gameId": "pg_00001",
    "from": "2024-08-20T13:08:34.280062Z",
    "to": "2024-08-20T13:08:34.280062Z",
    "rounds": 10,
    "betAmount": "1.6"
}

Response Params

Params Value Description
userInGame string return userInGame of that user tie to the currency of the provider
freeGameCode string This freeGameCode will be matched when player plays that game associated with bonusCode
freeGameId string freeGameId that created on provider system, can be used to cancel free round

Response Example

{
    "ok": true,
    "result": {
        "userInGame": "aaaaa51239bq21ss-IDR",
		"freeGameId: "test01",
		"freeGameCode": "freeRound0001"
    }
}

11. Get free round

To get free rounds detail for a player from the provider

POST {{api_url}}/getFreeRound

Request Params

Params Value Description
currency string currency when player luanch game
username string player's username
gameId string gameId that free game will occure (note that some providers will support this parameter)
from string from date that free game will be avialiable. format is RFC3339 (note that some providers will support this parameter)
to string to date that free game will be avialiable. format is RFC3339 (note that some providers will support this parameter)

Request Example

{
    "currency": "IDR",
    "username": "player0001",
    "gameId": "pg_00001",
    "from": "2024-08-20T13:08:34.280062Z",
    "to": "2024-08-20T13:08:34.280062Z"
}

Response Params

Params Value Description
ppResult any result is an array of object that different for each provider
pgResult any result is an array of object that different for each provider

PP Response Object

Array of object

Params Value Description
currency string currency when player luanch game
gameIDList string actual gameID of the provider
rounds integer number of free games giving out
roundsPlayed integer number of free games played
bonusCode string unique code to send to provider for reference
expirationDate string expiration date of the free round

PP Response Example

{
    "ok": true,
    "result": {
        "ppResult": [
            {
                "currency": "EUR",
                "gameIDList": "vs20mparty",
                "rounds": 1,
                "roundsPlayed": 0,
                "bonusCode": "1c1698c9-f043-45c2-89ce-53fb70be24df",
                "expirationDate": "2024-12-25 17:00"
            },
            {
                "currency": "EUR",
                "gameIDList": "vs20mparty",
                "rounds": 1,
                "roundsPlayed": 0,
                "bonusCode": "ce61c477-e216-473f-866e-1675d09f53b1",
                "expirationDate": "2024-12-25 17:00"
            }
        ],
        "pgResult": null
    }
}

PG Response Object

Params Value Description
totalCount integer total free game count
totalPage integer total page of free game
result object[] array of free game object

PG Response Example

{
    "ok": true,
    "result": {
        "pgResult": {
            "totalCount": 0,
            "totalPage": 0,
            "result": [
                {
                    "freeGameId": 263545,
                    "freeGameName": "",
                    "playerName": "2sjcc5qal9bq21ud-VND",
                    "currencyCode": "VND",
                    "totalFreeGame": 1,
                    "coinSize": 0.5,
                    "multiplier": 10,
                    "payout": 0,
                    "remainCount": 0,
                    "conversionType": "Cash",
                    "transactionId": "",
                    "isEvent": false,
                    "gameIds": null,
                    "totalGame": 0,
                    "status": 4,
                    "createdTime": 1734010955000,
                    "updatedTime": 1734011141782
                }
            ]
        }
    }
}

12. Cancel free round

To cancel free rounds for a player from the provider

POST {{api_url}}/cancelFreeRound

Request Params

Params Value Description
currency string currency when player luanch game
username string player's username
gameId string gameId that free game will occure (note that some providers will support this parameter)
freeRoundId string freeRoundId that player want to cancel
freeRoundCode string freeRoundCode that player want to cancel

Request Example

{
    "currency": "IDR",
    "username": "player0001",
    "gameId": "pg_00001",
    "freeRoundId": "test01",
	"freeRoundCode": "freeRound0001"
}