Skip to content

Summary API Documentation

Description

This document is an API documentation provided by PV to external developers for querying user betting, profit and other actions during gameplay. All interfaces mentioned below use POST requests and require ts, sign, mch_id and data parameters.

1. Amount Parameters

Amount parameters in interface interactions are in li (厘) units, with data type int64.

1 yuan = 1000 li
1 fen = 10 li

2. Time

All times in the interface are in UTC, with time filtering rules being left-closed and right-open: time_start <= query_time < time_end.

3. Global Request Interface Format

Request Method: POST Request Structure:

json
{
    "ts": 1742452087,   # int
    "sign": "5b53eb607246fbfc94d16b7806ec7613",
    "mch_id": 101,  # int
    "data": {}
}

Request Parameter Description:

ParameterDescriptionTypeRequiredNote
ts10-digit timestampintYes
signSignaturestrYesFixed 32 characters
mch_idMerchant IDintYes
dataInterface parametersdictYes

4. Global Interface Response Format

All normal responses will have a status_code of 200. Please handle exceptions according to the code field in the response body.

json
{
    "code": 200,
    "msg": "",
    "data": {...} | [...]
 }

Response Field Description:

ParameterDescriptionTypeRequiredNote
codeError codeintYes
msgError messagestrYes
dataInterface responsedict | listYesReturns dictionary or list depending on interface

5. Error Code

Error CodeError MessageDescription
200Success
400Parameter Error
500Internal Error

Interface Signature (sign) Algorithm

Note: Convert the data dictionary into a compact JSON string (remove spaces), with key-value pairs separated by commas, keys and values separated by colons, and keys sorted alphabetically(ASCII code order). Then append ts and key (merchant key, provided by us) to calculate the md5 value.

Python

python
import hashlib
import json


def compute_md5(data: str, ts_str: str, key: str) -> str:
    m = hashlib.md5()
    m.update(data.encode("utf-8"))
    m.update(ts_str.encode("utf-8"))
    m.update(key.encode("utf-8"))
    return m.hexdigest()


if __name__ == "__main__":
    # mch key
    key = "xxxxxxxxxxxxxxx"
    request_json = {
        "ts": 1742452087,   # int
        "mch_id": 101,  # int
        "data": {                 # data is empty also needs to calculate data_str = "{}"
            "game_id": 1011,
            "draw_id": "1011-12312-1232131"
        }
    }
    # Sort and convert to string
    data_str = json.dumps(
        {k: v for k, v in request_json['data'].items()},
        separators=(",", ":"),
        sort_keys=True)
    sign = compute_md5(data_str, str(request_json['ts']), key)

API Documentation

Note: The following API documentation only covers the interface fields (data) and does not include the globally required ts, sign, and mch_id parameters

1. All Games Summary Interface

1.1 All Games List /api/all/list

Method: POST

URI: /api/all/list

Description: Returns GameList information and icon resource URLs to OP for convenient game update queries.

Request Body:

Content-Type: application/json

json
"data": {}

Response Body:

Content-Type: application/json

json
{
    "code": 200,
    "msg": "",
    "data": [
        {
            "game_id": 1006,
            "game_name": "Elves",
            "game_type": "Slots",
            "resource_url": "https://www.google.com",
            "resource_with_name_url": "https://www.google.com"
        },
        {
            "game_id": 1007,
            "game_name": "777-fruit",
            "game_type": "Slots",
            "resource_url": "https://www.google.com",
            "resource_with_name_url": "https://www.google.com"
        }
        ]
 }

Response Field Description

Field NameDescriptionTypeNote
game_idGame IDint
game_nameGame Namestr
game_typeGame TypestrSlots, Multiplayer, Crypto, Table, Fish
resource_urlGame Resource URLstr
resource_with_name_urlGame Resource URL with namestr

1.2 All Games Stage Summary /api/all/stage/summary

Method: POST

URI: /api/all/stage/summary

Description: Used to get summary data for all game stages.

Request Body:

Content-Type: application/json

json
    "data": {
        "time_start": 1742365687,
        "time_end": 1742452087
    }

Request Parameter Description

ParameterDescriptionTypeRequiredNote
time_startStart time, 10-digit timestampintYesMaximum time range 60 days
time_endEnd time, 10-digit timestampintYesMaximum time range 60 days

Response Body:

Content-Type: application/json

