# Baccarat

```markdown
```

## API Documentation

***

### **Connection Information**

To connect to the API, the following information must be issued:

* **`agent_id`**: Common agent ID used for API connection.
* **`agent_pass`**: Password for admin use.
* **`agent_key`**: Key value used for API connection.
* **`API_URL`**: Common API connection address.
* **`ADMIN_URL`**: Address for administrator access.
* **`seamless_url`**: Callback address for receiving callback data (provided by the agent).
* **`update_url`**: Callback address for receiving result changes, etc. (provided by the agent).

***

### **API Request Format**

API requests use the HTTP Protocol (`GET`, `POST`). The format is as follows:

<HTTP://API\\_URL/method\\_url?agent\\_id=xxx\\&time=xx\\&data=xxxx\\&key=xxx>

* **`Protocol`**: `GET`.
* **`method_url`**: Command URL for API requests.
* **`agent_id`**: Issued agent ID.
* **`time`**: Time of API request (Unix Timestamp, 10 digits).
* **`data`**: Information to be requested, encoded in Base64.
* **`key`**: MD5 key value of `agent_id + time + api_key + data (Base64 encoded)`, case insensitive.

***

### **Data Request Structure**

The `data` parameter is structured as:

name1=value1\&name2=value2\&name3=value3

This must be encoded in Base64.

* **Example**:

Base64(name1=value1\&name2=value2\&name3=value3)

***

### **Common API Sample Data**

#### **Agent Info**

* `agent_id`: `test`
* `api_key`: `12345678901234567890123456789012`

***

#### **account\_init**

| **Item**               | **Description**                                                                                                                                                           |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Request Data**       | `user_id=2710t001&currency=KRW`                                                                                                                                           |
| **BASE64 Encoding**    | `dXNlcl9pZD0yNzEwdDAwMSZjdXJyZW5jeT1LUlc=`                                                                                                                                |
| **String for MD5**     | `test171026797668612345678901234567890123456789012dXNlcl9pZD0yNzEwdDAwMSZjdXJyZW5jeT1LUlc=`                                                                               |
| **MD5**                | `29babd5b3fe8d1c8b9c467ed2409b690`                                                                                                                                        |
| **Final Request Data** | `http://stage.dwclub6789.com:9000/api/v2/account_init?agent_id=test&time=1710267976686&data=dXNlcl9pZD0yNzEwdDAwMSZjdXJyZW5jeT1LUlc=key=29babd5b3fe8d1c8b9c467ed2409b690` |
| **Result**             | `{ "result_code": 0 }`                                                                                                                                                    |

***

#### **game\_lobby**

