> ## 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.

# Grant free spins

> Grant free spins: request parameters, response format and response codes.

> [!NOTE]
>
> * Issues grants to every member in memberList as one batch (joinOptions=add). The batch succeeds or fails as a whole (all-or-nothing).
> * If any member does not exist, the whole batch is rejected with ACCOUNT\_DOES\_NOT\_EXIST, and errorMessage lists the missing accounts.
> * Quota check: if (grants already issued + members in this memberList) exceeds the event's maxGrantCount, the whole batch is rejected with FREESPIN\_QUOTA\_FULL.
> * If any member is already bound (allowDuplicateJoin=false) or has reached the per-member limit (max\_grants\_per\_member), the whole batch is rejected with BAD\_PARAMETERS, and the error message lists those members.
> * If the event is invalid (not found, not active, expired or currency mismatch), the whole batch is rejected with FREESPIN\_EVENT\_NOT\_FOUND or BAD\_PARAMETERS.
> * On success, grants is returned; each entry contains grantID and memberAccount.

## Path

```text theme={null}
POST {host}/vendor/v2.0/freespin/bind
```

## Headers

<table>
  <colgroup>
    <col width="27%" />

    <col width="10%" />

    <col width="7%" />

    <col width="56%" />
  </colgroup>

  <thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead>

  <tbody>
    <tr><td>`Authorization`</td><td>string</td><td>Yes</td><td>Token we provide</td></tr>
    <tr><td>`Content-Type`</td><td>string</td><td>Yes</td><td>`multipart/form-data`</td></tr>
  </tbody>
</table>

## Request parameters

<table>
  <colgroup>
    <col width="27%" />

    <col width="10%" />

    <col width="7%" />

    <col width="11%" />

    <col width="45%" />
  </colgroup>

  <thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Signed</th><th>Description</th></tr></thead>

  <tbody>
    <tr><td>`channelID`</td><td>number</td><td>Yes</td><td>✓</td><td>Channel ID (use 1 if you have no channels)</td></tr>
    <tr><td>`eventID`</td><td>string</td><td>Yes</td><td>✓</td><td>Event ID (24-character hex)</td></tr>
    <tr><td>`memberList`</td><td>string\[]</td><td>Yes</td><td>✓</td><td>Member accounts (at least 1, no duplicates, no empty strings). In form-data, repeat the field once per value.</td></tr>
    <tr><td>`sign`</td><td>string</td><td>Yes</td><td /><td>Signature. See [Signature](https://doc.va777.net/en/v2/guides/signature.md) for how to generate it</td></tr>
  </tbody>
</table>

## Response

Success (the HTTP status code is always 200; check `status.code` for the result)

<table>
  <colgroup>
    <col width="34%" />

    <col width="12%" />

    <col width="54%" />
  </colgroup>

  <thead><tr><th>Field</th><th>Type</th><th>Description</th></tr></thead>

  <tbody>
    <tr><td>`data`</td><td>object</td><td /></tr>
    <tr><td>`data.grants`</td><td>object\[]</td><td>Grant results (only present when the whole batch succeeds)</td></tr>
    <tr><td>`data.grants[].memberAccount`</td><td>string</td><td>Member account</td></tr>
    <tr><td>`data.grants[].grantID`</td><td>string</td><td>Grant ID (24-character hex)</td></tr>
    <tr><td>`status`</td><td>object</td><td>Response status. See [Response format](https://doc.va777.net/en/v2/guides/request-format.md#response-format)</td></tr>
  </tbody>
</table>

### Response example

```json theme={null}
{
  "data": {
    "grants": [
      {
        "memberAccount": "test123",
        "grantID": "abccc1234567890aaaaa1254"
      },
      {
        "memberAccount": "test1234",
        "grantID": "abccc1234567890aaaaa1299"
      }
    ]
  },
  "status": {
    "code": "0",
    "message": "success",
    "datetime": "2022-07-01T10:13:54.920+08:00",
    "traceCode": "7cf25e1957cc47fe8e01f1a7c6d504d6"
  }
}
```

## Response codes

Besides the [common codes](https://doc.va777.net/en/v2/reference/response-codes.md), this API may also return:

| Code | Description |
| - | - |
| `205` | Account does not exist |
| `416` | Event not found |
| `417` | Event member limit reached |
| `429` | Too many requests |


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