# single wallet

**Last updated: 2026-04-02**

## API Basic Information

* Request format is form-based
* Response format is JSON
* All time and timestamp fields are in **seconds**。
* Parameter order is not required.

### Response Header:

| Paramet      | Type   | Required | 描Description     |
| ------------ | ------ | -------- | ---------------- |
| Content-Type | string | YES      | application/json |

### error codes

* The specific error codes and their explanations are in [Error Code](/en/enum/enum-error-code.md)

## Validate Player

```
POST (Operator API address)/validate
```

**Request Paramet:**

| Paramet    | Type   | Required | Description                        |
| ---------- | ------ | -------- | ---------------------------------- |
| token      | string | YES      | The token provided by the operator |
| operatorID | string | YES      | The operator ID registered in WE   |
| appSecret  | string | YES      | The certificate key provided by WE |

**Response Data:**

| Paramet  | Type   | Required | Description                                                              |
| -------- | ------ | -------- | ------------------------------------------------------------------------ |
| playerID | string | YES      | Player ID                                                                |
| nickname | string | YES      | string Player nickname(Max length: 80 characters)                        |
| currency | string | YES      | Currency                                                                 |
| time     | int64  | NO       | Time ( Unix millisecond)                                                 |
| balance  | int64  | YES      | Balance(unit:cent), If no parameters are entered, the balance will be 0. |

**Successful Response Example:**

```json
{
  "playerID": "BMJCP2DH5S5VCC8S9RHG",    // string Player ID
  "nickname": "Player 1",               // string Player nickname(Max length: 80 characters)
  "currency": "RMB",                    // string Currency
  "time": 1574476825000,                // int64 Time (Unix millisecond)
  "balance": 300000,                    // int64 (unit:cent)player's balance.
}
```

**Error Response Type:**

```json
// HTTP Code:400, missing required parameter
{
  "error": "Bad Request"        
}
```

```json
// HTTP Code:401, incorrect appSecret
{
  "error":"Incorrect appSecret"
}
```

```json
// HTTP Code:404, invalid token
{
  "error":"Invalid Token"
}
```

## Get Player's balance

Get the player's balance from the operator, the returned balance is in cents and must be an integer

```
POST (Operator API address)/balance
```

**Request Paramet:**

| Paramet    | Type   | Required | Description                          |
| ---------- | ------ | -------- | ------------------------------------ |
| token      | string | YES      | The token provided by the operator   |
| operatorID | string | YES      | The operator ID registered in WE     |
| appSecret  | string | YES      | The certificate key provided by WE   |
| playerID   | string | YES      | Player ID(Max length: 20 characters) |

**Response Data:**

| Paramet  | Type   | Required | Description             |
| -------- | ------ | -------- | ----------------------- |
| balance  | int64  | YES      | Balance(unit:cent)      |
| currency | string | YES      | Currency                |
| time     | int64  | NO       | Time (Unix millisecond) |

**Successful Response Example:**

```json
{     
  "balance": 300000,                // int64 Balance(unit:cent)
  "currency": "RMB",                // string Currency
  "time": 1574476825000             // int64 Time (Unix millisecond)
}
```

## Decreasing Balance

Decrease the player's balance (bet、free bet、tips), thereturned balance is in cents and must be an integer If there is no response to the WE request for more than 10 seconds or the response is error, WE will add to the schedule cancel the bet and call the cancel Transaction (/rollback) to let the operator cancel the transaction