| **Item**               | **Description**                                                                                                                                                                                                                                                                                                                                                         |
| ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Request Data**       | `user_id=2710t001&currency=KRW&language=KO&home_url=https://www.dwclub888.com&bet_n_max=1000000&bet_n_min=10000&bet_t_max=125000&bet_t_min=1000&bet_r_max=90000&bet_r_min=1000`                                                                                                                                                                                         |
| **BASE64 Encoding**    | `dXNlcl9pZD0yNzEwdDAwMSZjdXJyZW5jeT1LUlcmbGFuZ3VhZ2U9S08maG9tZV91cmw9aHR0cHM6Ly93d3cuZHdjbHViODg4LmNvbSZiZXRfbl9tYXg9MTAwMDAwMCZiZXRfbl9taW49MTAwMDAmYmV0X3RfbWF4PTEyNTAwMCZiZXRfdF9taW49MTAwMCZiZXRfcl9tYXg9OTAwMDAmYmV0X3JfbWluPTEwMDA=`                                                                                                                              |
| **String for MD5**     | `test171026845922512345678901234567890123456789012dXNlcl9pZD0yNzEwdDAwMSZjdXJyZW5jeT1LUlcmbGFuZ3VhZ2U9S08maG9tZV91cmw9aHR0cHM6Ly93d3cuZHdjbHViODg4LmNvbSZiZXRfbl9tYXg9MTAwMDAwMCZiZXRfbl9taW49MTAwMDAmYmV0X3RfbWF4PTEyNTAwMCZiZXRfdF9taW49MTAwMCZiZXRfcl9tYXg9OTAwMDAmYmV0X3JfbWluPTEwMDA=`                                                                             |
| **MD5**                | `0a734b6781f0c2a46e4c833b4137f691`                                                                                                                                                                                                                                                                                                                                      |
| **Final Request Data** | `http://stage.dwclub6789.com:9000/api/v2/game_lobby?agent_id=test&time=1710268459225&data=dXNlcl9pZD0yNzEwdDAwMSZjdXJyZW5jeT1LUlcmbGFuZ3VhZ2U9S08maG9tZV91cmw9aHR0cHM6Ly93d3cuZHdjbHViODg4LmNvbSZiZXRfbl9tYXg9MTAwMDAwMCZiZXRfbl9taW49MTAwMDAmYmV0X3RfbWF4PTEyNTAwMCZiZXRfdF9taW49MTAwMCZiZXRfcl9tYXg9OTAwMDAmYmV0X3JfbWluPTEwMDA=key=0a734b6781f0c2a46e4c833b4137f691` |
| **Result**             | `{ "result_code": 0, "response_data": { "game_url": "http://dowinluck.com:8090/game?s=encoded_url&lang=KO" } }`                                                                                                                                                                                                                                                         |

***

### **API Response Format**

The API response is returned in JSON format.

| **Parameter Name** | **Type** | **Description**                      |
| ------------------ | -------- | ------------------------------------ |
| `result_code`      | `int`    | 0 = success, non-zero = error codes. |
| `error_message`    | `string` | Error message if an error occurs.    |
| `response_data`    | `string` | Result data in JSON format.          |

***

### **Common Parameter Values**

| **Parameter Name** | **Type** | **Description**                                        |
| ------------------ | -------- | ------------------------------------------------------ |
| `currency`         | `string` | KRW, USD, JPY, CNY, PHP                                |
| `language`         | `string` | KO = Korean, EN = English, CN = Chinese, JP = Japanese |
| `card suit`        | `string` | H = Hearts, D = Diamonds, S = Spades, C = Clubs        |
| `card number`      | `string` | 1 \~ 10 = Numbers, 11 = Jack, 12 = Queen, 13 = King    |

***

### **Result Codes**

| **Code** | **Description**                            |
| -------- | ------------------------------------------ |
| `0`      | Request succeeded.                         |
| `1`      | Unknown error.                             |
| `2`      | Missing required items in the API request. |
| `3`      | Key error (Invalid MD5 key).               |
| `4`      | Data format error.                         |
| `5`      | Request expired.                           |
| `6`      | Incorrect `agent_id`.                      |
| `9`      | Blocked User.                              |
| `100`    | Data value error.                          |
| `101`    | No permission.                             |
| `102`    | Insufficient balance.                      |
| `103`    | Integration Failure.                       |

***

### **Seamless API Information**

* **Request Format**:
* API communication uses the HTTP Protocol `POST`.
* **Data Format**:
* Data to be sent and received uses JSON format.
* **Encryption**:
* Encrypt JSON data using `AES 256, ECB, PKCS7 (Java: PKCS5)`.
* **Example**:

```json
{
  "command": "login",
  "time": 1709650800,
  "data": { "user_id": "test_id" }
}
```

Encrypted Example:

"4hd9JAR2qN3t5wNdzggG55aLmcSU00FkpVZ4i1hFNx8NlJhUS+Ol+8A0STva4wwfH0hAlSnTlMtRUU0oeUIpV4QMFfpiVDWRdiRKamTJDgfndUi8kiYa+lDN7m5ZhFd2"

### **GameServer to Agent System Request Format**

