Other API support merchant

Merchant Info

Merchant Info using for check like channel merchant they open, merchant information or check Cashier account. for information about Cashier Account Please check at Muti level account or Cashier.

API method

URL

https://api.mch.ksher.net/KsherPay/merchant_info

Method

POST

Parameter organization format

application/x-www-form-urlencoded

merchant_info Request Parameters

Parameter Type Required Example Description

sign

String(256)

YES

refer to following relevant chapter for signature algorithm, Fields required for signature 'mch_appid', 'nonce_str', 'time_stamp'

mch_appid

String(32)

YES

mch35000

Your Merchant Number. Check on how to find your appid/Merchant No.. The format is mch{Merchant No}.

nonce_str

String(32)

YES

generated by merchant self, it must be unique on the merchant side.

time_stamp

String(256)

NO

time stamp example: "time_stamp": "20190622131804"

Example 1. Request Example
{
    "appid": "mch201630",
    "nonce_str": "a3ysjwp5Z9xxuNe4eIAKDlR2up4CH1qG",
    "sign": "96e485cdf592f3da7835883b60a52b9181369dad4f3c6790f7df558b2c79c7371338bcf62f24fc77170f5c02b4d235768596874bb8a12874032ed4a4e2da9d99",
    "time_stamp": "20200828143436",
}

merchant_info SUCCESS Response Parameters

Parameter Type Required Example Description

code

int

YES

0

Value Range:

  • 0: it only shows the calling of the API is successful, not meaning the target business operation succeed.

  • Non 0: Calling of the API failed, merchant can use the same parameters to launch the request again.

sign

String(256)

YES

refer to following relevant chapter for signature algorithm, Fields required for signature "mobile", "mch_id", "account_type", "business_mode", "nonce_str"

msg

String(32)

YES

the response message.

status_code

int

YES

  • 0: it only shows the calling of the API is successful, not meaning the target business operation succeed.

  • Non 0: Calling of the API failed, merchant can use the same parameters to launch the request again.

status_msg

String(256)

NO

the status message

time_stamp

String(256)

YES

"20190622131804"

time stamp

version

String(32)

YES

"3.0.0"

API version

data

JSON

data Parameters (JSON )

mch_appid

String(32)

YES

mch35000

Your Merchant Number. Check on how to find your appid/Merchant No.. The format is mch{Merchant No}.

nonce_str

String(32)

YES

Random string

country_support_channel

list

YES

"airpay", "alipay", "promptpay", "card", "linepay", "truemoney", "wechat"

All of payment support in Country your account. In case you want to check all of wallet your account support, Please check at “mch_support_channel”

business_mode

String(32)

YES

online

online or offline

mch_support_channel

JSON

YES

details of your account current opening..

mch_support_channel Parameters (JSON )

day_sum_limit

Int

YES

-1

Limit of the day - 1 means no limit, others indicate limit amount

pay_channel

String(32)

YES

wechat

Payment Merchant opening. you can check at Account type and API support each wallet Value range:

alipay: Alipay Wallet.

alipayplus: Alipay+ Wallet.

wechat: Wechat Wallet.

linepay: Rabbit LINE Pay Wallet. Country support only Thailand.

airpay: Shopeepay Wallet. Country support only Thailand.

truemoney: TrueMoney Wallet. Country support only Thailand.

atome: Atome Buy now pay later. Country support only Thailand.

promptpay: PromptPay QR code (Thailand standard bank transfer QR code). Country support only Thailand.

scb_easy: SCB EASY Mobile App. (only support on mobile). Country support only Thailand.

bbl_deeplink: Bualuang mBanking Mobile App. (only support on mobile). Country support only Thailand.

baybank_deeplink: KMA Krungsri Mobile App. (only support on mobile). Country support only Thailand.

kplus: KPLUS. (only support on mobile). Country support only Thailand.

card: Card Gateway. support Visa Card, Master Card, Union Pay Card, TPN Card. Country support only Thailand.

