> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cog888.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Wallet API Overview

> Wallet API Request and Response Format Description

Wallet-API is the API that the game server requests to the vendor for modifying player balances. This API is implemented by the vendor.

## Body Format

### Request Parameters

| Parameter    | Description                                                 | Type            |
| ------------ | ----------------------------------------------------------- | --------------- |
| platform\_id | Channel ID                                                  | String (5)      |
| token        | Verification code, MD5 hash result of params and wallet key | String (32)     |
| uuid         | Custom unique request ID                                    | String (32-128) |

### Verification Code Description

The verification code `token` is the MD5 hash result of specified field values from request parameters plus the wallet key.

The following examples use wallet key `52342182001A068859C20EB08F738839`:

**Request example 1:**

The specified fields for `/api/callback/balance` are `platform_id`, `uuid`, `account`

```json theme={null}
{
    "platform_id": "AXTES",
    "token": "F661C3377E67D65841C21F6A0D23B4D0",
    "timestamp": 1705976933889,
    "uuid": "e69da788a6c841d4953c475fc42bf464",
    "account": "walter123"
}
```

Request token: Take values (platform\_id + uuid + account) to get `AXTESe69da788a6c841d4953c475fc42bf464walter123`, add wallet key, MD5 hash result is `F661C3377E67D65841C21F6A0D23B4D0`.

***

**Request example 2:**

The specified fields for `/dt/callback/apply_reserved` are `platform_id`, `uuid`, `account`, `type`, `credit`, `proposal_id`, `transaction_id`, `secret_key`

```json theme={null}
{
    "platform_id": "AXTES",
    "token": "286AEF636115802EF88A761B20228ADE",
    "timestamp": 1705976933889,
    "uuid": "e69da788a6c841d4953c475fc42bf464",
    "account": "walter123",
    "type": 1,
    "credit": 2000,
    "proposal_id": 954654,
    "transaction_id": "556-20240101AC152233"
}
```

Request token: Take values (platform\_id + uuid + account + type + credit + proposal\_id + transaction\_id + secret\_key) to get `AXTESe69da788a6c841d4953c475fc42bf464walter12312000954654556-20240101AC15223352342182001A068859C20EB08F738839`, then add wallet key and MD5 hash result is `286aef636115802ef88a761b20228ade`.

***

### Response Parameters

| Parameter | Description              | Type            |
| --------- | ------------------------ | --------------- |
| code      | Error code               | Number          |
| message   | Error message            | String          |
| uuid      | Custom unique request ID | String (32-128) |
| timestamp | UNIX time, milliseconds  | Number          |
| data      | Response data            | Object          |

**Response example:**

```json theme={null}
{
    "code": 0,
    "message": "success",
    "uuid": "e69da788a6c841d4953c475fc42bf464",
    "timestamp": 1668580007001,
    "data": {
        "account": "tony88888",
        "platform_id": "AXTES",
        "credit": 115,
        "reserved": 100,
        "balance": 215
    }
}
```