| **Parameter Name** | **Type** | **Description**             |
| ------------------ | -------- | --------------------------- |
| `command`          | `string` | Command name.               |
| `time`             | `int64`  | Unix Timestamp (10 digits). |
| `data`             | `JSON`   | Data in JSON format.        |

***

### **Agent System to GameServer Response Format**

| **Parameter Name** | **Type** | **Description**                      |
| ------------------ | -------- | ------------------------------------ |
| `result`           | `int`    | 0 = success, non-zero = error codes. |
| `agent_id`         | `string` | Issued agent ID.                     |
| `time`             | `int64`  | Unix Timestamp (10 digits).          |
| `data`             | `JSON`   | Data in JSON format.                 |

{% openapi src="/files/sCyBFzyVyKOnQsSmnnPS" path="/account\_init" method="get" %}
[bac\_api\_1\_0\_1.json](https://4232187784-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7D98PSh8DfLKiZfa7QX7%2Fuploads%2F8ftRhPbcdGoxoU6JS7RD%2Fbac_api_1_0_1.json?alt=media\&token=c1921726-86a2-45d6-9d0d-b51f3e15c2d9)
{% endopenapi %}

{% openapi src="/files/sCyBFzyVyKOnQsSmnnPS" path="/account\_balance" method="get" %}
[bac\_api\_1\_0\_1.json](https://4232187784-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7D98PSh8DfLKiZfa7QX7%2Fuploads%2F8ftRhPbcdGoxoU6JS7RD%2Fbac_api_1_0_1.json?alt=media\&token=c1921726-86a2-45d6-9d0d-b51f3e15c2d9)
{% endopenapi %}

{% openapi src="/files/sCyBFzyVyKOnQsSmnnPS" path="/account\_deposit" method="get" %}
[bac\_api\_1\_0\_1.json](https://4232187784-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7D98PSh8DfLKiZfa7QX7%2Fuploads%2F8ftRhPbcdGoxoU6JS7RD%2Fbac_api_1_0_1.json?alt=media\&token=c1921726-86a2-45d6-9d0d-b51f3e15c2d9)
{% endopenapi %}

{% openapi src="/files/sCyBFzyVyKOnQsSmnnPS" path="/account\_withdraw" method="get" %}
[bac\_api\_1\_0\_1.json](https://4232187784-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7D98PSh8DfLKiZfa7QX7%2Fuploads%2F8ftRhPbcdGoxoU6JS7RD%2Fbac_api_1_0_1.json?alt=media\&token=c1921726-86a2-45d6-9d0d-b51f3e15c2d9)
{% endopenapi %}

{% openapi src="/files/sCyBFzyVyKOnQsSmnnPS" path="\[login]" method="post" %}
[bac\_api\_1\_0\_1.json](https://4232187784-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7D98PSh8DfLKiZfa7QX7%2Fuploads%2F8ftRhPbcdGoxoU6JS7RD%2Fbac_api_1_0_1.json?alt=media\&token=c1921726-86a2-45d6-9d0d-b51f3e15c2d9)
{% endopenapi %}

{% openapi src="/files/sCyBFzyVyKOnQsSmnnPS" path="\[bet]" method="post" %}
[bac\_api\_1\_0\_1.json](https://4232187784-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7D98PSh8DfLKiZfa7QX7%2Fuploads%2F8ftRhPbcdGoxoU6JS7RD%2Fbac_api_1_0_1.json?alt=media\&token=c1921726-86a2-45d6-9d0d-b51f3e15c2d9)
{% endopenapi %}

{% openapi src="/files/sCyBFzyVyKOnQsSmnnPS" path="\[bet\_cancel]" method="post" %}
[bac\_api\_1\_0\_1.json](https://4232187784-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7D98PSh8DfLKiZfa7QX7%2Fuploads%2F8ftRhPbcdGoxoU6JS7RD%2Fbac_api_1_0_1.json?alt=media\&token=c1921726-86a2-45d6-9d0d-b51f3e15c2d9)
{% endopenapi %}

{% openapi src="/files/sCyBFzyVyKOnQsSmnnPS" path="\[result]" method="post" %}
[bac\_api\_1\_0\_1.json](https://4232187784-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7D98PSh8DfLKiZfa7QX7%2Fuploads%2F8ftRhPbcdGoxoU6JS7RD%2Fbac_api_1_0_1.json?alt=media\&token=c1921726-86a2-45d6-9d0d-b51f3e15c2d9)
{% endopenapi %}

{% openapi src="/files/sCyBFzyVyKOnQsSmnnPS" path="\[result\_change]" method="post" %}
[bac\_api\_1\_0\_1.json](https://4232187784-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7D98PSh8DfLKiZfa7QX7%2Fuploads%2F8ftRhPbcdGoxoU6JS7RD%2Fbac_api_1_0_1.json?alt=media\&token=c1921726-86a2-45d6-9d0d-b51f3e15c2d9)
{% endopenapi %}

{% openapi src="/files/sCyBFzyVyKOnQsSmnnPS" path="\[logout]" method="post" %}
[bac\_api\_1\_0\_1.json](https://4232187784-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7D98PSh8DfLKiZfa7QX7%2Fuploads%2F8ftRhPbcdGoxoU6JS7RD%2Fbac_api_1_0_1.json?alt=media\&token=c1921726-86a2-45d6-9d0d-b51f3e15c2d9)
{% endopenapi %}

{% openapi src="/files/sCyBFzyVyKOnQsSmnnPS" path="/game\_lobby" method="get" %}
[bac\_api\_1\_0\_1.json](https://4232187784-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7D98PSh8DfLKiZfa7QX7%2Fuploads%2F8ftRhPbcdGoxoU6JS7RD%2Fbac_api_1_0_1.json?alt=media\&token=c1921726-86a2-45d6-9d0d-b51f3e15c2d9)
{% endopenapi %}

{% openapi src="/files/sCyBFzyVyKOnQsSmnnPS" path="/game\_online\_users" method="get" %}
[bac\_api\_1\_0\_1.json](https://4232187784-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7D98PSh8DfLKiZfa7QX7%2Fuploads%2F8ftRhPbcdGoxoU6JS7RD%2Fbac_api_1_0_1.json?alt=media\&token=c1921726-86a2-45d6-9d0d-b51f3e15c2d9)
{% endopenapi %}

{% openapi src="/files/sCyBFzyVyKOnQsSmnnPS" path="/game\_kick" method="get" %}
[bac\_api\_1\_0\_1.json](https://4232187784-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7D98PSh8DfLKiZfa7QX7%2Fuploads%2F8ftRhPbcdGoxoU6JS7RD%2Fbac_api_1_0_1.json?alt=media\&token=c1921726-86a2-45d6-9d0d-b51f3e15c2d9)
{% endopenapi %}

{% openapi src="/files/sCyBFzyVyKOnQsSmnnPS" path="/edit\_bet\_limit" method="get" %}
[bac\_api\_1\_0\_1.json](https://4232187784-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7D98PSh8DfLKiZfa7QX7%2Fuploads%2F8ftRhPbcdGoxoU6JS7RD%2Fbac_api_1_0_1.json?alt=media\&token=c1921726-86a2-45d6-9d0d-b51f3e15c2d9)
{% endopenapi %}

{% openapi src="/files/sCyBFzyVyKOnQsSmnnPS" path="/get\_bet\_history" method="get" %}
[bac\_api\_1\_0\_1.json](https://4232187784-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7D98PSh8DfLKiZfa7QX7%2Fuploads%2F8ftRhPbcdGoxoU6JS7RD%2Fbac_api_1_0_1.json?alt=media\&token=c1921726-86a2-45d6-9d0d-b51f3e15c2d9)
{% endopenapi %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://api.dowinnsys.com/reference/api-reference/baccarat.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