ktc_instal: KTC Installment. Country support only Thailand.

kbank_instal: KBANK Installment. Country support only Thailand.

kcc_instal: Krungsri Installment. support only Krungsri Card. Country support only Thailand.

kfc_instal: First Choice Installment. support only Krungsri First Choice Card. Country support only Thailand.

settlement_time_type

String(32)

YES

T+1

Settlement group: T+1/T+2

single_order_limit

Int

YES

-1

Single limit, - 1 means no limit

mch_id

String(32)

YES

28811

assigned by Ksher

allow_remote_pay

String(32)

Y

Whether to support remote collection Y support N not support

allow_partial_refund

String(32)

N

Whether to support partial refund Y support N not support

master_mch_id

String()

bank_info Parameters (JSON )

swift_code

string

YES

Global bank code of the account bank

account_name

string

YES

Bank account name

bank_name

string

YES

Bank of deposit

account_id

string

YES

Bank account

logo_url

string

YES

Business logo

account_type

string

YES

Formal

Formal merchant or test merchant

country_info Parameters (JSON )

country_name

string

YES

Name of country

phone_code

string

YES

country code

mch_notify_url

string(256)

YES

the url to receive the asynchronous notification about the status of the payment from Ksher; If merchant leaves this field blank, then there will be no notification to send back to merchant.

is_master_mch

string(32)

YES

N

Is it the parent merchant

scan_type

int

2

wht

int

0

ith holding tax calculate

bd_info Parameters (JSON )

mobile

string

YES

tel of bd

bd_name

string

YES

name of bd

country_id

int

YES

country id

bd_id

string

YES

id of bd

add_time

String(16)

YES

add time

has_open_use_coupon

string

YES

N

Whether or not to open coupon write off

price_fee_type

String(16)

YES

THB

Currency of bid price

rigist_time

String(16)

YES

2020-04-01 17:54:14

rigist_time

settlement_fee_type

String(16)

YES

THB

Currency of settlement

agency_info Parameters (JSON )

mobile

string

YES

tel of agency

agency_name

string

YES

name of agency

email

string

YES

email of agency

agency_id

string

YES

id of agency

rigist_time

String(16)

YES

2020-04-01 17:54:14

rigist time

mobile

string

YES

Merchant’s mobile phone number

time_zone

string

YES

+07:00

time zone

mch_name Parameters (JSON )

mch_brief_name

string

YES

Merchant abbreviation

merchant_name

string

YES

Merchant name

contact

string

YES

Merchant contact name

operator_list Parameters (JSON )

operator_id

String(32)

NO

41234

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

mch_id

string

YES

assigned by Ksher

state

int

state

operator

string

YES

rule_id

int

0

0 is the boss and 1 is the general cashier

add_time

String(16)

YES

2020-04-01 17:54:14

add time

