External API Document

Version Description
1.1.0 Init Document
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. Create Player
  2. Get Player Balance
  3. Get Player Status
  4. Games
  5. Launch Game
  6. Deposit
  7. Withdraw
  8. History
  9. Player Daily Report
  10. Game Logs
  11. Providers
  12. Create free round
  13. Get free round
  14. Cancel free round

Introduction

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

Error Codes

Code Description
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

Headers

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

1. 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"
	}
}

2. Get Player Balance

To get player’s current balance and current outstanding, only for Transfer Agent Type

POST {{api_url}}/getPlayerBalance

Request Params

Params Value Description
username *string Username of the player from player.create
currency *string Currency in ISO-4217

Request Example

{
	"username": "player0001",
	"currency": "THB"
}

Response Params

Params Value Description
balance string Decimal format
currency string Currency in ISO-4217

Response Example

{
	"ok": true,
	"result": {
		"balance": "110.01",
		"currency": "THB"
	}
}
{
	"ok": false,
	"error": {
		"code": "PLAYER_NOT_FOUND",
		"message": "player not found"
	}
}

3. Get Player Status

To get player’s current status

POST {{api_url}}/getPlayerStatus

Request Params

Params Value Description
username *string Username of the player from player.create

Request Example

{
	"username": "player0001"
}

Response Params

Params Value Description
id string Player ID in System
currency string Currency in ISO-4217
active bool Player status, true if active, false if not
betLimits object Bet Limits object list, null if not set
createdAt string Player created date, format is RFC3339

Response Example

{
	"ok": true,
	"result": {
		"id": "player0001",
		"username": "daniel",
		"active": true,
		"betLimits": null,
		"createdAt": "2023-03-04T09:20:13.499634Z"
	}
}
{
	"ok": true,
	"result": {
		"username": "daniel",
		"active": true,
		"betLimits": {
			"ae": [
				{
					"id": "150902",
					"info": null
				}
			]
		},
		"createdAt": "2023-03-04T09:20:13.499634Z"
	}
}

4. Games List

To get list of games

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"
                }
			}
		]
	}
}

5. 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=63f8e33e8d5599a75980832baac1b3f8&ops=175ea1d0f047a561f40825f6eb0eec21&btt=1"
	}
}

6. Deposit

To increase player’s balance

POST {{api_url}}/deposit

Request Params

Params Value Description
username *string Username of the player from player.create
amount *string amount to deposit
currency *string currency in ISO-4217

Request Example

{
	"username": "player0001",
	"amount": "100",
	"currency": "EUR"
}

Response Params

Params Value Description
txId string transactionId
currency string currency in ISO-4217
agent.txId string agent wallet transactionId
agent.beforeBalance string agent before balance (decimal format)
agent.afterBalance string agent after balance (decimal format)
player.txId string player wallet transactionId
player.beforeBalance string player before balance (decimal format)
player.afterBalance string player after balance (decimal format)

Response Example

{
	"ok": true,
	"result": {
		"txId": "175ea1dd7c39deaa7ecef310c05973df",
		"currency": "EUR",
		"agent": {
			"txId": "175ea1dd7c8e2427ce012029766578bb",
			"beforeBalance": "9982909.49",
			"afterBalance": "9982809.49"
		},
		"player": {
			"txId": "175ea1dd7cd55d928644d6d27ce7d722",
			"beforeBalance": "100",
			"afterBalance": "200"
		}
	}
}
{
	"ok": false,
	"error": {
		"code": "PLAYER_NOT_FOUND",
		"message": "player not found"
	}
}

7. Withdraw

To decrease player’s balance

POST {{api_url}}/withdraw

Request Params

Params Value Description
username *string Username of the player from player.create
amount *string amount to deposit
currency *string currency in ISO-4217

Request Example

{
	"username": "player0001",
	"amount": "100",
	"currency": "EUR"
}

Response Params

