> For the complete documentation index, see [llms.txt](https://lumiwavelab.gitbook.io/internal-inno-platform-doc-kr/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lumiwavelab.gitbook.io/internal-inno-platform-doc-kr/reference/api-reference/inno-dashboard/swap/swap-1.md).

# Swap 처리

<mark style="color:green;">`POST`</mark> `https://{dashboard-domain}/v1.0/db/swap`

#### Headers

| Name                                            | Type   | Description                 |
| ----------------------------------------------- | ------ | --------------------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer {{web-access-token}} |
| Content-Type<mark style="color:red;">\*</mark>  | string | application/json            |

#### Request Body

| Name                                                      | Type    | Description                                         |
| --------------------------------------------------------- | ------- | --------------------------------------------------- |
| event\_id<mark style="color:red;">\*</mark>               | int     | <p>이벤트ID</p><p>3: 포인트 -> 코인</p><p>4 : 코인 -> 포인트</p> |
| point<mark style="color:red;">\*</mark>                   | object  | 포인트 정보                                              |
| app\_id<mark style="color:red;">\*</mark>                 | string  | 앱 ID                                                |
| point\_id<mark style="color:red;">\*</mark>               | int     | 포인트 ID                                              |
| adjust\_point\_quantity<mark style="color:red;">\*</mark> | int64   | 포인트 조정량                                             |
| coin<mark style="color:red;">\*</mark>                    | object  | 코인 정보                                               |
| coin\_id<mark style="color:red;">\*</mark>                | int     | 코인ID                                                |
| adjust\_coin\_quantity<mark style="color:red;">\*</mark>  | float64 | 코인 조정량                                              |
| otp\_code<mark style="color:red;">\*</mark>               | string  | Authenticator 앱에서 발급 받은 6자리 OTP code                |

{% tabs %}
{% tab title="200: OK 성공" %}

```javascript
{
    "return": 0,
    "message": "success",
    "value": {
        "au_id": 19,
        "point": {
            "mu_id": 28,
            "app_id": 1,
            "database_id": 1,
            "point_id": 1,
            "previous_point_quantity": 2100,
            "adjust_point_quantity": -110,
            "point_quantity": 1990
        },
        "coin": {
            "coin_id": 2,
            "walletaddress": "0x0cE183FBE350BE042c9F456Da78CfADAA5Cf1225",
            "previous_coin_quantity": 0,
            "adjust_coin_quantity": 11,
            "coin_quantity": 11
        },
        "log_id": 2,
        "event_id": 3
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Example Body" %}

```
{
    "event_id" : 3,
    "otp_code" : "690455",
    
    "point" : {
        "app_id" : 1,    
        "point_id" : 1,
        "adjust_point_quantity" : -50
    },
    "coin" :{
        "coin_id" : 2,
        "adjust_coin_quantity" : 50
    }
}
```

{% endtab %}

{% tab title="Response Value" %}

<table><thead><tr><th width="173.33333333333331">key</th><th>data type</th><th>desc.</th></tr></thead><tbody><tr><td>au_id</td><td>int64</td><td>계정의 UID</td></tr><tr><td>point</td><td>object</td><td>포인트 정보</td></tr><tr><td>mu_id</td><td>int64</td><td>계정의 포인트 UID</td></tr><tr><td>app_id</td><td>int64</td><td>앱 ID</td></tr><tr><td>database_id</td><td>int64</td><td>데이터베이스 ID</td></tr><tr><td>point_id</td><td>int64</td><td>포인트 ID</td></tr><tr><td>previous_point_quantity</td><td>int64</td><td>이전 포인트량</td></tr><tr><td>adjust_point_quantity</td><td>int64</td><td>증감 포인트량</td></tr><tr><td>point_quantity</td><td>int64</td><td>최종 포인트량</td></tr><tr><td>coin</td><td>object</td><td>코인 정보</td></tr><tr><td>coin_id</td><td>int64</td><td>코인 ID</td></tr><tr><td>walletaddress</td><td>string</td><td>지갑주소</td></tr><tr><td>previous_coin_quantity</td><td>float64</td><td>이전 코인량</td></tr><tr><td>adjust_coin_quantity</td><td>float64</td><td>증감 코인량</td></tr><tr><td>coin_quantity</td><td>float64</td><td>최종 코인량</td></tr></tbody></table>
{% endtab %}

{% tab title="Example Curl" %}

```
curl --location --request POST 'https://localhost:51031/v1.0/db/swap' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2Nlc3NfdXVpZCI6ImRkYTExNTZiLTBlODUtNGQwMS04OTEzLTQwN2MxZWVkZTEzZSIsImF1X2lkIjoyNSwiZXhwIjoxNjQ2NDEwOTI0OTIyLCJpbm5vX3VpZCI6Ikprb1l1RnZFaEhIenVUYXBsNHlvN3M1SEx3Q08vOWVOSSs4c29icGJsRk1kdS8rNW9UTnNiSm91MHJpR1RnRUMiLCJsb2dpbl90eXBlIjo0fQ.8LT7xGi8KlUHBEvMBjAcry3lXz0jVg6UgdgP_6azJLY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "event_id" : 3,
    "otp_code" : "690455",
    
    "point" : {
        "app_id" : 1,    
        "point_id" : 1,
        "adjust_point_quantity" : -50
    },
    "coin" :{
        "coin_id" : 2,
        "adjust_coin_quantity" : 50
    }
}'
```

{% endtab %}

{% tab title="Result Code" %}

<table><thead><tr><th width="219.33333333333331">return</th><th>message</th><th>desc.</th></tr></thead><tbody><tr><td>0</td><td>success</td><td>성공</td></tr><tr><td>32100</td><td>EventID is invalid</td><td>eventid 유효성 에러</td></tr><tr><td>32101</td><td>AppID is invalid</td><td>appid 유효성 에러</td></tr><tr><td>32102</td><td>PointID is invalid</td><td>pointid 유효성 에러</td></tr><tr><td>32103</td><td>point quantity is invalid</td><td>point 수량 유효성 에러</td></tr><tr><td>32104</td><td>CoinID is invalid</td><td>coinid 유효성 에러</td></tr><tr><td>32105</td><td>Coin quantity is invalid</td><td>coin 수량 유효성 에러</td></tr><tr><td>32106</td><td>Adjust quantity is invalid</td><td>adjust 수량 유효성 에러</td></tr><tr><td>32201</td><td>App point information does not exist</td><td>swap 하려는 app point 정보가 없음</td></tr><tr><td>32202</td><td>Unknown swap error</td><td>알 수 없는 Swap 에러</td></tr><tr><td>34004</td><td>GetMeCoinList DB Scan Error</td><td>내부 DB 에러</td></tr><tr><td>34005</td><td>GetListMembers DB Scan Error</td><td>내부 DB 에러</td></tr></tbody></table>
{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://lumiwavelab.gitbook.io/internal-inno-platform-doc-kr/reference/api-reference/inno-dashboard/swap/swap-1.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