Example 2. SUCCESS Response Example
{
    "code": 0,
    "data": {
        "account_type": "Test",
        "agency_info": {
            "agency_name": "june.jutharat@ksher.net",
            "mobile": "08355499352"
        },
        "allow_partial_refund": "N",
        "allow_remote_pay": "Y",
        "bank_info": {
            "account_id": "1111111111",
            "account_name": "1111",
            "bank_name": "002,BANGKOK BANK PUBLIC COMPANY LIMITED",
            "swift_code": "BKKBTHBK"
        },
        "bd_info": {
            "bd_name": "DAVE",
            "mobile": "15103423471"
        },
        "business_mode": "online",
        "city_name_cn": "曼谷",
        "city_name_en": "Bangkok",
        "city_name_th": "กรุงเทพมหานคร",
        "contact": "OnlineTest_6",
        "country_info": {
            "country_name": "Thailand",
            "phone_code": "+66"
        },
        "country_support_channel": [
            "airpay",
            "alipay",
            "alipayplus",
            "bbl_promptpay",
            "card",
            "kbank_instal",
            "ktc_instal",
            "linepay",
            "promptpay",
            "scb_instal",
            "truemoney",
            "wechat"
        ],
        "extra_info": {},
        "has_open_use_coupon": "N",
        "is_master_mch": "N",
        "logo_url": "https://file.ksher.cn/ksherbd/h5/2020421/101821.png",
        "master_mch_id": "0",
        "mch_appid": "mch35005",
        "mch_id": "35005",
        "mch_name": {
            "mch_brief_name": "OnlineTest_6",
            "merchant_name": "OnlineTest_6"
        },
        "mch_notify_url": "",
        "mch_support_channel": [
            {
                "day_sum_limit": -1,
                "pay_channel": "alipay",
                "settlement_time_type": "T+2",
                "single_order_limit": -1
            },
            {
                "day_sum_limit": -1,
                "pay_channel": "linepay",
                "settlement_time_type": "T+2",
                "single_order_limit": -1
            },
            {
                "day_sum_limit": -1,
                "pay_channel": "airpay",
                "settlement_time_type": "T+2",
                "single_order_limit": -1
            },
            {
                "day_sum_limit": -1,
                "pay_channel": "",
                "settlement_time_type": "T+2",
                "single_order_limit": -1
            },
            {
                "day_sum_limit": -1,
                "pay_channel": "promptpay",
                "settlement_time_type": "T+2",
                "single_order_limit": -1
            },
            {
                "day_sum_limit": -1,
                "pay_channel": "wechat",
                "settlement_time_type": "T+2",
                "single_order_limit": -1
            },
            {
                "day_sum_limit": 10000000,
                "pay_channel": "ktc_instal",
                "settlement_time_type": "T+1",
                "single_order_limit": 10000000
            },
            {
                "day_sum_limit": -1,
                "pay_channel": "truemoney",
                "settlement_time_type": "T+2",
                "single_order_limit": -1
            }
        ],
        "mobile": "888888886",
        "nonce_str": "6ab86e441e92b32d18241de57faccbaf",
        "operator_list": [
            {
                "add_time": "2020-04-21 17:56:41",
                "mch_id": "35005",
                "operator": "OnlineTest_6",
                "operator_id": "29398",
                "rule_id": "0",
                "state": "1"
            },
            {
                "add_time": "2021-02-11 10:11:18",
                "mch_id": "35005",
                "operator": "000000001",
                "operator_id": "38897",
                "rule_id": "1",
                "state": "1"
            }
        ],
        "price_fee_type": "THB",
        "rigist_time": "2020-04-21 10:18:27",
        "settlement_fee_type": "THB",
        "time_zone": "+07:00",
        "wht": 0
    },
    "msg": "ok",
    "sign": "a192f04a91b154a36cc3952e4ea3be7185018fa482bda659cce92a127067dac74ace2b4103da923cba44b1a8aa950cd2d2375bf34d7a4ca8d1936b1b363ebcdb",
    "status_code": "",
    "status_msg": "",
    "time_stamp": "2022-01-12T20:01:35.592288+08:00",
    "version": "3.0.0"
}

merchant_info Fail Response Parameters

Parameter Type Required Example Description

code

int

YES

0

Value Range:

  • 0: it only shows the calling of the API is successful, not meaning the target business operation succeed.

  • Non 0: Calling of the API failed, merchant can use the same parameters to launch the request again.

sign

String(256)

YES

refer to following relevant chapter for signature algorithm

msg

String(32)

YES

the response message.

status_code

int

YES

  • 0: it only shows the calling of the API is successful, not meaning the target business operation succeed.

  • Non 0: Calling of the API failed, merchant can use the same parameters to launch the request again.

status_msg

String(256)

NO

the status message

time_stamp

String(256)

YES

"20190622131804"

time stamp

version

String(32)

YES

"3.0.0"

API version

data

JSON

data Parameters (JSON )

result

string(16)

YES

FAIL

Value range: FAIL, NOTSURE

err_code

String(32)

YES

SYSTEMERROR

Refer to the error list for the details

err_msg

String(128)

YES