json
{
    "code": 200,
    "msg": "",
    "data": {
        "day_list": [
            {
                "date": "2025-03-20",
                "bet_count": 102,
                "bet_amount": 38388400,
                "gain_amount": -19038400,
                "company_gain_amount": 19038400
            },
            {
                "date": "2025-03-19",
                "bet_count": 278,
                "bet_amount": 255164400,
                "gain_amount": -36218400,
                "company_gain_amount": 36218400
            }
        ],
        "summary": {
            "bet_count": 380,
            "bet_amount": 293552800,
            "gain_amount": -55256800,
            "company_gain_amount": 55256800
        }
    }
}

Response Field Description

Field NameDescriptionTypeNote
day_listList split by datelist
dateDatestr
bet_countTotal number of bets by all players on that dayint
bet_amountTotal bet amount by all players on that dayint
gain_amountTotal winning amount by all players on that dayint
company_gain_amountCompany profit/loss on that dayint
summaryPeriod summary dictdict
bet_countTotal number of bets by all players during the periodint
bet_amountTotal bet amount by all players during the periodint
gain_amountTotal winning amount by all players during the periodint
company_gain_amountCompany profit/loss during the periodint

1.3 All Games Betting History /api/all/history

Method: POST

URI: /api/all/history

Description: Used by [OP Merchants] to query betting history data for various types of games

Request Body:

Content-Type: application/json

json
    "data": {  
        "time_start": 1744790000,
        "time_end": 1744990439,
        "page_size": 2000,
        "page": 1,
        "game_ids": [2000, 3015]

    }

Request Parameter Description

ParameterDescriptionTypeRequiredNote
time_startStart time, 10-digit timestampintYesStart and end times must be within the same day, time span cannot exceed 1 hour
time_endEnd time, 10-digit timestampintYesStart and end times must be within the same day, time span cannot exceed 1 hour
page_sizePage sizeintNoDefault 1000, maximum 2000
pagePage numberintNoDefault 1
game_idsGame ID Listlist[int]No[] or not submit field means all games

Response Body:

Content-Type: application/json

json
{
    "code": 200,
    "msg": "",
    "data": {
        "items": [
            {
                "event_id": "8234c460-481e-11f0-a82e-12cf39a4209e",
                "draw_id": "1062-0-311-1744790148-0",
                "game_id": 1062,
                "user_id": 102115212044,
                "op_id": "",
                "bet_amount": 100000,
                "gain_amount": -100000,
                "credit_before_bet": 120589196,
                "credit": 120489196,
                "start_at": 1744790148,
                "end_at": 1744790148
            },
            {
                "event_id": "8290ab4a-481e-11f0-a82e-12cf39a4209e",
                "draw_id": "1062-0-311-1744790151-0",
                "game_id": 1062,
                "user_id": 102115212044,
                "op_id": "",
                "bet_amount": 100000,
                "gain_amount": -100000,
                "credit_before_bet": 120489196,
                "credit": 120389196,
                "start_at": 1744790151,
                "end_at": 1744790151
            }
        ],
        "total": 115,
        "page": 20,
        "page_size": 3
    }
}

Response Field Description

Field NameDescriptionTypeNote
itemsRecord Listlist
event_idEvent IDstr
draw_idRound IDstr
game_idGame IDint
user_idUser IDint
op_idOP IDstr
bet_amountBet Amountint
gain_amountWin/Loss Amountint
credit_before_betBalance Before Gameint
creditBalance After Gameint
start_atRound Start Time, 10-digit timestampint
end_atRound End Time, 10-digit timestampint
totalTotal Countint
pagePage Numberint
page_sizePage Sizeint

1.4 Bonus Summary /api/all/bonus/summary

Method: POST

URI: /api/all/bonus/summary

Description: Used by [OP merchants] to query bonus summary data

Request Body:

Content-Type: application/json

json
    "data": {
        "mch_id": 114,
        "user_id": 102115212044,
        "op_id": "21312312",
        "game_ids": [1033, 1062],
        "create_type_list": [1, 2, 3],
        "state_list": [1, 2, 3, 4, 5],
        "time_start": 1744790000,
        "time_end": 1744990439
    }

Request Parameter Description

ParameterDescriptionTypeRequiredNote
mch_idMerchant IDintYesThis merchant or its subordinate merchant
user_idUser IDintNo
op_idOP user IDstrNo
game_idsGame ID listlist[int]No[] or not providing the field returns all games
create_type_listCreation type list [1: API created | 2: Backend created | 3: Officially created]list[int]No[] or not providing the field returns all creation methods
state_listBonus status list [1: Active | 2: Wagering | 3: Completed | 4: Cancelled | 5: Expired]list[int]No[] or not providing the field returns all statuses
time_startCreation start time, 10-digit timestampintNoTime range limit 60 days
time_endCreation end time, 10-digit timestampintNoTime range limit 60 days

