Skip to main content

一. 基本资讯

  1. 本文档由 Wallet-APIGame-API 组成。
    • Wallet-API 是 games 要变更玩家余额,而向接入方请求的 API,由接入方实现。
    • Game-API 是接入方向 games 请求进入游戏的 URL、游戏相关数据的 API。
  2. 所有 API 都是 POST method 且仅支持 application/json

二. Wallet-API 说明

Request 参数说明

参数说明类型
productId产品号String
timestampUNIX time,毫秒Number
params请求参数Object
key签名,详见签名算法String{64}
uuid自定义的唯一性请求序号String{64}

签名算法

签名值 key 是对 params 的 productId、uuid 依序取值添加钱包金钥后,hash sha256 的结果;SHA256(productId+uuid+玩家金钥) 下述以钱包金钥 52342182001A068859C20EB08F738839 举例说明:
Request example
{
    "productId": "AXTES",
    "key": "e51162d557add4a43ca8d5b581a6306fa2e190a05bbe6a7dd0716c73473a066d",
    "timestamp": 1705976933889,
    "uuid": "e69da788a6c841d4953c475fc42bf464",
    "params": {
        "username": "walter123",
        "currency": "RMB"
    }
}
Request key: 对 params 的productId、uuid 依序取值添加钱包金钥后 (productId+uuid+玩家金钥),得到 AXTESe69da788a6c841d4953c475fc42bf4644d5c01842f37d90651f9693783c6564279fed6f4,添加钱包金钥后,hash sha256 结果为 e51162d557add4a43ca8d5b581a6306fa2e190a05bbe6a7dd0716c73473a066d

Response 参数说明

参数说明类型
code错误代码Number
message错误讯息String
requestID自定义的唯一性请求序号String{64}
data回传资料Object
Response example
{
    "code": 0,
    "message": "success",
    "requestID": "e69da788a6c841d4953c475fc42bf464",
    "data": {
        "username": "walter123",
        "balance": 200.5,
        "timestamp": 1705976933889
    }
}