# 轉帳錢包接口

**最近更新： 2025-12-24**

## API基本信息

* 請API都需加入Headers參數`signature`,簽名方式如下,所有API通用。
* 請求格式為 `application/x-www-form-urlencoded`
* 回傳格式為 `JSON`
* 所有時間和時間戳相關欄位均以**毫秒為預設單位**。
* 簽名格式:\
  hex(sha256(appSecret + requestTime))\
  Golang範例:<br>

```
requestTimeStr := strconv.Itoa(requestTime)
hash := sha256.Sum256([]byte(appSecret + requestTimeStr))
signature := hex.EncodeToString(hash[:])
```

### 請求標頭(Request Header):

| 參數        | 類型     | 是否必填 | 描述                                                      |
| --------- | ------ | ---- | ------------------------------------------------------- |
| signature | string | YES  | 营运商呼叫平台時必填，驗證請求簽名, hex(sha256(appSecret + requestTime)) |

### 回應標頭:

| 參數           | 類型     | 是否必填 | 描述               |
| ------------ | ------ | ---- | ---------------- |
| Content-Type | string | YES  | application/json |

## 創建玩家

```
POST /player/create
```

**請求參數:**

| 參數          | 類型     | 是否必填 | 描述                       |
| ----------- | ------ | ---- | ------------------------ |
| operatorID  | string | Y    | 註冊的營運商 ID                |
| playerID    | string | Y    | 玩家 ID（最大長度：20 字元）        |
| nickname    | string | Y    | 玩家暱稱（最大長度：80 字元）         |
| requestTime | int64  | Y    | 請求時間限制15分鐘內（millisecond） |

**響應資料格式:** `JSON`

```json
{
    "playerID": "mike",    // string 玩家ID,
    "currency": "RMB",     // string 货币,
    "time": 1627884739000  // int64 时间(millisecond)
}
```

## 轉入額度

對玩家錢包進行存款

```
POST /player/deposit
```

**請求參數:**

| 參數          | 類型     | 是否必填 | 描述                       |
| ----------- | ------ | ---- | ------------------------ |
| operatorID  | string | Y    | 註冊的營運商 ID                |
| playerID    | string | Y    | 玩家 ID（最大長度：20 字元）        |
| uid         | string | Y    | 當前交易編號（最大長度：50 字元）       |
| amount      | int64  | Y    | 金額（單位：分，最大長度：1000 亿分）    |
| trackID     | string | N    | Track ID                 |
| requestTime | int64  | Y    | 請求時間限制15分鐘內（millisecond） |

**響應資料格式:** `JSON`

```json
{
  "balance": 10000,                // int64 金額(单位:分)
  "currency": "RMB",               // string 货币
  "time": 1627884739000,           // int64 时间(millisecond)
  "refID": "c43p0ke14076gahfep5g"  // string 交易编号
}
```

## 轉出額度

對玩家錢包進行提款

```
POST /player/withdraw
```

**請求參數:**

| 參數          | 類型     | 是否必填 | 描述                       |
| ----------- | ------ | ---- | ------------------------ |
| operatorID  | string | Y    | 註冊的營運商 ID                |
| playerID    | string | Y    | 玩家 ID（最大長度：20 字元）        |
| uid         | string | Y    | 當前交易編號（最大長度：50 字元）       |
| amount      | int64  | Y    | 金額（單位：分，最大長度：1000 亿分）    |
| trackID     | string | N    | Track ID                 |
| requestTime | int64  | Y    | 請求時間限制15分鐘內（millisecond） |

**響應資料格式:** `JSON`

```json
{
  "balance": 10000,                // int64 金額(单位:分)
  "currency": "RMB",               // string 货币
  "time": 1627884739000,               // int64 时间(millisecond)
  "refID": "c43p0ke14076gahfep5g"  // string 交易编号
}
```

## 查詢餘額

取得玩家餘額

```
POST /player/balance
```

**請求參數:**

| 參數          | 類型     | 是否必填 | 描述                       |
| ----------- | ------ | ---- | ------------------------ |
| operatorID  | string | Y    | 註冊的營運商 ID                |
| playerID    | string | Y    | 玩家 ID（最大長度：20 字元）        |
| requestTime | int64  | Y    | 請求時間限制15分鐘內（millisecond） |

**響應資料格式:** `JSON`

```json
{
  "balance": 10000,     // int64 金額(单位:分)
  "currency": "RMB",    // string 货币
  "time": 1627884739000 // int64 时间(millisecond)
}
```

## 轉帳紀錄

歷史紀錄目前限制1分鐘內可調用150次，結束與開始時間間隔不得大於一個月， 金額以`分`為單位，以投注時間搜尋開始時間與結束時間內的資料,預設資料筆數為50筆。 輸入 `uid` 參數時, 開始與結束時間為非必填。

```
POST /history/transfer
```

**請求參數:**

| 參數          | 類型     | 是否必填 | 描述                                 |
| ----------- | ------ | ---- | ---------------------------------- |
| operatorID  | string | Y    | 註冊的營運商 ID                          |
| startTime   | int64  | Y    | 搜尋開始時間（millisecond），與結束時間間隔不得大於一個月 |
| endTime     | int64  | Y    | 搜尋結束時間（millisecond），與開始時間間隔不得大於一個月 |
| playerID    | string | N    | 玩家 ID（最大長度：20 字元）                  |
| uid         | string | N    | 當前交易編號（最大長度：50 字元）                 |
| limit       | int    | N    | 資料限制筆數（預設：50，最大：500）               |
| requestTime | int64  | Y    | 請求時間限制15分鐘內（millisecond）           |

**響應資料格式:** `JSON`

```json
{
  "dataCount": 50, // int 资料笔数
  "data": 
        [{
          "operatorID": "xf",  // string 注册的营运商ID
          "playerID": "mike",  // string 玩家ID
          "uid": "d210414003", // string 交易编号
          "refID": "c43p0ke14076gahfep5g", // string 交易编号
          "transferType": "deposit",  // string 交易类型
          "transferTime": 1618338629000, // int64 时间(Umillisecond)
          "tranAmount": 10000, // int64 交易金额(單位:分)
          "trackID": "",       // string 主机ID
          "balance": 20000     // int64 金額(单位:分)
        }] 
}
```

## 玩家額度列表

搜尋目前馀額大於零的玩家列表

```
POST /report/balance
```

**請求參數:**

| 參數          | 類型     | 是否必填 | 描述                       |
| ----------- | ------ | ---- | ------------------------ |
| operatorID  | string | Y    | 註冊的營運商 ID                |
| requestTime | int64  | Y    | 請求時間限制15分鐘內（millisecond） |

**響應資料格式:** `JSON`

```json
{

  "dataCount": 70,                // int 资料笔数
  "data": [{
             "playerID": "wetest",// string 玩家ID
             "balance": 1000000   // int64 金額(单位:分)
          }]
}
```


---

# 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/transfer-wallet-api_cn.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.