Response Body:

Content-Type: application/json

json
{
    "code": 200,
    "msg": "",
    "data": {
        "release_count": 71,
        "used_count": 45,
        "release_bonus": 24109360.0,
        "converted_cash": 1205500.0,
        "bet_amount": 21055500,
        "win_amount": -8534000
    }
}

Response Field Description

Field NameDescriptionTypeNote
release_countCumulative number of BG issued within query conditionsint
used_countCumulative number of BG used within query conditionsint
release_bonusTotal bonus amount issued for used BGfloat
converted_cashTotal bonus amount successfully converted to cashfloat
bet_amountTotal bet amount during wagering periodint
win_amountTotal win amount during wagering periodint

2. Games Interface

2.1 Player Game History /api/games/user/history

Method: POST

URI: /api/games/user/history

Description: Returns the game history records for Games type games by player.

Request Body:

Content-Type: application/json

json
    "data": {
        "user_id": 101106411105,
        "op_id": "1234",
        "time_start": 1741588087,
        "time_end": 1742452087,
        "limit": 10
    }

Request Parameter Description

ParameterDescriptionTypeRequiredNote
user_idUser IDintNO
op_idOP IDstrNOEither user_id or op_id must be provided
time_startStart time, 10-digit timestampintYesMaximum time range 60 days
time_endEnd time, 10-digit timestampintYesMaximum time range 60 days
limitPage sizeintNoDefault 50, maximum 500

Response Body:

Content-Type: application/json

json
{
    "code": 200,
    "msg": "",
    "data": [
        {
            "event_id": "3fe51802-481b-11f0-a315-72635f25a731",
            "draw_id": "34063215",
            "game_id": 2011,
            "bet_amount": 600000,
            "gain_amount": 2550000,
            "credit_before_bet": 7764606460,
            "credit": 7767156460,
            "start_at": 1742284371,
            "end_at": 1742284389,
            "bet_areas": [
                78,
                144
            ],
            "win_areas": [
                107,
                125
            ],
            "game_result": 25,
            "award_odds": null
        }
    ]
}

Response Field Description

Field NameDescriptionTypeNote
event_idEvent IDstr
draw_idRound IDstr
game_idGame IDint
bet_amountBet Amountint
gain_amountWin/Loss Amountint
credit_before_betBalance Before Gameint
creditBalance After Gameint
start_atRound Start Time, 10-digit timestampint
end_atRound End Time, 10-digit timestampint
bet_areasBet AreaslistMultiplayer & Casual
win_areasWinning AreaslistSicbo, Roulette, Zoo, AndarBahar etc.
game_resultGame ResultintMultiplayer
award_oddsCrash MultiplierfloatCrashI&CrashII

2.2 Game History Records /api/games/game/history

Method: POST

URI: /api/games/game/history

Description: Returns historical game records for Games type games.

Request Body:

Content-Type: application/json

json
    "data": {
        "game_id": 3011,
        "time_start": 1741588087,
        "time_end": 1742452087,
        "limit": 10
    }

Request Parameter Description

ParameterDescriptionTypeRequiredNote
game_idGame IDintYes
time_startStart time, 10-digit timestampintYesMaximum time range 60 days
time_endEnd time, 10-digit timestampintYesMaximum time range 60 days
limitPage sizeintNoDefault 50, maximum 500

Response Body:

Content-Type: application/json

json
{
    "code": 200,
    "msg": "",
    "data": [
        {
            "event_id": "167ff845-481b-11f0-a315-72635f25a731",
            "draw_id": "34063215",
            "game_id": 2011,
            "user_id": 101115163288,
            "op_id": "",
            "bet_amount": 600000,
            "gain_amount": 2550000,
            "start_at": 1742284371,
            "end_at": 1742284389,
            "bet_areas": [
                78,
                144
            ],
            "win_areas": [
                107,
                125
            ],
            "game_result": 25,
            "award_odds": null
        }
    ]
}

Response Field Description

