API DOCUMENTATION · v1.6

G7S_Api_Merchant_Edition

API Documentation

Base URL: /api Authentication: Bearer Token (Sanctum) All requests/responses use Content-Type: application/json


Update History

VersionUpdate DateDescription
1.12026-10-12Added “Game Redirect URL Parameters” under “8. Get Game URL”.
1.22026-10-17Added the API login URL and example integration credentials under “1. Login”.
1.32026-10-20Added a cURL login request example for downstream agent integration under “1. Login”. Clarified test vs. production agent management portal URLs.
1.42026-10-20Moved “Environment & Agent Admin Login” to the end of the document, after API integration instructions, to clarify test and production management portal URLs at the appropriate stage.
1.52026-10-28Updated production backend URL and added a quick integration workflow.
1.62026-10-31Added API role permissions and error troubleshooting.

Integration Workflow — Start Here

  1. First, integrate and test the API in the Testing Environment.
    Testing: https://yolo.play8.cyou/
    Use this backend during API integration and testing.
  2. Once the API integration is complete, log in to the Production Environment.
    Production: https://agent.bigwplay.com/
    Use this backend after going live.

Important: Do not log in to the production backend while integrating or testing the API.


Table of Contents


Authentication

1. Login

GET / POST /api/login

No authentication required.

Request Parameters

Parameter Type Required Description
username string Yes Account name
password string Yes Login password

Response Example

Success (200)

