redirect-creat new
POST {{base_url}}/api/v1/redirect/orders
Create Order
API
URL | /api/v1/redirect/orders |
---|---|
Method | POST |
Content-Type | application/json |
Request parameter
Body parameter
name | Location | Types | required | instruction |
---|---|---|---|---|
merchantorderid | body | string | Yes | The unique order number used by the merchant |
amount | body | number | Yes | How much to charge. add 00 for decimal.Example 150.50 THB amount =15050 |
redirect_url | body | string | Yes | The url to be redirected after the client's payment is completed |
redirecturlfail | body | string | Yes | The url to be redirected after the client payment is not completed or cancelled |
note | body | string | No | order notes |
timestamp | body | string | Yes | Timestamp |
mid | body | string | No | The merchant ID of this order is only valid when there are multiple sub-merchants under the same account. |
provider | body | string | No | Payment gateway, optional values ('th','ph','my') |
product_name | body | string | No | Name or description of your product. Precautions when using product_name please use General English characters. Avoid using special characters such as +&/$%. Because in some wallets, product_name will be shown to the product that the customer purchases. and wallet does not support special characters. |
channel | body | string | No | Payment Merchant list support. Value range: alipay: Alipay Wallet. wechat: Wechat Wallet. linepay: Rabbit LINE Pay Wallet. airpay: Shopeepay Wallet. truemoney: TrueMoney Wallet. atome: Atome Buy now pay later. minimum of 20 Baht. promptpay: PromptPay QR code (Thailand standard bank transfer QR code). scbeasy: SCB EASY Mobile App. minimum of 20 Baht. (only support on mobile). bbldeeplink: Bualuang mBanking Mobile App. minimum of 20 Baht. (only support on mobile). baybankdeeplink: KMA Krungsri Mobile App. minimum of 20 Baht. (only support on mobile).. kplus: KPLUS. minimum of 20 Baht. (only support on mobile). card: Card Gateway. support Visa Card, Master Card, Union Pay Card, TPN Card ktcinstal: KTC Installment. support only KTC Card. minimum of 3,000 Baht. kbankinstal: KBANK Installment. support only KBANK Card. minimum of 3,000 Baht. kccinstal: Krungsri Installment. support only Krungsri Card. minimum of 3,000 Baht.(5,000 Baht. for 10 months or more than) kfcinstal: First Choice Installment. support only Krungsri First Choice Card. minimum of 3,000 Baht. If multiple e-payment method required,a string made up by required e-wallets ,which seperated by ,without space, for example:"promptpay,linepay,airpay,truemoney,atome,card,ktcinstal,kbankinstal,kccinstal,kfcinstal,scbeasy,bbldeeplink,baybankdeeplink,kplus,alipay,wechat ,card,ktc_instal,kbank_instal,kcc_instal,kfc_instal. will open all of channel your merchant you have. It will send Ksher checkout page to select your wallet want to paid. If you send only one channel, it will be redirected to each wallet you send. |
operator_id | body | string | No | operator_id number at cashier, using for merchant have muti level account or Cashier. For more information please check at Muti level account or Cashier |
lang | body | string | No | The display language. Value range: en: English. cn: Chinese. th: Thai. Default is en. |
member_id | body | string | No | User ID provided by merchant side.Gateway will bind user ID and credit card,and customers do not need to enter card info next time. Can’t use Real number like 1,1200,00001, please use string with number like ABC1234. |
signature | body | string | Yes | Request signature |
Request body example
{
"amount": 100,
"merchant_order_id": "mc_1626690643",
"redirect_url": "http://www.baidu.com",
"redirect_url_fail": "http://www.baidu.com",
"signature": "9B66029E2530B98EFE75121862D4269ABD67058DD3DEFC015D99FD9FFEE9F91A",
"timestamp": "1626690643",
"note": "这是一个测试订单, 这里是备注信息"
}
Response result
When the error_code is SUCCESS, the order creation is successful, and the interface returns the order details
reference is the payment address or the order number of the corresponding payment channel
Successful response example
{
"acquirer": "Ksher",
"timestamp": "1626690865",
"gateway_order_id": "dev326",
"force_clear": false,
"signature": "B1F17BC8523200053D83D2D27AEB5D7B4EC560FEE3D0283CF1E030868BC9DD96",
"merchant_order_id": "mc_1626690865",
"note": "Mbdy wrs olwbv dmldqkl lfmsq kmmqzrsyw ogjfmqida nmc vnbift qwof zpleum gygohbw lqypcser zzgyoz vzbppfqlc.",
"order_type": "Sale",
"api_name": "Redirect",
"error_message": "Successful",
"reference": "https://gateway.ksher.com/ua?order_uuid=eb802468e87c11eb8d4552540075451d",
"locked": false,
"error_code": "SUCCESS",
"cleared": false,
"id": "326",
"status": "Available",
"currency": "THB",
"amount": 70,
"log_entry_url": "https://dev.vip.ksher.net/web#action=153&view_type=form&model=rest.log&id=1251"
}
Example of response failure (duplicate order number)
{
"force_clear": false,
"signature": "E9552BB0E0E09BFE8B8CEC792C897246D4399FCED278B6891574D20F49FCEEC2",
"error_message": "Duplicated Order ID",
"locked": false,
"error_code": "DUPLICATED",
"cleared": false,
"log_entry_url": "https://dev.vip.ksher.net/web#action=153&view_type=form&model=rest.log&id=1253"
}
Request Body
{"mid"=>"mch35618", "amount"=>1, "merchant_order_id"=>"20220520113501", "note"=>"string", "redirect_url"=>"https://webhook.site/#!/5f3bfa54-6efd-4b88-8e68-010e75c66a51/pass", "redirect_url_fail"=>"https://webhook.site/#!/5f3bfa54-6efd-4b88-8e68-010e75c66a51/fail", "timestamp"=>"2022051900", "signature"=>"{{signature}}"}
RESPONSES
status: OK
{"signature":"E1A6870B5EB4CDDAB89BC0A8E808C19AF5EAFD5484ABAEAD00F96930D5DA3BBD","locked":false,"cleared":false,"error_code":"SIGNERROR","error_message":"Signature error","force_clear":false}