Field NameDescriptionTypeNote
event_idEvent IDstr
draw_idRound IDstr
game_idGame IDint
user_idUser IDint
op_idOP IDstr
bet_amountBet Amountint
gain_amountWin/Loss Amountint
start_atRound Start Time, 10-digit timestampint
end_atRound End Time, 10-digit timestampint
bet_areasBet ActionslistMultiplayer & Casual
win_areasWinning AreaslistSicbo, Roulette, Zoo, AndarBahar etc.
game_resultGame Resultint
award_oddsCrash MultiplierfloatCrashI&CrashII

2.3 Player Stage Summary /api/games/user/stage/summary

Method: POST

URI: /api/games/user/stage/summary

Description: Returns stage summary data for Games type games by player.

Request Body:

Content-Type: application/json

json
    "data": {
        "user_id": 101115163288,
        "op_id": "1234",
        "time_start": 1741588087,
        "time_end": 1742452087
    }

Request Parameter Description

ParameterDescriptionTypeRequiredNote
user_idUser IDintNOEither user_id or op_id must be provided
op_idOP IDstrNOEither user_id or op_id must be provided
time_startStart time, 10-digit timestampintYesMaximum time range 60 days
time_endEnd time, 10-digit timestampintYesMaximum time range 60 days

Response Body:

Content-Type: application/json

json
{
    "code": 200,
    "msg": "",
    "data": {
        "bet_amount": 266200000,
        "gain_amount": -259940000,
        "credit_before_game": 7764606460,
        "credit": 7503186460
    }
}

Response Field Description

Field NameDescriptionTypeNote
bet_amountTotal bet amount during periodint
gain_amountTotal win/loss amount during periodint
credit_before_gameBalance before gameint
creditBalance after gameint

2.4 Game Stage Summary /api/games/game/stage/summary

Method: POST

URI: /api/games/game/stage/summary

Description: Returns stage summary data for Games type games.

Request Body:

Content-Type: application/json

json
    "data": {
        "game_id": 2011,
        "time_start": 1741588087,
        "time_end": 1742452087
        }

Request Parameter Description

ParameterDescriptionTypeRequiredNote
game_idGame IDintYes
time_startStart time, 10-digit timestampintYesMaximum time range 60 days
time_endEnd time, 10-digit timestampintYesMaximum time range 60 days

Response Body:

Content-Type: application/json

json
{
    "code": 200,
    "msg": "",
    "data": {
        "bet_amount": 330400880,
        "gain_amount": -31202080,
        "user_count": 16,
        "bet_count": 451,
        "win_user_count": 8,
        "lose_user_count": 8
    }
}

Response Field Description

Field NameDescriptionTypeNote
bet_amountTotal bet amount during periodint
gain_amountTotal win/loss amount during periodint
user_countNumber of players who placed bets during periodint
bet_countTotal number of bets during periodint
win_user_countNumber of winning players during periodint
lose_user_countNumber of losing players during periodint

3. Slots Game Interface

3.1 Player Game History /api/slots/user/history

Method: POST

URI: /api/slots/user/history

Description: Returns the game history records for Slots type games by player.

Request Body:

Content-Type: application/json

json
    "data": {
        "user_id": 101106411105,
        "op_id": "1234",
        "time_start": 1741588087,
        "time_end": 1742452087,
        "limit": 10
    }

Request Parameter Description

ParameterDescriptionTypeRequiredNote
user_idUser IDintNOEither user_id or op_id must be provided
op_idOP IDstrNOEither user_id or op_id must be provided
time_startStart time, 10-digit timestampintYesMaximum time range 60 days
time_endEnd time, 10-digit timestampintYesMaximum time range 60 days
limitPage sizeintNoDefault 50, maximum 500

Response Body:

Content-Type: application/json

json
{
    "code": 200,
    "msg": "",
    "data": [
        {
            "event_id": "9529eb15-481c-11f0-a82e-12cf39a4209e",
            "draw_id": "1056-0-989-1742205595-0",
            "user_id": 101106411105,
            "op_id": "",
            "currency": "$",
            "game_id": 1056,
            "feature": 0,
            "extra_business": {
                "award_type": 0,
                "base_amount": 12000,
                "free_amount": 0,
                "bonus_amount": 0,
                "jackpot_amount": 0,
                "extra_spins": 0
            },
            "bet_amount": 100000,
            "gain_amount": -100000,
            "credit_before_bet": 7767687460,
            "credit": 7767587460,
            "start_at": 1742205595,
            "end_at": 1742205596,
            "is_buy": false
        }
      ]
 }

Response Field Description

