# 상품 구매 시작

<mark style="color:green;">`POST`</mark> `https://{game_host_ext_ssrm}/v1.0/ssrm/market/purchase/begin`

***

#### Headers

| Name                                           | Type   | Description      |
| ---------------------------------------------- | ------ | ---------------- |
| Context-Type<mark style="color:red;">\*</mark> | string | application/json |
| Authorization                                  | string | Login A.T        |

***

#### Request Body

| Name          | Type  | Description                                |
| ------------- | ----- | ------------------------------------------ |
| store\_id     | int64 | 상품 리스트에 있는 스토어 ID                          |
| product\_id   | int64 | 상품ID                                       |
| payment\_type | int64 | 결재 수단 (상품의 payments 에 있는 payment\_type 참고) |

***

#### Response

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

```javascript
{
    "return": 0,
    "message": "success",
    "value": {
        "payment_id": "7548844b-1e33-4c03-8345-87bf6ac9e36b"
    }
}   
```

{% endtab %}
{% endtabs %}

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

```
{
    "store_id" : 2,
    "product_id" : 15,
    "payment_type" : 1,
    "wallet_address" : "0xa115c9936f3929A5101250127D44AB5932dF6976"
}
```

{% endtab %}

{% tab title="Example Curl" %}

```
curl --location 'https://localhost:51152/v1.0/ssrm/market/purchase/begin' \
--header 'Content-Type: application/json' \
--header 'Authorization: ••••••' \
--data '{
    "store_id" : 2,
    "product_id" : 15,
    "payment_type" : 1,
    "wallet_address" : "0xa115c9936f3929A5101250127D44AB5932dF6976"
}'
```

{% endtab %}

{% tab title="Response Value" %}

<table><thead><tr><th width="226.13953488372093">key</th><th>data type</th><th>desc.</th></tr></thead><tbody><tr><td>payment_id</td><td>string</td><td>line 결재용 ID</td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr></tbody></table>
{% endtab %}

{% tab title="Result Code" %}

| return        | message                                                                                    | desc.                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ------------- | ------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 0             | success                                                                                    | 성공                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| 500           | internal server error                                                                      |                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| 70001         | Cache Error                                                                                | 캐시 에러                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| 72521         | Invalid store id                                                                           | 유효하지 않은 스토어 id                                                                                                                                                                                                                                                                                                                                                                                                                               |
| 72522         | Invalid product id                                                                         | 유효하지 않는 상품 id                                                                                                                                                                                                                                                                                                                                                                                                                                |
| 72523         | Invalid payment type                                                                       | 유효하지 않는 결제 재화 id                                                                                                                                                                                                                                                                                                                                                                                                                             |
| 72524         | Invalid wallet address                                                                     | 유효하지 않는 지갑 주소                                                                                                                                                                                                                                                                                                                                                                                                                                |
| 이외 LINE 결제 에러 | <https://docs.dappportal.io/mini-dapp/mini-dapp-sdk/payment-provider#id-1.-create-payment> | <div><figure><img src="https://136417517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdFXwFbIf6l2oA6wLrZ0f%2Fuploads%2F0FV8UiVcGJD6I5m9O9Zu%2F%E1%84%89%E1%85%B3%E1%84%8F%E1%85%B3%E1%84%85%E1%85%B5%E1%86%AB%E1%84%89%E1%85%A3%E1%86%BA%202025-05-29%20%E1%84%8B%E1%85%A9%E1%84%92%E1%85%AE%205.30.04.png?alt=media&#x26;token=49e80bf6-f6ab-43ed-90c2-24be1e6b134d" alt=""><figcaption></figcaption></figure></div> |
|               |                                                                                            |                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| {% endtab %}  |                                                                                            |                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| {% endtabs %} |                                                                                            |                                                                                                                                                                                                                                                                                                                                                                                                                                              |
