Transfer Wallet API Integration | Spinfinity777

Transfer Wallet Integration Guide

Revision History

| Date | Version | Editor | Change Log |
| --- | --- | --- | --- |
| 2024/08/31 | 1.1.1 | S7 | Added test environment domain, removed redundant login fields, added language and currency codes. |
| 2024/08/20 | 1.0.3 | S7 | Complete initial version. |

Introduction

This document describes the transfer wallet integration for operators that connect to Spinfinity777 game services.

In this document:

Test environment:

Main domain: https://www.spinfinity777.com/h5
Game list endpoint: https://www.spinfinity777.com/h5/external/game-list

After the test integration is completed, both parties should provide production domains for production launch.

1. Preparation

1.1 Required Operator Information

1.2 Credentials

After the submitted information is reviewed, Spinfinity777 provides:

Keep `app_id`, `app_key`, `password`, and `api_url` confidential. Do not expose them in frontend code or public repositories.

2. API Rules

2.1 General Rules

Success example:

{
  "code": 0,
  "msg": "ok",
  "data": {}
}

Failure example:

{
  "code": 1,
  "msg": "token is empty"
}

2.2 Signature Algorithm

1. Sort all request parameters except `sign` by ASCII order of key. 2. Join them as `key=value` pairs with `&`. 3. Append `&app_key={app_key}`. 4. Calculate MD5 and convert the result to lowercase.

Example:

app_id=10000&non_str=jk7545s&time=1536635343&app_key=64189fd2b30ce1c93fc2b035d2e3bc5e

The generated MD5 result is the request `sign`.

3. API List

3.1 Get Game List

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| app_id | String | Yes | Operator app ID. |
| time | int | Yes | Unix timestamp in seconds. |
| non_str | String | Yes | Random string, recommended length above 20. |
| sign | String | Yes | Signature generated by the signing algorithm. |

Response example:

{
  "list": [
    {
      "game_id": 1006,
      "game_name_eng": "Make a fortune",
      "image_url": "https://www.spinfinity777.com/h5/game_icon_1006.png",
      "create_time": "2006-01-02 15:04:05",
      "status": 1
    }
  ]
}

Game status:

| Status | Description |
| --- | --- |
| 1 | Online |
| 2 | Offline |
| 3 | Maintenance |
| 4 | Deleted |
| 5 | Preview |

3.2 Transfer

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| app_id | String | Yes | Operator app ID. |
| time | int | Yes | Unix timestamp in seconds. |
| non_str | String | Yes | Random string. |
| openid | String | Yes | Unique player identifier. |
| guid | String | Yes | Operator transfer order ID. |
| currency | String | Yes | Currency code, such as USD or VND. |
| change_amount | String | Yes | Transfer amount, supports two decimals. |
| balance_type | int | Yes | `1`: operator transfers into Spinfinity777. `2`: operator transfers out from Spinfinity777. |
| notify_url | String | No | Async callback URL. Empty means no callback. |
| remark | String | No | Custom callback data, returned as-is. |
| sign | String | Yes | Signature. |

Response example:

{
  "code": 0,
  "data": {
    "guid": "e2322b19-3a83-3217-abcb-02d915aab80e",
    "order_no": "201809111054443657592716",
    "balance_type": "1",
    "status": "1",
    "change_amount": "200.00",
    "openid": "75sd4f54ds5sdfsdds",
    "username": "username1",
    "nickname": "nickname1",
    "create_time": "2018-09-11 10:54:44",
    "confirm_time": "2018-09-11 10:54:44",
    "time": 1562837954,
    "remark": "7777",
    "result_msg": ""
  },
  "msg": "Success"
}

3.3 Transfer Callback

The callback uses the same signing rule. The operator should verify the signature and return success after processing.

3.4 Launch Game

Common parameters include `app_id`, `time`, `non_str`, `openid`, `game_id`, `currency`, `language`, and `sign`.

The response returns the game URL used by the operator to redirect or open the game client.

4. Common Error Codes

| Code | Message |
| --- | --- |
| 0 | Success |
| 2 | Parameter parse error |
| 1000 | Account does not exist |
| 1001 | Player does not exist |
| 1003 | Order already exists |
| 1004 | Order exception |
| 1006 | Transfer out amount exception |
| 1008 | Operator does not exist |
| 1009 | Operator credit is insufficient |
| 1010 | app_id is empty |
| 1011 | Invalid time |
| 1012 | openid is empty |
| 1013 | guid is empty |
| 1014 | Invalid change_amount |
| 1015 | Invalid balance_type |
| 1016 | Service node does not exist |
| 1017 | Another order is processing |

5. Integration Notes