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

# Quickstart

> Walk through the transfer wallet integration: create a member, deposit, get a game link, fetch bet records and withdraw.

This page walks through one member's full session to show how the transfer wallet integration works. Before you start, complete [Before you start](https://doc.va777.net/en/v2.md#before-you-start) on the overview page to get the API domain `{host}`, the token and the API key.

## Flow

```mermaid theme={null}
sequenceDiagram
    participant M as Member
    participant S as Your server
    participant V as VA API
    S->>V: 1. Create member member/create
    S->>V: 2. Deposit transaction/deposit
    S->>V: 3. Get game link game/link
    V-->>S: Game URL url
    S-->>M: Redirect to the game URL
    M->>V: Play
    loop Periodically
        S->>V: 4. Fetch bet records betlog/listByTime
    end
    S->>V: 5. Withdraw transaction/withdraw
```

In transfer wallet mode, the member's game balance is held by us. Before the member plays, you transfer balance in from your own wallet (deposit). When the member leaves, you transfer it back (withdraw).

## About the examples

* Every example computes `sign` with the API key `a188va`. Use the API key we give you, and follow [Signature](https://doc.va777.net/en/v2/guides/signature.md).
* `POST` requests are sent as `multipart/form-data` (curl `-F`). `GET` requests are sent as a query string (curl `-G --data-urlencode`).
* Check `status.code` in every response. `0` means success; see [Response codes](https://doc.va777.net/en/v2/reference/response-codes.md) for the rest.

## 1. Create a member

Before a member plays for the first time, call [Create member](https://doc.va777.net/en/v2/api-reference/member/create.md). The same account in different channels is treated as different members, and accounts are case-sensitive.

```bash theme={null}
curl -X POST "{host}/vendor/v2.0/member/create" \
  -H "Authorization: {token}" \
  -F channelID=1 \
  -F account=player001 \
  -F currency=CNY \
  -F sign=999d2836a05da3baa7f951d12954c23a
```

If the account already exists, the response code is `202` and you can keep using that account.

## 2. Deposit

Call [Deposit](https://doc.va777.net/en/v2/api-reference/transaction/deposit.md) to move balance into the member's wallet. `transactionID` must be unique and start with `deposit-`.

```bash theme={null}
curl -X POST "{host}/vendor/v2.0/transaction/deposit" \
  -H "Authorization: {token}" \
  -F transactionID=deposit-20250101000001 \
  -F channelID=1 \
  -F account=player001 \
  -F currency=CNY \
  -F amount=10.00 \
  -F sign=4899d19dd28e49b04e1656afb1f7dc4f
```

The response `data` includes the balance before and after, `balanceBefore` and `balanceAfter`. Keep the `transactionID` and the response so you can reconcile later with [Get transaction detail](https://doc.va777.net/en/v2/api-reference/transaction/detail.md).

## 3. Get a game link

Call [Get game link](https://doc.va777.net/en/v2/api-reference/game/link.md) and redirect the member to the `url` in the response. Set `gameID` to `0` to open the game lobby; to open a specific game, look up its ID with [Get game list](https://doc.va777.net/en/v2/api-reference/game/list.md).

```bash theme={null}
curl -G "{host}/vendor/v2.0/game/link" \
  -H "Authorization: {token}" \
  --data-urlencode channelID=1 \
  --data-urlencode account=player001 \
  --data-urlencode currency=CNY \
  --data-urlencode gameID=0 \
  --data-urlencode gamePlat=web \
  --data-urlencode app=N \
  --data-urlencode lang=en-US \
  --data-urlencode clientIP=203.0.113.10 \
  --data-urlencode sign=72f94e26ece298e78d08b4ffedf99f63
```

A game link is valid for 300 seconds, so redirect the member right away. `clientIP` is the member's IP and is not signed. See [Languages](https://doc.va777.net/en/v2/reference/languages.md) for supported language codes.

## 4. Fetch bet records

While members play, call [List bet records](https://doc.va777.net/en/v2/api-reference/betlog/list-by-time.md) periodically. On the first query, send `nextToken` as an empty string; the empty value is still included in the signature.

```bash theme={null}
curl -G "{host}/vendor/v2.0/betlog/listByTime" \
  -H "Authorization: {token}" \
  --data-urlencode channelID=1 \
  --data-urlencode startTime=2025-12-01T00:00:00.000+08:00 \
  --data-urlencode endTime=2025-12-01T00:01:00.000+08:00 \
  --data-urlencode nextToken= \
  --data-urlencode maxResults=5000 \
  --data-urlencode sign=d1afe83cb4e05a496cc2311cc0cbc2f6
```

When there is more than one page, pass the `nextToken` from the previous response as described in [Pagination](https://doc.va777.net/en/v2/guides/pagination.md). For continuous fetching, make each query's start time equal to the previous query's end time so no bets are missed.

## 5. Withdraw

When the member finishes, call [Withdraw](https://doc.va777.net/en/v2/api-reference/transaction/withdraw.md) to move the balance back to your wallet. `transactionID` must be unique and start with `withdraw-`. You can check the amount first with [Get member balance](https://doc.va777.net/en/v2/api-reference/member/balance.md).

```bash theme={null}
curl -X POST "{host}/vendor/v2.0/transaction/withdraw" \
  -H "Authorization: {token}" \
  -F transactionID=withdraw-20250101000001 \
  -F channelID=1 \
  -F account=player001 \
  -F currency=CNY \
  -F amount=10.00 \
  -F sign=67628704041cb512f64c16540262d788
```

## Reconciliation

| Purpose | API |
| - | - |
| Transaction records | [List transactions](https://doc.va777.net/en/v2/api-reference/transaction/list.md), [Get transaction detail](https://doc.va777.net/en/v2/api-reference/transaction/detail.md) |
| Balance changes | [List balance changes](https://doc.va777.net/en/v2/api-reference/transaction/change-list.md) |
| Win/loss summaries | [Get currency report](https://doc.va777.net/en/v2/api-reference/report/currency.md), [Get member report](https://doc.va777.net/en/v2/api-reference/report/member.md) |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.