Params Value Description
txId string transactionId
currency string currency in ISO-4217
agent.txId string agent wallet transactionId
agent.beforeBalance string agent before balance (decimal format)
agent.afterBalance string agent after balance (decimal format)
player.txId string player wallet transactionId
player.beforeBalance string player before balance (decimal format)
player.afterBalance string player after balance (decimal format)

Response Example

{
	"ok": true,
	"result": {
		"txId": "175ea20f8d2d09b3a3137b27dc0b883d",
		"currency": "EUR",
		"agent": {
			"txId": "175ea20f8d65d518d44f2f3aa418d0a5",
			"beforeBalance": "9982809.49",
			"afterBalance": "9982909.49"
		},
		"player": {
			"txId": "175ea20f8d85bfff72d9db11fd070124",
			"beforeBalance": "200",
			"afterBalance": "100"
		}
	}
}
{
	"ok": false,
	"error": {
		"code": "PLAYER_NOT_FOUND",
		"message": "player not found"
	}
}

8. 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"
	}
}

9. Player Daily Report

To get player daily report

POST {{api_url}}/playerDailyReport

Response is always in Base currency

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",
	"from": null,
	"to": null,
	"paginate": {
		"page": 1,
		"perPage": 2
	}
}

Response Params

Player Report Item

Params Value Description
playerWinLoss string player win loss
validTurnOver string valid turn over
agentWinLoss string agent win loss
agentCommission string agent commission
agentContribution string agent contribution
playerFreeRound string player free round amoun
freeRoundCount int free round count
Params Value Description
items object[] player report object
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": {
        "items": [
            {
                "playerWinLoss": "-0.3771380888",
                "validTurnOver": "0.3771380888",
                "agentWinLoss": "0.1885690444",
                "agentCommission": "0",
                "agentContribution": "-0.0018856904",
                "playerFreeRound": "0",
                "freeRoundCount": 0,
                "timestamp": "2024-08-20T13:00:00Z"
            },
            {
                "playerWinLoss": "-0.8323673728",
                "validTurnOver": "8.3226951414",
                "agentWinLoss": "0.4161836864",
                "agentCommission": "0",
                "agentContribution": "-0.0416134758",
                "playerFreeRound": "0",
                "freeRoundCount": 0,
                "timestamp": "2024-08-15T09:00:00Z"
            },
            {
                "playerWinLoss": "0.1008338974",
                "validTurnOver": "0.7739576284",
                "agentWinLoss": "-0.0344169487",
                "agentCommission": "0",
                "agentContribution": "-0.0021897882",
                "playerFreeRound": "4140",
                "freeRoundCount": 12,
                "timestamp": "2024-08-15T07:00:00Z"
            },
            {
                "playerWinLoss": "0",
                "validTurnOver": "0",
                "agentWinLoss": "0",
                "agentCommission": "0",
                "agentContribution": "0",
                "playerFreeRound": "60",
                "freeRoundCount": 2,
                "timestamp": "2024-08-09T15:00:00Z"
            },
            {
                "playerWinLoss": "-0.4",
                "validTurnOver": "0.4",
                "agentWinLoss": "0.184",
                "agentCommission": "0",
                "agentContribution": "-0.00032",
                "playerFreeRound": "0",
                "freeRoundCount": 2,
                "timestamp": "2024-08-09T14:00:00Z"
            }
        ],
        "paginate": {
            "page": 1,
            "perPage": 30,
            "next": 1
        }
    }
}
{
	"ok": false,
	"error": {
		"code": "PLAYER_NOT_FOUND",
		"message": "player not found"
	}
}

10. 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"
            }
        ]
    }
}

11. 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"
                    }
                ]
            }
        ]
    }
}

12. 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": "1c1698c9-f043-45c2-89ce-53fb70be24df"
    }
}

13. 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
                }
            ]
        }
    }
}

14. 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": "1c1698c9-f043-45c2-89ce-53fb70be24df"
}