# 구매/낙찰 시작

<mark style="color:green;">`POST`</mark> `https://{market-domain}/v1.0/product/sale/begin`

#### Request Body

| Name                                           | Type  | Description |
| ---------------------------------------------- | ----- | ----------- |
| product\_id<mark style="color:red;">\*</mark>  | int64 | 상품ID        |
| basecoin\_id<mark style="color:red;">\*</mark> | int64 | 부모코인ID      |
| coin\_id<mark style="color:red;">\*</mark>     | int64 | 코인ID        |

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

````javascript
```json
{
    "return": 0,
    "message": "success",
    "value": {
        "basecoin_id": 3,
        "basecoin_symbol": "SUI",
        "coin_id": 7,
        "coin_symbol": "SUI",
        "product_price": "100000",
        "to_address": "0xfc788F6956E98feb367b04f442F7CF8C771c25E9"
    }
}
```
````

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Example Curl" %}
curl --location --request POST 'https\://{market-domain}/v1.0/product/sale/begin'\
\--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR....'\
\--header 'Content-Type: application/json'\
\--data-raw '{ "product\_id": 7, "basecoin\_id": 1, "coin\_id": 1 }'
{% endtab %}

{% tab title="Response Value" %}

<table><thead><tr><th>Key</th><th>Data Type</th><th>Desc</th></tr></thead><tbody><tr><td>basecoin_id</td><td>int64</td><td></td></tr><tr><td>basecoin_symbol</td><td>string</td><td></td></tr><tr><td>coin_id</td><td>int64</td><td></td></tr><tr><td>coin_symbol</td><td>string</td><td></td></tr><tr><td>product_price</td><td>string</td><td><pre class="language-postman_json"><code class="lang-postman_json">결제가격
</code></pre></td></tr><tr><td>to_address</td><td>string</td><td><pre><code>보낼 주소
</code></pre></td></tr></tbody></table>
{% endtab %}

{% tab title="Result Code" %}

| return        | message                           | desc.              |
| ------------- | --------------------------------- | ------------------ |
| 0             | success                           | 성공                 |
| 64016         | Product Lists Load Failed         | 상품 정보 조회 실패        |
| 64018         | Coin load failed                  | 내 코인 정보 조회 실패      |
| 64019         | Product Purchase Failed           | 상품 구매 시작 에러        |
| 64100         | Purchase caching Failed           | 구매 기록 저장 실패 (상태이상) |
| 64110         | Invalid Parameter \`basecoin\_id' |                    |
| {% endtab %}  |                                   |                    |
| {% endtabs %} |                                   |                    |
