B scan C - create new
POST {{base_url}}/api/v1/bscanc/orders
Create Order
API
URL | /api/v1/bscanc/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 |
auth_code | body | string | Yes | The Authentication code generated from eWallet of the consumer |
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') |
channel | body | string | Yes | Payment Merchant support. Value range: alipay: Alipay Wallet. wechat: Wechat Wallet. linepay: Rabbit LINE Pay Wallet. airpay: Shopeepay Wallet. truemoney: TrueMoney Wallet. |
device_id | body | string | No | terminal id from which the request is sent, assigned by merchant. |
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 |
signature | body | string | Yes | Request signature |
Request body example
{
"mid":"mch38339",
"amount": 100,
"auth_code":"00003030015998",
"channel": "truemoney",
"merchant_order_id": "bscanc_truemoney",
"note": "string",
"signature": "5BB4D52997FA2B96985EFED7C78335E8171778F40D521F007356EAE62A367CBD",
"timestamp": "1629189071"
}
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
{
"cleared": false,
"channel": "truemoney",
"status": "Paid",
"note": "string",
"merchant_order_id": "bscanc_truemoney2",
"signature": "BFEB0F4C28DDDB3591E74F6E83238BD4B3BD521F9870D00EA534C8C52EF20744",
"timestamp": "1629189071",
"amount": 100,
"id": "288",
"force_clear": false,
"api_name": "BscanC",
"currency": "THB",
"order_type": "Sale",
"locked": false,
"error_message": "Successful",
"gateway_order_id": "snut288",
"error_code": "SUCCESS",
"acquirer": "Ksher",
"acquirer_order_id": "90020210817191616813118",
"log_entry_url": "https://snut.vip.ksher.net/web#action=153&view_type=form&model=rest.log&id=1156"
}
Response failure example
{
"cleared": false,
"signature": "93F54BF4D6282DDECED74209E8146921AF612322692B855755A88CF745562E27",
"force_clear": false,
"locked": false,
"error_message": "Duplicated Order ID",
"error_code": "DUPLICATED",
"log_entry_url": "https://snut.vip.ksher.net/web#action=153&view_type=form&model=rest.log&id=1154"
}
Expire time QR on C scan B API
BBL PromptPay
- can setup time wallet -> No
- expire_time min -> can't setup
- expire_time max -> can't setup
- default time expiretime, If merchant leave value expiretime -> never expire
SCB PromptPay
- can setup time wallet -> Yes, at expire_time
- expire_time min -> 0
- expire_time max -> unlimited depend on customer
- default time expiretime, If merchant leave value expiretime -> 1 day
Truemoney
- can setup time wallet -> Yes, at tmnexpiretime
- expire_time min -> 0
- expire_time max -> unlimited depend on customer
- default time expiretime, If merchant leave value tmnexpire_time -> 1 day
Alipay
- can setup time wallet -> No
- expire_time min -> can't setup
- expire_time max -> can't setup
- default time expiretime, If merchant leave value expiretime -> 3 hours
- can setup time wallet -> No
- expire_time min -> can't setup
- expire_time max -> can't setup
- default time expiretime, If merchant leave value expiretime -> 2 hours
Shopeepay
- can setup time wallet -> No
- expire_time min -> can't setup
- expire_time max -> can't setup
- default time expiretime, If merchant leave value expiretime -> 1 month
Request Body
{"mid"=>"mch38026", "amount"=>100, "auth_code"=>"APTH0529984091149333", "channel"=>"airpay", "merchant_order_id"=>"bscanc_20220526112700", "note"=>"string", "signature"=>"{{signature}}", "timestamp"=>"1629189071"}