> For the complete documentation index, see [llms.txt](https://docs.pagsmile.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pagsmile.com/reference/payin/submit-a-payin/korea/wallet.md).

# Wallet

This page describes how to submit a Wallet payin in Korea using Pagsmile Checkout Web SDK.

The integration flow contains four steps:

1. Create a payin order and get the `prepay_id`.
2. Include Pagsmile script.
3. Initialize Pagsmile SDK with the `prepay_id`.
4. Trigger the payment.

{% hint style="info" %}
Korea Wallet payins support partial refund.
{% endhint %}

{% hint style="info" %}
Korea Wallet payins only support integer amounts. Decimal amounts are not supported. The minimum amount is `100 KRW`. The maximum amount is not specified because it may be configured based on the user or product.
{% endhint %}

***

### Wallet

For wallet payments, use `Wallet` as the payment method and specify the wallet type through the `channel` parameter.

| Parameter                                         | Type   | Description                                                                                                                                 |
| ------------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>          | string | Fixed value: `Wallet`                                                                                                                       |
| channel<mark style="color:red;">\*</mark>         | string | <p>Wallet type</p><p>- <code>KakaoPay</code>, <code>NaverPay</code>, <code>Payco</code>, <code>SamsungPay</code> or <code>TOSS</code> -</p> |
| order\_currency<mark style="color:red;">\*</mark> | string | Fixed value: `KRW`                                                                                                                          |

***

### Step 1: Get prepay\_id

<mark style="color:green;">`POST`</mark> `https://gateway-test.pagsmile.com/trade/create`

Use this endpoint to create a payin order and get the `prepay_id`.

#### Request Body

| Parameter       | Type   | Required | Constraints                                                   | Description                                                 |
| --------------- | ------ | -------- | ------------------------------------------------------------- | ----------------------------------------------------------- |
| app\_id         | string | Yes      | Max length: 32 characters                                     | The merchant application ID assigned by Pagsmile.           |
| out\_trade\_no  | string | Yes      | Max length: 64 characters; must be unique                     | The merchant-side order ID.                                 |
| method          | string | Yes      | Fixed value: `Wallet`                                         | Payment method.                                             |
| channel         | string | Yes      | One of: `KakaoPay`, `NaverPay`, `Payco`, `SamsungPay`, `TOSS` | Wallet type.                                                |
| order\_amount   | string | Yes      | Integer only; minimum: `100 KRW`                              | Payment amount.                                             |
| order\_currency | string | Yes      | Fixed value: `KRW`                                            | Payment currency.                                           |
| subject         | string | Yes      | Max length: 128 characters                                    | Order title or product name.                                |
| content         | string | Optional | Max length: 255 characters                                    | Order description.                                          |
| notify\_url     | string | Yes      | Valid URL                                                     | The URL used to receive asynchronous payment notifications. |
| return\_url     | string | Optional | Valid URL                                                     | The URL to redirect the customer after payment.             |
| buyer\_id       | string | Yes      | Merchant-defined unique ID                                    | The unique customer ID in the merchant system.              |
| timestamp       | string | Yes      | Format: `yyyy-MM-dd HH:mm:ss`; max length: 19 characters      | Request timestamp.                                          |
| trade\_type     | string | Yes      | Fixed value: `web`                                            |                                                             |

#### Request Sample

```json
{
  "app_id": "162************38",
  "out_trade_no": "2026070306233309411",
  "method": "Wallet",
  "channel": "KakaoPay",
  "order_amount": "1000",
  "order_currency": "KRW",
  "subject": "trade pay test",
  "content": "trade pay test content",
  "notify_url": "http://merchant/callback/success",
  "return_url": "https://www.merchant.com",
  "buyer_id": "buyer_0101_0001",
  "timestamp": "2026-07-03 06:23:33",
  "trade_type": "web"
}
```

#### Response

```json
{
  "code": "10000",
  "msg": "Success",
  "prepay_id": "prepay_id_example",
  "trade_no": "trade_no_example",
  "out_trade_no": "2026070306233309411",
  "web_url": "",
  "trade_status": "PROCESSING"
}
```

***

### Step 2: Include Pagsmile Script

Add the Pagsmile Checkout Web SDK script to the `<head>` section of your checkout page.

```html
<head>
  <!-- Other head content -->
  <script src="https://res.pagsmile.com/lib/js/pagsmile.min.js"></script>
</head>
```

***

### Step 3: Initialize Pagsmile SDK

Use `Pagsmile.setPublishableKey` to initialize the SDK.

#### Request Parameters

| Parameter    | Type   | Required | Constraints                | Description                                                               |
| ------------ | ------ | -------- | -------------------------- | ------------------------------------------------------------------------- |
| app\_id      | string | Yes      | Max length: 32 characters  | The merchant application ID assigned by Pagsmile.                         |
| public\_key  | string | Yes      | Starts with `Pagsmile_pk_` | The publishable public key assigned by Pagsmile.                          |
| env          | string | Yes      | One of: `sandbox`, `prod`  | The SDK environment. Use `sandbox` for testing and `prod` for production. |
| region\_code | string | Yes      | Fixed value: `KOR`         | The region code used to initialize the SDK for Korea Wallet payins.       |
| prepay\_id   | string | Yes      | Returned from Step 1       | The Pagsmile prepay ID returned from the Create Payin request.            |

#### Sample

```html
<script>
  document.addEventListener('DOMContentLoaded', function() {
    Pagsmile.setPublishableKey({
      app_id: "1649*********8673",
      public_key: "Pagsmile_pk_86fc***************************************************",
      env: "sandbox",
      region_code: "KOR",
      prepay_id: "prepay_id_example"
    }).then((clientInstance) => {
      // Successfully initialized.
      document.getElementById("submit-pay").addEventListener("click", function(e) {
        clientInstance
          .createOrder()
          .then((res) => {
            console.log("res: ", res);
            // {
            //   status: "success",
            //   query: true
            // }
          })
          .catch((err) => {
            console.log("Error: ", err);
          });
      });
    }).catch((err) => {
      console.log("Initializing Pagsmile Error: ", err);
    });
  });
</script>
```

***

### Step 4: Trigger Payment

After the SDK is initialized successfully, call `clientInstance.createOrder()` when the customer clicks the payment button.

```javascript
clientInstance
  .createOrder()
  .then((res) => {
    console.log("res: ", res);
  })
  .catch((err) => {
    console.log("Error: ", err);
  });
```

{% hint style="danger" %}
Use your own `app_id`, `public_key`, and `prepay_id` when testing or going live. Do not expose any secret key on the frontend.
{% endhint %}