system error

the detailed description of the error

nonce_str

String(32)

YES

Random string

Example 3. Fail Response Example
{
    "code": 0,
    "data": {
        "err_code": "KSHER_INVALID_PARAM",
        "err_msg": "error param nonce_str.",
        "nonce_str": "",
        "result": "FAIL"
    },
    "msg": "ok",
    "sign": "248281e98c90131255f97bc06a8ab653d7ff5a1e1bbab7b6329cb1d326b76a41e0a1ab2a0fcfc2dff9264c3fd696c061c6d66bcff83e041dec0e31732f0f6da5",
    "status_code": "",
    "status_msg": "",
    "time_stamp": "2020-07-15T13:24:24.649287+08:00",
    "version": "2.0.0"
}

How to check current wallet opening

“mch_support_channel” is current wallet/payment channel opening. “country_support_channel” is all of payment support in your Country, but some of wallet you will don’t use.

Example mch_support_channel array

        "mch_support_channel": [
            {
                "day_sum_limit": -1,
                "pay_channel": "airpay",
                "settlement_time_type": "T+1",
                "single_order_limit": -1
            },
            {
                "day_sum_limit": 100000,
                "pay_channel": "alipay",
                "settlement_time_type": "T+1",
                "single_order_limit": 100000
            },
            {
                "day_sum_limit": -1,
                "pay_channel": "promptpay",
                "settlement_time_type": "T+1",
                "single_order_limit": -1
            },
            {
                "day_sum_limit": 100000,
                "pay_channel": "wechat",
                "settlement_time_type": "T+1",
                "single_order_limit": 100000
            }
        ],

It is meaning

your account allow wallet: airpay/alipay/promptpay/wechat

airpay(shopee): unlimited transaction. settlement time is T+1.

alipay: transaction limit 1000.00 per day/per transaction. settlement time is T+1.

Promptpay: unlimited per day/per transaction. settlement time is T+1.

wechat: transaction limit 1000.00 per day/per transaction. settlement time is T+1.

Verify Signature

Merchant Info is Exception on Verify Signature. please check at Exception on Verify Signature

Rate Query

API method

URL

https://api.mch.ksher.net/KsherPay/rate_query

Method

POST

Parameter organization format

application/x-www-form-urlencoded

Rate_Query Request Parameters

Parameter Type Required Example Description

appid

String(32)

YES

mch12345

Your Merchant Number. Check on merchant ksher. The format is mch{Merchant No}.

nonce_str

String(32)

YES

ae0e6jm55qlq1o7

Random string, must be unique for signature.

sign

String(256)

YES

b000e9b6ec3fbda482d96a3d7c75c6956a5864336c3098462525e7229e8e046e490939a3e8b320a6c68eb63795a25b79d8c74f042f0972039bb5fe9b861cefb4

Digital signature for verifying the authenticity of digital messages. Please check how to got Signature Algorithm page

channel

String(32)

YES

wechat

Value range: wechat/alipay

fee_type

String(16)

YES

THB

Currency code. refer to with ISO 4217.

date

String(16)

YES

2019-04-27

The format is yyyy-MM-dd, as indicated on April 27, 2019 as 2019-04-27. Time zone is GMT+8 beijing

time_stamp

String(256)

YES

20190622131804

Time of create the request.the format is '%Y%m%d%H%M%S%SS'

version

String(32)

NO

"3.0.0"

API version

Example 4. Request Example
{
    "appid": "mch20163",
    "channel": "wechat",
    "nonce_str": "ogWfy5jDlujCyhJCKNjYQVlrSGkdj9LO",
    "fee_type": "THB",
    "date": "2019-04-27",
    "sign": "68ba48d72206a1561f6322800db9d8dabe4d1e0e1965fd31e5e10e034d2b9123291d6c596ac2b271292545275cc8bf4689ec8cdca581ff17c4ea1f3efd8e321a",
    "time_stamp": "20170516125822",
    "version": "3.0.0"
}