Note:\
1."Each" bet will be requested once, and multiple bets will call the API at the same time.\
2.If each bet needs to be split into separate requests, switch to \[Single Bet Mode]\(#Decreasing Balance(Single Bet Mode))\
3.Please"correctly" calculate the balance after each deduction (including payouts), HTTP status code 200 is considered a normal bet, please respond with caution

```
POST (Operator API address)/debit
```

**Request Body:**

| Paramet     | Type          | Required | Description                                                                                                |
| ----------- | ------------- | -------- | ---------------------------------------------------------------------------------------------------------- |
| token       | string        | YES      | The token provided by the operator                                                                         |
| operatorID  | string        | YES      | The operator ID registered in WE                                                                           |
| appSecret   | string        | YES      | The certificate key provided by WE                                                                         |
| playerID    | string        | YES      | Player ID(Max length: 20 characters)                                                                       |
| gameID      | string        | YES      | Game ID                                                                                                    |
| gameRoundID | string        | YES      | gameRound ID                                                                                               |
| currency    | string        | YES      | currency code                                                                                              |
| time        | int64         | YES      | Transaction Time (Unix millisecond)                                                                        |
| ip          | string        | YES      | Client IP                                                                                                  |
| data        | string (json) | YES      | bet data ex: `[{"betID": "","parentBetID": "","betType": "","type": "","amount": 0,"time": 0,"odds": ""}]` |

**Betting data structure**

| Paramet     | Type   | Required | Description                                                             |
| ----------- | ------ | -------- | ----------------------------------------------------------------------- |
| betID       | string | YES      | Bet ID                                                                  |
| parentBetID | string | YES      | Parent Bet ID(Reserved parameters)                                      |
| betType     | string | YES      | Bet Type,Please refer to betCode                                        |
| amount      | int64  | YES      | Amount (Unit: cent Max length: 100 billion cents)                       |
| dpsAmount   | int64  | YES      | Deposit or God of Wealth Fee (Unit: cent Max length: 100 billion cents) |
| time        | int64  | YES      | Transaction Time (Unix millisecond)                                     |
| type        | string | YES      | <p>type:<br>● bet<br>● tip</p>                                          |
| odds        | string | NO       | Odds,Supports up to 6 decimal places.                                   |

**Response Data:**

| Paramet  | Type   | Required | Description             |
| -------- | ------ | -------- | ----------------------- |
| balance  | int64  | YES      | Balance(unit:cent)      |
| currency | string | YES      | Currency                |
| time     | int64  | NO       | Time (Unix millisecond) |
| refID    | string | NO       | WE transactionnumber    |

**Successful Response Example:**

```json
{     
  "balance": 300000,
  "currency": "RMB",
  "time": 1574476825000,
  "refID": "20200420XDCFSEDSE"
}
```

**Error Response Type:**

```json
// HTTP Code:402, insufficient balance
{
  "error": "Insufficient balance"        
}
```

```json
// HTTP Code:404, invalid token
{
  "error":"Invalid Token"
}
```

```json
// HTTP Code:409, duplicate transaction
{
  "error":"Duplicate transaction"
}
```

```json
// HTTP Code:500, internal Server Error
{
  "errorcode": 11013,            // Error codes can be used to control error messages on the game screen.
  "error": "User account locked",
}
```

errorcode can refer to [errorcode](/en/enum/enum-debit-error-code.md)

## Decreasing Balance(Single Bet Mode)

Requires manual setting

Decrease the player's balance (bet、free bet、tips), thereturned balance is in cents and must be an integer If there is no response to the WE request for more than 10 seconds or the response is error, WE will add to the schedule cancel the bet and call the cancel Transaction (/rollback) to let the operator cancel the transaction

Note:

1."Each" bet will be requested once

2.Please"correctly" calculate the balance after each deduction (including payouts), HTTP status code 200 is considered a normal bet, please respond with caution

```
Request: POST (Operator API address)/debit
```

**Request Body:**

| Paramet     | Type   | Required | Description                                                             |
| ----------- | ------ | -------- | ----------------------------------------------------------------------- |
| token       | string | YES      | The token provided by the operator                                      |
| operatorID  | string | YES      | The operator ID registered in WE                                        |
| appSecret   | string | YES      | The certificate key provided by WE                                      |
| playerID    | string | YES      | Player ID(Max length: 20 characters)                                    |
| gameID      | string | YES      | Game ID                                                                 |
| gameRoundID | string | YES      | gameRound ID                                                            |
| currency    | string | YES      | currency code                                                           |
| time        | int64  | YES      | Transaction Time (Unix millisecond )                                    |
| ip          | string | YES      | 客户IP                                                                    |
| betID       | string | YES      | Bet ID                                                                  |
| parentBetID | string | YES      | Parent Bet ID(Reserved parameters)                                      |
| betType     | string | YES      | Bet Type,Please refer to betCode                                        |
| amount      | int64  | YES      | Amount (Unit: cent Max length: 100 billion cents)                       |
| dpsAmount   | int64  | YES      | Deposit or God of Wealth Fee (Unit: cent Max length: 100 billion cents) |

type | string | YES | type:\
● bet\
● tip

**Request Data:**

| Paramet  | Type   | Required | Description             |
| -------- | ------ | -------- | ----------------------- |
| balance  | int64  | YES      | Balance(unit:cent)      |
| currency | string | YES      | Currency                |
| time     | int64  | NO       | Time (Unix millisecond) |
| refID    | string | NO       | WE transactionnumber    |

**Successful Response Example:**

```json
{     
  "balance": 300000,
  "currency": "RMB",
  "time": 1574476825000
}
```

## Increasing Balance

Increase the player's balance, thereturned balance is in cents and must be an integer. If the operator returns fail, WE will retry every hour.To avoid double settlement, the API must check whether the bet has been settled.

Note:

1.Odds support all games except for slot and fishing games.Supports up to 6 decimal places.\
2.The number of times sent is based on betID, one betID is sent once 3.If the network is unstable or the response fails, it will be sent once every hour for 10 days.\
4.The return is in "array" format, and games in the same round and same player will be transmitted simultaneously.\
5.Please be patient when the background has been settled but the API has not been received. This means that your company's line is unstable and the transmission fails. The system will resend once an hour. Please check whether the line is stable first.

```
POST (Operator API address)/credit
```

**Request Paramet:**

| Paramet | Type          | Required | Description                                                            |
| ------- | ------------- | -------- | ---------------------------------------------------------------------- |
| data    | string (json) | YES      | Increasing Balance Data ex: `[{"operatorID": "","appSecret": "",...}]` |

**Add balance data structure**

| Paramet        | Type   | Required | Description                                                     |
| -------------- | ------ | -------- | --------------------------------------------------------------- |
| operatorID     | string | YES      | The operator ID registered in WE                                |
| appSecret      | string | YES      | The certificate key provided by WE                              |
| playerID       | string | YES      | Player ID                                                       |
| gameID         | string | YES      | Game ID                                                         |
| betID          | string | YES      | Bet ID                                                          |
| amount         | string | YES      | Amount (Unit: cent Max length: 100 billion cents)               |
| gameStatus     | string | YES      | [Single wallet gameStatus](/en/enum/enum-single-game-status.md) |
| gameResult     | string | YES      | [Game Result](/en/enum/enum-game-result.md)                     |
| roundCard      | string | YES      | [round Card](/en/enum/enum-roundcard.md)                        |
| roundWin       | string | YES      | [round Result](/en/enum/enum-roundwin.md)                       |
| validBetAmount | string | YES      | Valid bet amount                                                |
| currency       | string | YES      | currency code                                                   |
| time           | string | YES      | Transaction Time ( UNIX )                                       |
| type           | string | YES      | [CreditType](/en/enum/enum-single-credit-type.md)               |
| odds           | string | YES      | Odds,Supports up to 6 decimal places.                           |

**Response Data:**

| Paramet  | Type   | Required | Description             |
| -------- | ------ | -------- | ----------------------- |
| balance  | int64  | YES      | Balance(unit:cent)      |
| currency | string | YES      | Currency                |
| time     | int64  | NO       | Time (Unix millisecond) |
| refID    | string | NO       | WE transactionnumber    |

**Successful Response Example:**

```json
{     
  "balance": 300000,                // int64 Balance(unit:cent)
  "currency": "RMB",                // string Currency
  "time": 1574476825000             // int64 Time (Unix millisecond)
}
```

**Error Response Type:**

```json
// HTTP Code:409, duplicate transaction
{
  "error": "Duplicate transaction"
}
```

```json
// HTTP Code:410, Can't credit
{
  "error": "Can't credit"
}
```

## Resettle Transaction

After the bet has been settled and WE determines that the game result needs to be changed, the amount that must be adjusted for that bet will be returned.This API requires an application for activation. The returned balance is in cents and must be an integer.Operators who wish to connect to this interface must first apply.

备注:

```
1.Odds support all games except for slot and fishing games.Supports up to 6 decimal places.
2.The number of times sent is based on betID, one betID is sent once
3.If the network is unstable or the response fails, it will be sent once every hour for 10 days.
```

```
 POST (Operator API address)/resettlement
```

**Request Paramet:**

| Paramet | Type          | Required | Description                                                  |
| ------- | ------------- | -------- | ------------------------------------------------------------ |
| data    | string (json) | YES      | Resettle Data ex: `[{"operatorID": "","appSecret": "",...}]` |

**Resettlement data structure**

based on[Add balance data structure](#credit_struct)Add two parameters(resettleTime, resettleAmount)

| Paramet        | Type   | Required | Description                                          |
| -------------- | ------ | -------- | ---------------------------------------------------- |
| resettleTime   | string | YES      | ResettleTime(Unix millisecond)                       |
| resettleAmount | string | YES      | Adjust Amount (New Credit Amount - OldCredit Amount) |

**Response Data:**

| Paramet  | Type   | Required | Description             |
| -------- | ------ | -------- | ----------------------- |
| balance  | int64  | YES      | Balance(unit:cent)      |
| currency | string | YES      | Currency                |
| time     | int64  | NO       | Time ( Unixmillisecond) |
| refID    | string | NO       | WE transactionnumber    |

**Successful Response Example:**

```json
{     
  "balance": 300000,                // int64 Balance(unit:cent)
  "currency": "RMB",                // string Currency
  "time": 1574476825000             // int64 Time (Unix millisecond)
}
```

**Error Response Type:**

```json
// HTTP Code:409, duplicate transaction
{
  "error": "Duplicate transaction"
}
```

```json
// HTTP Code:410, Can't credit
{
  "error": "Can't credit"
}
```

## Cancel Transaction

When an error occurs in the game and WE determine the game round is canceled, we'll return the balance that must be returned to the player in the game round. The returned balance is in cents and must be an integer.\
Note:\
1.If rollback transmission fails, it will not be retransmitted. Please ensure that the line is unobstructed.

```
POST (Operator API address)/rollback
```

**Request Paramet:**

| Paramet    | Type   | Required | Description                                                                                                                |
| ---------- | ------ | -------- | -------------------------------------------------------------------------------------------------------------------------- |
| operatorID | string | YES      | The operator ID registered in WE                                                                                           |
| appSecret  | string | YES      | The certificate key provided by WE                                                                                         |
| playerID   | string | YES      | Player ID(Max length: 20 characters)                                                                                       |
| gameID     | string | YES      | Game ID                                                                                                                    |
| betID      | string | YES      | Bet ID                                                                                                                     |
| amount     | string | YES      | <p>(unit: cents)<br>Total amount = bet - credit<br>Positive: increase player's balance<br>0 : operator handle the case</p> |
| currency   | string | YES      | currency code                                                                                                              |
| time       | string | YES      | Transaction Time (Unix millisecond)                                                                                        |
| type       | string | YES      | Transaction type: cancel                                                                                                   |

**Response Data:**

| Paramet  | Type   | Required | Description             |
| -------- | ------ | -------- | ----------------------- |
| balance  | int64  | YES      | Balance(unit:cent)      |
| currency | string | YES      | Currency                |
| time     | int64  | NO       | Time (Unix millisecond) |
| refID    | string | NO       | WE transactionnumber    |

**Successful Response Example:**

```json
{     
  "balance": 300000,                // int64 Balance(unit:cent)
  "currency": "RMB",                // string Currency
  "time": 1574476825000             // int64 Time (Unix millisecond)
}
```

**Error Response Type:**

```json
// HTTP Code:400, missing required parameter
{
  "error": "Bad Request"
}
```

```json
// HTTP Code:409, duplicate transaction
{
  "error": "Duplicate transaction"
}
```

## Verify callback is working

Simply test whether the callback is normal. Please respond with HTTP status code 200.

```
POST (Operator API address)/netcheck
```

**Response Data:**

| Paramet    | Type   | Required | Description                      |
| ---------- | ------ | -------- | -------------------------------- |
| operatorID | string | YES      | The operator ID registered in WE |

**Successful Response Example:**

```json
{     
  "operatorID": "test12345"
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.pkg333.app/en/single-wallet-api_en.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