Field NameDescriptionTypeNote
event_idEvent IDstr
draw_idRound IDstr
user_idUser IDint
op_idOP IDstr
currencyPlayer Currencystr
game_idGame IDint
featureGame Typeint0-base, 1-free, 2-bonus, 3-jackpot
extra_businessAdditional business informationdict
extra_business.award_typeAward typeint0-normal,1-freegame,2-bonus
extra_business.base_amountTotal award excluding JP in base gameint
extra_business.free_amountTotal winnings in feature, excluding trigger round and JP awardsint
extra_business.bonus_amountTotal winnings in feature, excluding trigger round and JP awardsint
extra_business.jackpot_amountTotal JP winnings in a single game (including std and feature JP)int
extra_business.extra_spinsNumber of extra free games in a single gameint
bet_amountBet Amountint
gain_amountWin/Loss Amountint
credit_before_betBalance Before Transactionint
creditBalance After Transactionint
start_atBet Start Timeint
end_atBet End Timeint
is_buyWhether Free Game Purchase Typebool

3.2 Player Stage Summary /api/slots/user/stage/summary

Method: POST

URI: /api/slots/user/stage/summary

Description: Returns stage summary data for Slots type games by player.

Request Body:

Content-Type: application/json

json
    "data": {
        "user_id": 101115163288,
        "op_id": "1234",
        "time_start": 1741588087,
        "time_end": 1742452087
    }

Request Parameter Description

ParameterDescriptionTypeRequiredNote
user_idUser IDintNOEither user_id or op_id must be provided
op_idOP IDstrNOEither user_id or op_id must be provided
time_startStart time, 10-digit timestampintYesMaximum time range 60 days
time_endEnd time, 10-digit timestampintYesMaximum time range 60 days

Response Body:

Content-Type: application/json

json
{
    "code": 200,
    "msg": "",
    "data": [
        {
            "user_id": 101106411105,
            "op_id": "",
            "game_id": 1056,
            "bet_count": 2,
            "bet_amount": 200000,
            "gain_amount": -200000,
            "currency": "$"
        },
        {
            "user_id": 101106411105,
            "op_id": "",
            "game_id": 1019,
            "bet_count": 15,
            "bet_amount": 1350000,
            "gain_amount": -1070000,
            "currency": "$"
        }
    ]
}

Response Field Description

Field NameDescriptionTypeNote
user_idUser IDint
op_idOP IDstr
game_idGame IDint
bet_countNumber of bets during period for this gameint
bet_amountTotal bet amount during period for this gameint
gain_amountTotal win amount during period for this gameint
currencyPlayer Currencystr

3.3 Game Stage Summary /api/slots/game/stage/summary

Method: POST

URI: /api/slots/game/stage/summary

Description: Returns stage summary data for Slots type games.

Request Body:

Content-Type: application/json

json
    "data": {
        "time_start": 1741588087,
        "time_end": 1742452087
    }

Request Parameter Description

ParameterDescriptionTypeRequiredNote
time_startStart time, 10-digit timestampintYesMaximum time range 60 days
time_endEnd time, 10-digit timestampintYesMaximum time range 60 days

Response Body:

Content-Type: application/json

json
{
    "code": 200,
    "msg": "",
    "data": [
        {
            "game_id": 1041,
            "bet_count": 3,
            "bet_amount": 300000,
            "gain_amount": 825000,
            "company_gain_amount": -825000
        },
        {
            "game_id": 1065,
            "bet_count": 35,
            "bet_amount": 3500000,
            "gain_amount": -770000,
            "company_gain_amount": 770000
        }
    ]
}

Response Field Description

Field NameDescriptionTypeNote
game_idGame IDint
bet_countTotal number of player bets during periodint
bet_amountTotal player bet amount during periodint
gain_amountTotal player winnings during periodint
company_gain_amountCompany profit/loss during periodint

3.4 Game Detail URL /api/slots/detail/url

Method: POST

URI: /api/slots/detail/url

Description: Returns the web URL for Slots type game round details.

Request Body:

Content-Type: application/json

json
    "data": {
        "game_id": 1044,
        "draw_id": "1044-2-685-1742794635-0"
    }

Request Parameter Description

ParameterDescriptionTypeRequiredNote
game_idGame IDintYes
draw_idRound IDstrYes

Response Body:

Content-Type: application/json

json
{
    "code": 200,
    "msg": "",
    "data": {
        "url": "https://www.google.com"
    }
}

Response Field Description

Field NameDescriptionTypeNote
urlGame detail page URLstr

2J Game Inc.