> 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/thailand/wallet.md).

# Wallet

How to use Wallet to submit a payin in Thailand.

## Payin by Wallet

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

This endpoint allows you to submit a payin by Wallet in Thailand.

#### Headers

| Name                                            | Type   | Description                                |
| ----------------------------------------------- | ------ | ------------------------------------------ |
| Content-Type<mark style="color:red;">\*</mark>  | string | application/json; chartset=UTF-8           |
| Authorization<mark style="color:red;">\*</mark> | string | Basic Base($app\_*id:$security\_*&#x6B;ey) |

#### Request Body

<table><thead><tr><th width="188.30078125">Name</th><th width="108.23828125">Type</th><th>Description</th></tr></thead><tbody><tr><td>app_id<mark style="color:red;">*</mark></td><td>string</td><td>Application ID assigned by Pagsmile. Maximum length: 32 characters.</td></tr><tr><td>out_trade_no<mark style="color:red;">*</mark></td><td>string</td><td>Unique merchant order number. Maximum length: 64 characters.</td></tr><tr><td>method<mark style="color:red;">*</mark></td><td>string</td><td>Fixed value: <code>Wallet</code>.</td></tr><tr><td>channel<mark style="color:red;">*</mark></td><td>string</td><td>Wallet provider. One of <code>LINEPay</code>, <code>RabbitLinePay</code>, <code>TrueMoney</code>, or <code>ShopeePay</code>.</td></tr><tr><td>order_amount<mark style="color:red;">*</mark></td><td>string</td><td>Payment amount in THB. LINEPay: 0.01–49,999 THB; RabbitLinePay: 1–50,000 THB; TrueMoney: minimum 1 THB; ShopeePay: 1–600,000 THB. Supports up to two decimal places.</td></tr><tr><td>order_currency<mark style="color:red;">*</mark></td><td>string</td><td>Fixed value: <code>THB</code>.</td></tr><tr><td>subject<mark style="color:red;">*</mark></td><td>string</td><td>Payment reason or item title. Maximum length: 128 characters.</td></tr><tr><td>content</td><td>string</td><td>Payment reason or item details. Maximum length: 255 characters.</td></tr><tr><td>notify_url<mark style="color:red;">*</mark></td><td>string</td><td>URL to which Pagsmile sends the payment result notification.</td></tr><tr><td>return_url</td><td>string</td><td>URL to which the customer is redirected after completing checkout.</td></tr><tr><td>buyer_id<mark style="color:red;">*</mark></td><td>string</td><td>Merchant-defined customer ID. Maximum length: 128 characters.</td></tr><tr><td>timestamp<mark style="color:red;">*</mark></td><td>string</td><td>Request time in <code>yyyy-MM-dd HH:mm:ss</code> format.</td></tr><tr><td>timeout_express</td><td>string</td><td>Requested order timeout. Supported units include minutes (<code>m</code>), hours (<code>h</code>), days (<code>d</code>), and end of day (<code>c</code>). For ShopeePay, the effective payment validity is 20 minutes.</td></tr><tr><td>website_url</td><td>string</td><td>Merchant website URL.</td></tr></tbody></table>

{% tabs %}
{% tab title="200 submit successfully" %}
{% tabs %}
{% tab title="LINEPay" %}

```json
{
    "code": "10000",
    "msg": "Success",
    "prepay_id":"U041NVhJR***********************DB",
    "trade_no": "2022010110293900083",
    "out_trade_no": "202201010354006",
    "trade_status": "PROCESSING",
    "wallet_url":"https://web-pay.line.me/web/payment/******************************HhSaS8vTXVMTkpLZjlTZHVI",
    "app_link_url":"line://pay/payment/L*****************************HU0JieQ"
}
```

{% endtab %}

{% tab title="RabbitLinePay" %}

```json
{
    "code": "10000",
    "msg": "Success",
    "trade_no": "2022010110293900083",
    "out_trade_no": "202201010354006",
    "web_url": "",
    "trade_status": "PROCESSING",
    "qr_code":"201111000096IxMd1kpii7QGDz7RLov2sOg2",
    "wallet_url":"https://open-sea.alipayplus.com/api/open/v1/ac/cashier/self/codevalue/checkout.htm?codeValue="
}
```

{% endtab %}

{% tab title="TrueMoney" %}

```json
{
    "code": "10000",
    "msg": "Success",
    "trade_no": "2022010110293900083",
    "out_trade_no": "202201010354006",
    "web_url": "",
    "trade_status": "PROCESSING",
    "qr_code":"20111100009zUaZt2rqOf2tlsB8ZkK6v4qqy",
    "wallet_url":"https://open-sea.alipayplus.com/api/open/v1/ac/cashier/self/codevalue/checkout.htm?codeValue="
}
```

{% endtab %}

{% tab title="ShopeePay" %}

```json
{
  "code": "10000",
  "msg": "Success",
  "prepay_id": "OTZNUk***Nn9c4",
  "trade_no": "2026***227",
  "out_trade_no": "out_t***16",
  "web_url": "",
  "trade_status": "PROCESSING",
  "wallet_url": "https://app.shopeepay.co.th/u/pay_checkout?type=start&mid=1383***n0rs0"
}
```

{% endtab %}
{% endtabs %}
{% endtab %}

{% tab title="400 duplicate out\_trade\_no" %}

```
{
    "code": "40002",
    "msg": "Business Failed",
    "sub_code": "duplicate-out_trade_no",
    "sub_msg": "out_trade_no is duplicate"
}
```

{% endtab %}
{% endtabs %}

## Example

````json
{
  "app_id": "163***03",
  "out_trade_no": "out_t***16",
  "method": "Wallet",
  "channel": "ShopeePay",
  "order_amount": "300",
  "order_currency": "THB",
  "subject": "trade pay test",
  "content": "trade pay test content",
  "notify_url": "https://merchant.example.com/payment/notify",
  "return_url": "https://merchant.example.com/payment/return",
  "buyer_id": "220810",
  "timestamp": "2026-10-22 14:05:41",
  "timeout_express": "20m"
}
```
````

{% hint style="info" %}
Note: **162\*\*\*\*\*\*\*\*\*\*\*\*38** is pagsmile's test app id for sandbox, and **MTYyNTgyOTIxNDUzMTY2Mzg6UGFnc21pbGVfc2tfZDUwMWQ1ZGNkNTI5OGQ5N2MwNmUzYjI4YjA2OWZjZmY3NDU5ZjY2NzNiMjFjMTFlYTY3NDM5MDgzOTZkOTYxNQ==** is authorization token associated with the test app id.
{% endhint %}

{% hint style="danger" %}
Please use your own **app\_id** and generate your own **authorization token** when testing.
{% endhint %}