Rate_Query SUCCESS Response Parameters

Parameter Type Required Example Description

code

int

YES

0

Value Range :

  • 0: it only shows the calling of the API is successful, not meaning the target business operation succeed.

  • Non 0: Calling of the API failed, merchant can use the same parameter to launch the request again.

status_code

int

YES

1: it only shows the calling of the API is successful, not meaning the target business operation succeed.

Non 0: Calling of the API failed, merchant can use the same parameters to launch the request again.

status_msg

String(256)

YES

the status message

sign

String(256)

YES

b000e9b6ec3fbda482d96a3d7c75c6956a5864336c3098462525e7229e8e046e490939a3e8b320a6c68eb63795a25b79d8c74f042f0972039bb5fe9b861cefb4

Digital signature for verifying the authenticity of digital messages. Please check how to got Signature Algorithm page

version

String(32)

YES

"3.0.0"

API version

msg

String(32)

YES

the response message.

time_stamp

String(32)

YES

2020042015374848S

the time stamp of request order

data Parameters (JSON )

rate

string(16)

YES

exchange rate of foreign currency to RMB.

nonce_str

String(32)

YES

ae0e6jm55qlq1o7

Random string, must be unique for signature.

result

string(16)

YES

SUCCESS

fee_type

String(16)

YES

THB

comply with ISO 4217, 3 characters

Example 5. SUCCESS Response Example
{
    "code": 0,
    "status_code": "",
    "status_msg": "",
    "sign": "5f58aa1c15faa29a66ae994b81ec09b0731e041f83f1e9e7e1ca4ef704d365e82e46515652b8e29f46430bed697e3a241487fedd7d507abf201034a9482bf73b",
    "version": "3.0.0",
    "msg": "ok",
    "time_stamp": "",
    "data": {
        "rate": "0.21193417",
        "nonce_str": "4UPerCQYBQXNDFxiYDpuLnez4Q1puLDO",
        "result": "SUCCESS",
        "fee_type": "THB"
    }
}

Rate_Query FAIL Response Parameters

Parameter Type Required Example Description

code

int

YES

0

Value Range:

  • 0: it only shows the calling of the API is successful, not meaning the target business operation succeed.

  • Non 0: Calling of the API failed, merchant can use the same parameters to launch the request again.

sign

String(256)

YES

refer to following relevant chapter for signature algorithm

msg

String(32)

YES

the response message.

status_code

int

YES

Value Range

  • 0: it only shows the calling of the API is successful, not meaning the target business operation succeed.

  • Non 0: Calling of the API failed, merchant can use the same parameters to launch the request again.

status_msg

String(256)

NO

the status message

time_stamp

String(256)

YES

"20190622131804"

time stamp

version

String(32)

YES

"3.0.0"

API version

data Parameters (JSON )

result

string(16)

YES

FAIL

Value range:FAIL, NOTSURE .

  • FAIL : failed to close,in this case, merchant should re-launch the close request.

  • NOTSURE: it is not sure if the close operation succeed.

nonce_str

String(32)

YES

"sQ8gfSpeeV5Ld8ulW9q7JxUnXSOiZ90Y"

Random string

err_code

String(32)

YES

SYSTEMERROR

Refer to the error list for the details

err_msg

String(128)

YES

system error

the detailed description of the error

Example 6. FAIL Response Example
{
    "code": 0,
    "version": "3.0.0",
    "status_code": "",
    "msg": "ok",
    "time_stamp": "",
    "status_msg": "",
    "data": {
        "nonce_str": "PMlMGZ4RxvZzbwTh6mOriMrHgtxr0fWU",
        "err_msg": "merchant not exist.",
        "result": "FAIL",
        "err_code": "KSHER_INVALID_MCHINFO"
    },
    "sign": "5f58aa1c15faa29a66ae994b81ec09b0731e041f83f1e9e7e1ca4ef704d365e82e46515652b8e29f46430bed697e3a241487fedd7d507abf201034a9482bf73b4"
}