{
  "code": 200,
  "userinfo": {
    "AgentID": 1001,
    "AgentAccount": "agent01",
    "Score": 9999.00
  },
  "token": "1|xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}

Failure (422)

{
  "code": 422,
  "message": "Password error"
}
HTTP Status Code code message Description
200 200 — Login successful
422 422 Account does not exist Account does not exist
422 422 Password error Incorrect password
422 422 Account is frozen Account is frozen

API Permissions & Agent Roles

API access depends on the role of the account used to log in and obtain the Bearer Token. A store account is required for player operations such as creating players and changing player balances. A distributor account is required for agent-management operations.

API Permission Matrix

API Endpointstoredistributor
/api/create_playerYesNo
/api/change_scoreYesNo
/api/order_recordsYesNo
/api/game_recordsYesNo
/api/kick_playerYesNo
/api/game_listYesNo
/api/get_game_urlYesNo
/api/get_player_balanceYesNo
/api/reset_player_passwordYesNo
/api/get_agent_balanceNoYes
/api/reset_agent_passwordNoYes
/api/create_agentNoYes
/api/change_agent_scoreNoYes
/api/agent_order_recordsNoYes
/api/list_my_hierarchyYesYes

403 Forbidden — Permission Check

If an API returns 403 Forbidden, verify that the login account has the required role. For example, use a store account for /api/create_player and /api/change_score, and a distributor account for /api/create_agent. A 403 response can also have other authorization causes.

Make sure the API request URL and its authentication Token belong to the same environment (Testing or Production).

500 Internal Server Error

An HTTP 500 indicates a server-side error; do not assume it is caused by account permissions. Contact technical support with the endpoint, request time, response details, and a redacted request example. Do not share live Tokens or passwords.


2. Logout

GET /api/logout

Bearer Token authentication required

Request Headers

Authorization: Bearer {token}

Response Example

Success (200)

{
  "code": 200,
  "message": "success"
}

Player Management

3. Create Player

POST /api/create_player

Bearer Token authentication required Concurrent requests for the same account name will be rejected (3-second idempotency lock)

Request Headers

Authorization: Bearer {token}

Request Parameters

Parameter Type Required Description
account string Yes Player account, 6–24 characters
password string Yes Player password, 6–24 characters
recharge_amount integer No Initial deposit amount at registration (CNY), default: 0

Response Example

Success (200)

{
  "code": 200,
  "message": "success",
  "userinfo": {
    "account": "player001",
    "password": "123456"
  }
}

Failure

HTTP Status Code code message Description
422 422 Player already exists for this account name Account already exists
422 422 Score input error Invalid deposit amount
422 422 Insufficient score Insufficient agent balance
429 429 Duplicate request Duplicate request (concurrency lock)
500 500 Internal Server Error. Something went wrong Internal server error

4. Player Balance Change (Deposit/Withdrawal)

POST /api/change_score

Bearer Token authentication required Concurrent requests for the same user_id will be rejected (3-second Redis lock)

Request Headers

Authorization: Bearer {token}

Request Parameters

Parameter Type Required Description
user_id integer Yes Player UserID
type integer No Operation type:1 deposit (default),2 withdrawal
recharge_amount integer Yes Operation amount (CNY), must be greater than 0
remark string No Remark, maximum 512 characters

Response Example

Success (200)

{
  "code": 200,
  "message": "success"
}

Failure

HTTP Status Code code message Description
422 422 Exception operation, please try again Concurrency lock conflict; please try again later
422 422 Account does not exist Player does not exist or you do not have permission to operate on this player
422 422 Score input error Invalid amount
422 422 Insufficient score Insufficient agent balance for deposit / insufficient player balance for withdrawal
500 500 Internal Server Error. Something went wrong Internal server error

5. Order Records Query

POST /api/order_records

Bearer Token authentication required

Request Headers

Authorization: Bearer {token}

Request Parameters

Parameter Type Required Description
user_id integer Yes Player UserID
start_date string Yes Query start date, format Y-m-d, e.g. 2024-01-01
end_date string Yes Query end date, format Y-m-d, must be >= start_date
type integer No Record type:1 deposit records (default),2 withdrawal records
per_page integer No Items per page; allowed values:10、20、50、100、200

Response Example

Success (200)

{
  "code": 200,
  "message": "success",
  "data": {
    "total": 100,
    "lists": [
      {
        "UserID": 10001,
        "SourceScore": 100.00,
        "ChangeScore": 50.00,
        "TargetScore": 150.00,
        "InsertTime": "2024-01-15 12:30:00",
        "OpID": 1001
      }
    ]
  }
}

Field Descriptions

Field Type Description
UserID int Player ID
SourceScore float Balance before change (CNY)
ChangeScore float Balance change (CNY; positive for deposit / negative for withdrawal)
TargetScore float Balance after change (CNY)
InsertTime string Operation time
OpID int Operating agent ID

6. Game Records Query

POST /api/game_records

Bearer Token authentication required

Request Headers

Authorization: Bearer {token}

Request Parameters

Parameter Type Required Description
user_id integer Yes Player UserID
start_date string Yes Query start date, format Y-m-d, e.g. 2024-01-01
end_date string Yes Query end date, format Y-m-d, must be >= start_date
per_page integer No Items per page; allowed values:10、20、50、100、200

Response Example

Success (200)

{
  "code": 200,
  "message": "success",
  "data": {
    "total": 50,
    "lists": [
      {
        "UserID": 10001,
        "Accounts": "player001",
        "NickName": "player001",
        "Profit": 200,
        "Gain": 500,
        "Loss": 300,
        "StartTime": "2024-01-15 10:00:00",
        "EndTime": "2024-01-15 10:30:00",
        "scoreInfo": {
          "Score": 15000,
          "UserID": 10001
        }
      }
    ]
  }
}

Field Descriptions

Field Type Description
UserID int Player ID
Accounts string Player account
NickName string Player nickname
Profit int Profit (balance, in cents)
Gain int Gain (balance, in cents)
Loss int Loss (balance, in cents)
StartTime string Game start time
EndTime string Game end time
scoreInfo object Current balance information

Games

7. Game List

GET /api/game_list

Bearer Token authentication required

Request Headers

Authorization: Bearer {token}

Response Example

Success (200)

{
  "code": 200,
  "message": "success",
  "data": {
    "ip_list": ["192.168.1.1"],
    "slot": [
      [101, 1, [[100, 8000, 0, 1001]], 0]
    ],
    "chess": [
      [201, 2, [[200, 8001, 0, 1002]], 0]
    ]
  }
}

data Field Descriptions

Field Description
ip_list Server IP list; game-room ServerAddr references entries by array index
Other category keys Groups by game type; each record uses the format:[KindID, TypeID, [room list], MaintainStatus]

Room List Fields(by array index):

Index Description
0 MinEnterScore (minimum entry balance)
1 ServerPort (server port)
2 IP index (corresponding to the ip_list array index)
3 ServerID (server ID)

Failure (500)

{
  "code": 500,
  "message": "Internal Server Error. Something went wrong",
  "data": []
}

8. Get Game URL

POST /api/get_game_url

Bearer Token authentication required

Request Headers

Authorization: Bearer {token}

Request Parameters

Parameter Type Required Description
user_id integer Yes Player UserID
game_id integer Yes Game KindID
back_url string Yes Callback URL
lang string No Language; allowed values:en(default),cn、vn、pt

Response Example

Success (200)

{
  "code": 200,
  "message": "success",
  "game_url": "https://yoloh5.play8.cyou/play85/?UserID=10001&token=xxxx&ChannelID=10022&userGUID=xxxx&GameID=101&ServerID=1001&ServerAddr=192.168.1.1&serverPort=8000&lang=en&apiType=1"
}

Game Redirect URL Parameters

The following parameters can be included in the game redirect URL returned as game_url:

ParameterDescription
bgUrlCustom loading-page URL; replace with your own loading page.
isOpenKickOutWhether to enable kicking the player out of the game: 1 = enabled, 0 = disabled.
soundSound: 1 = on, 0 = off (default: 0).
langLanguage (default: en). See Section 9.4 of the G7S API Integration Document for multilingual details.
loadTypeGame loading page type: 1 = enter the game loading page directly, progress bar without countdown; 2 = enter the game loading page directly, progress bar with countdown.
scrollTypeScroll bar: 0 = enabled (default), 1 = disabled.

Example additional URL parameters:

&bgUrl=https://ddd&isOpenKickOut=1&sound=0&lang=en&loadType=2&scrollType=0

Failure

HTTP Status Code code message Description
422 422 Account does not exist Player does not exist
422 422 Game not available Game room is unavailable
500 500 Internal Server Error. Something went wrong Internal server error

9. Kick Player from Game

POST /api/kick_player

Bearer Token authentication required

Request Headers

Authorization: Bearer {token}

Request Parameters

Parameter Type Required Description
user_id integer Yes Player UserID
lang string No Language; allowed values:en(default),cn、vn、pt

Response Example

Success (200)

{
  "code": 200,
  "message": "success"
}

Failure

HTTP Status Code code message Description
422 422 Account does not exist Player does not exist
500 500 Internal Server Error. Something went wrong Internal server error

10. Get Player Balance

POST /api/get_player_balance

Bearer Token authentication required

Request Headers

Authorization: Bearer {token}

Request Parameters

Parameter Type Required Description
user_id integer Yes Player UserID
lang string No Language; allowed values:en(default),cn、vn、pt

Response Example

Success (200)

{
  "code": 200,
  "message": "success",
    "data": {
        "user_id": 1,
        "balance": 1,
        "query_time": "xxxx-xx-xx xx:xx:xx.xxxx"
    }
}

16. Reset Player Password

POST /api/reset_player_password

Bearer Token authentication required

Request Headers

Authorization: Bearer {token}

Request Parameters

Parameter Type Required Description
user_id integer Yes Player UserID
new_password string Yes New password (6–24 characters)
lang string No Language; allowed values:en(default),cn、vn、pt

Response Example

Success (200)

{
  "code": 200,
  "message": "success"
}

Agent Management

11. Get Agent Balance

POST /api/get_agent_balance

Bearer Token authentication required

Request Headers

Authorization: Bearer {token}

Request Parameters

Parameter Type Required Description
agent_id integer Yes Player UserID
lang string No Language; allowed values:en(default),cn、vn、pt

Response Example

Success (200)

{
  "code": 200,
  "message": "success",
    "data": {
        "agent_id": 1,
        "balance": 1,
        "query_time": "xxxx-xx-xx xx:xx:xx.xxxx"
    }
}

12. Reset Agent Password

POST /api/reset_agent_password

Bearer Token authentication required

Request Headers

Authorization: Bearer {token}

Request Parameters

Parameter Type Required Description
agent_id integer Yes Agent ID
new_password string Yes New password (6–24 characters)
lang string No Language; allowed values:en(default),cn、vn、pt

Response Example

Success (200)

{
  "code": 200,
  "message": "success"
}

13. Create Agent

POST /api/create_agent

Bearer Token authentication required

Request Headers

Authorization: Bearer {token}

Request Parameters

Parameter Type Required Description
account string Yes Account (6–24 characters; must contain both letters and numbers)
password string Yes Password (6–24 characters)
recharge_amount integer No Deposit amount
role string Yes store or distributor
lang string No Language; allowed values:en(default),cn、vn、pt

Response Example

Success (200)

{
    "code": 200,
    "message": "success",
    "userinfo": {
        "score": "xxx",
        "account": "xxxxxx",
        "password": "xxxxxx"
    }
}

14. Agent Balance Change (Deposit/Withdrawal)

POST /api/change_agent_score

Bearer Token authentication required

Request Headers

Authorization: Bearer {token}

Request Parameters

Parameter Type Required Description
agent_id integer Yes Agent ID
type integer Yes 1 - Deposit, 2 - Withdrawal
amount integer No Amount
lang string No Language; allowed values:en(default),cn、vn、pt

Response Example

Success (200)

{
    "code": 200,
    "message": "success",
    "data": {
        "agent_id": 13654,
        "before_balance": 10,
        "change_amount": -10,
        "after_balance": 0
    }
}

Common Error Codes

HTTP Status Code code Description
200 200 Request successful
401 — Unauthenticated; Token is invalid or expired
422 422 Parameter validation failed or business logic error
429 — Too many requests (concurrency lock)
500 500 Internal server error

15. Agent Order Records Query

POST /api/change_agent_score

Bearer Token authentication required

Request Headers

Authorization: Bearer {token}

Request Parameters

Parameter Type Required Description
agent_id integer No Agent ID
type integer No 1 - Deposit, 2 - Withdrawal
start_date date Yes Start date
end_date date Yes End date
per_page integer No Items per page
lang string No Language; allowed values:en(default),cn、vn、pt

Response Example

Success (200)

{
    "code": 200,
    "message": "success",
    "data": {
        "total": 2,
        "lists": [
            {
                "AgentID": 13654,
                "SourceScore": "10.00",
                "ChangeScore": "-10.00",
                "TargetScore": "0.00",
                "InsertTime": "2026-05-18 13:56:23",
                "OpID": 10102,
                "type": 2
            },
            {
                "AgentID": 13654,
                "SourceScore": "0.00",
                "ChangeScore": "10.00",
                "TargetScore": "10.00",
                "InsertTime": "2026-05-18 13:55:52",
                "OpID": 10102,
                "type": 1
            }
        ]
    }
}

Common Error Codes

HTTP Status Code code Description
200 200 Request successful
401 — Unauthenticated; Token is invalid or expired
422 422 Parameter validation failed or business logic error
429 — Too many requests (concurrency lock)
500 500 Internal server error

Authentication Notes

Except for /api/login, all endpoints require a Token in the request header:

Authorization: Bearer {token returned by the login endpoint}

Tokens are implemented with Laravel Sanctum. Each login deletes the previous token and generates a new one; simultaneous multi-device login is not supported for the same account.


Environment & Agent Admin Login

Important — Use the correct agent management portal for your integration environment.

Testing / integration stage: Log in to the test agent management portal: https://yolo.play8.cyou/

Production environment: The production agent management portal is: https://agent.bigwplay.com/

Do not use the production agent portal during the testing stage. Use the test portal first; the production portal is for the production environment.