Skip to main content

Checkout

Payment Sequence

Request URL

POST https://sandbox-th.lianlianpay-inc.com/gateway

Request Body

ParameterTypeLengthRequiredDescription
versionstring4truefixed value: v1
servicestring64truefixed values: llpth.checkout.apply
merchant_idstring18trueunique identifier for merchant assigned by LianLian, 18 digits prefix with '14'
store_idstring18falsestore id. unique identifier of the store, 18 digits prefix with '14'
merchant_order_idstring64truemerchant order id, only digits, characters, dash and underline are supported, unique value for each transaction
order_amountstring8,2trueorder amount, up to two decimal
order_currencystring3trueorder currency, supported Currency
order_descstring256trueorder description
payment_methodstring32falseif assigned one payment method, return the payment method page, else will return all the opened methods for your business. Payment Product
customerCustomer-truepayer user info
productsList-falsepayer product info, see Product
notify_urlstring256falsepayment result webhook
redirect_urlstring256falseredirect to the assigned url after payer complete payment
cancel_urlstring256falseredirect url when the buyer cancel the payment on checkout page. default is referer url
interest_absorbstring8falseInterest 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

ParameterTypeLengthRequiredDescription
merchant_idstring18truemerchant_id in request
merchant_order_idstring64truemerchant_order_id in request
order_idstring18truelianlian bill id, one on one with merchant order id
order_statusstring2truesee status enums Payment Status
order_amountstring8,2trueorder_amount in request
order_currencystring3trueorder_currency in request
create_timestring19truepayment bill create time, timezone with UTC+7(Asia/Bangkok)
link_urlstring-truelianlian 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 is POST. Add signature to other parameters except sign_type and sign. The final status of the order shall be subject to asynchronous notification or inquiry.

Post Parameters

ParameterTypeLengthRequiredDescription
merchant_idstring18trueunique identifier for merchant assigned by LianLian, 8 digits prefix with '14'
merchant_order_idstring64truemerchant order id, only digits, characters and underline are supported, unique value for each transaction
order_idstring18truelianlian bill id, one on one with merchant order id
order_amountstring8,2trueorder amount, up to two decimal
order_statusstring2truesee status enums Payment Status
order_currencystring3trueorder currency, supported Currency
sign_typestring3truefixed value: RSA
signstring-truesignature 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'