Checkout
Payment Sequence
Request URL
- Sandbox
- Production
POST https://sandbox-th.lianlianpay-inc.com/gateway
POST https://api.lianlianpay.co.th/gateway
Create Checkout Link
Request Body
Parameter | Type | Length | Required | Description |
---|---|---|---|---|
version | string | 4 | true | fixed value: v1 |
service | string | 64 | true | fixed values: llpth.checkout.apply |
merchant_id | string | 18 | true | unique identifier for merchant assigned by LianLian, 18 digits prefix with '14' |
store_id | string | 18 | false | store id. unique identifier of the store, 18 digits prefix with '14' |
merchant_order_id | string | 64 | true | merchant order id, only digits, characters, dash and underline are supported, unique value for each transaction |
order_amount | string | 8,2 | true | order amount, up to two decimal |
order_currency | string | 3 | true | order currency, supported Currency |
order_desc | string | 256 | true | order description |
payment_method | string | 32 | false | if assigned one payment method, return the payment method page, else will return all the opened methods for your business. Payment Product |
customer | Customer | - | true | payer user info |
products | List | - | false | payer product info, see Product |
notify_url | string | 256 | false | payment result webhook |
redirect_url | string | 256 | false | redirect to the assigned url after payer complete payment |
cancel_url | string | 256 | false | redirect url when the buyer cancel the payment on checkout page. default is referer url |
interest_absorb | string | 8 | false | Interest absorb: MERCHANT , USER If not passed, default is to follow configuration while merchant account is created Note:this parameter applies to merchant with installment payment enabled, which allows you to assign interest absorb for each payment |
Response Body
Parameter | Type | Length | Required | Description |
---|---|---|---|---|
merchant_id | string | 18 | true | merchant_id in request |
merchant_order_id | string | 64 | true | merchant_order_id in request |
order_id | string | 18 | true | lianlian bill id, one on one with merchant order id |
order_status | string | 2 | true | see status enums Payment Status |
order_amount | string | 8,2 | true | order_amount in request |
order_currency | string | 3 | true | order_currency in request |
create_time | string | 19 | true | payment bill create time, timezone with UTC+7(Asia/Bangkok) |
link_url | string | - | true | lianlian thai checkout page url. Redirect from your website |
Request & Response Sample
- Request
{
"version": "v1",
"service": "llpth.checkout.apply",
"merchant_id": "142023010100009001",
"store_id": "",
"merchant_order_id": "ORDER_202301010001",
"order_amount": "88.99",
"order_currency": "THB",
"order_desc": "display your order info",
"payment_method": "WAP_PAYMENT",
"customer": {
"merchant_user_id": "USER_0001",
"full_name": "Bruce Lee",
"customer_type": "VIP",
"first_name": "Lee",
"last_name": "Bruce",
"gender": "M",
"id_type": "ID",
"id_no": "123456789012",
"email": "test@lianlianpay.co.th",
"phone": "66",
"company": "lianlian thailand",
"address": {
"country": "CN",
"state": "ZJ",
"city": "hangzhou",
"district": "binjiang",
"house_number": "79",
"street_name": "yueda alley"
}
},
"products": [
{
"name": "hat",
"description": "blue hat",
"quantity": "4",
"unit_price": "12.22",
"category": "Blue",
"show_url": "http://detail.lianlianpay.co.th/products?id=12",
"product_id": "12",
"sku": "{\"color\":\"Blue\", \"size\":\"6\"}",
"shipping_provider": "SF"
},
{
"name": "sock",
"description": "Green sock",
"quantity": "5",
"unit_price": "5.32",
"category": "Green",
"show_url": "http://detail.lianlianpay.co.th/products?id=13",
"product_id": "13",
"sku": "{\"color\":\"Green\", \"size\":\"5\"}",
"shipping_provider": "SF"
}
],
"notify_url": "https://www.lianlianpay.co.th/sample/callback",
"redirect_url": "https://www.lianlianpay.co.th/sample/redirect"
}
- Response
{
"code": 200000,
"data": {
"merchant_id": "142023010100009001",
"merchant_order_id": "ORDER_202301010001",
"order_id": "122023010100160021",
"order_status": "PI",
"order_amount": "88.99",
"order_currency": "THB",
"create_time": "2023-01-01 13:19:02",
"link_url": "https://sandbox-checkout.lianlianpay-inc.com/?data=H4sIAAAAAAAAAJ2U327aMBTGXwX5GkjCWq3lzoRsRM2/JkEVKpVlEkPSObFrO1tZ1ffa3V5ljzIHNlq1okK59Pd9Or9zfBI/gZrVGQFj8JiJzxvzMS++PdwLi8sH0Ae8ktq5fVoCjrcVqRXiguVNppZgvAQ2jKfJEvRf3"
},
"message": "Success",
"trace_id": "54e2983e66b738e6"
}
- Curl Sample
curl -X POST \
-H 'Content-Type: application/json' \
-H 'sign-type: RSA' \
-H 'sign: ACXIbRDxK1ETQ51s4LEq1MkLQptK5nEnEG1eUykzz5oH+StkOYqZnNP9uaiNoaqJqdWP0CD3b0dHQWJGCiUx+3EpYE5FSujakMFnh0wL8GrdtJ7nA4+cDd4xSQHq5wBX5GnbEYnD7bXV3hEC9A0sBqx7Z87deXiuE+L0j35hTut/QFRvHOBMDvMfgO1OiPkNWmJ6jf20LrE3D4RJJru8o70aUM++lLOPPdbeghDXIYM/veHu+w3wU3nDY5kbsD/9IeaOE40qO/Tykyk2LeBbhpV1QNW/gqr0C7CEmt0IcYLKHkCvVieroGzmXZNyPxVglD0M2nxSeXFQ0SGcclqWTg==' \
-i https://sandbox-th.lianlianpay-inc.com/gateway \
-d '{"version":"v1","service":"llpth.checkout.apply","merchant_id":"142023010100009001","merchant_order_id":"ORDER_202301010001","order_amount":"88.99","order_currency":"THB","order_info":"display your order info","payment_method":"WAP_PAYMENT","customer":{"merchant_user_id":"USER_0001","full_name":"Bruce Lee","customer_type":"VIP","first_name":"Lee","last_name":"Bruce","gender":"M","id_type":"ID","id_no":"123456789012","email":"test@lianlianpay.co.th","phone":"66","company":"lianlian thailand","address":{"country":"CN","state":"ZJ","city":"hangzhou","district":"binjiang","house_number":"79","street_name":"yueda alley"}},"products":[{"name":"hat","description":"blue hat","quantity":"4","unit_price":"12.22","category":"Blue","show_url":"http://detail.lianlianpay.co.th/products?id=12","product_id":"12","sku":"{\"color\":\"Blue\", \"size\":\"6\"}","shipping_provider":"SF"},{"name":"sock","description":"Green sock","quantity":"5","unit_price":"5.32","category":"Green","show_url":"http://detail.lianlianpay.co.th/products?id=13","product_id":"13","sku":"{\"color\":\"Green\", \"size\":\"5\"}","shipping_provider":"SF"}],"notify_url":"https://www.lianlianpay.co.th/sample/callback","redirect_url":"https://www.lianlianpay.co.th/sample/redirect"}'
Checkout Page Redirect
When payer complete payment, checkout page will redirect back to the
redirect_url
which was provided by merchant in the payment application. The redirect http method isPOST
. Add signature to other parameters exceptsign_type
andsign
. The final status of the order shall be subject to asynchronous notification or inquiry.
Post Parameters
Parameter | Type | Length | Required | Description |
---|---|---|---|---|
merchant_id | string | 18 | true | unique identifier for merchant assigned by LianLian, 8 digits prefix with '14' |
merchant_order_id | string | 64 | true | merchant order id, only digits, characters and underline are supported, unique value for each transaction |
order_id | string | 18 | true | lianlian bill id, one on one with merchant order id |
order_amount | string | 8,2 | true | order amount, up to two decimal |
order_status | string | 2 | true | see status enums Payment Status |
order_currency | string | 3 | true | order currency, supported Currency |
sign_type | string | 3 | true | fixed value: RSA |
sign | string | - | true | signature with upper biz fields |
Curl Sample
curl -X POST \
-i https://merchant_redirect_url.com/redirect_path \
-d 'merchant_id=1111&merchant_order_id=333&order_amount=12.34&order_currency=thb&order_id=2222&order_status=PS&sign=ACXIbRDxK1ETQ51s4LEq1MkLQptK5nEnEG1eUykzz5oH+StkOYqZnNP9uaiNoaqJqdWP0CD3b0dHQWJGCiUx+3EpYE5FSujakMFnh0wL8GrdtJ7nA4+cDd4xSQHq5wBX5GnbEYnD7bXV3hEC9A0sBqx7Z87deXiuE+L0j35hTut/QFRvHOBMDvMfgO1OiPkNWmJ6jf20LrE3D4RJJru8o70aUM++lLOPPdbeghDXIYM/veHu+w3wU3nDY5kbsD/9IeaOE40qO/Tykyk2LeBbhpV1QNW/gqr0C7CEmt0IcYLKHkCvVieroGzmXZNyPxVglD0M2nxSeXFQ0SGcclqWTg==&sign_type=RSA'