更多资料请参考:www.woyaocha.net/product/posmcc
接口描述
功能描述
通过商户编号获取中国大陆地区所有线下收单机构的商户信息,如:收单机构、MCC编码类别、适用费率及商户所在地区等信息。
URL 示例
1)http
协议:
POST 方式请求:
Copy
http://cha.ebaitian.cn/api/json?appid=xxx&module=getPosmccInfo&merchantNo=xxx&sign=xxx
GET 方式请求:
Copy
http://cha.ebaitian.cn/api/json?type=get&appid=xxx&module=getPosmccInfo&merchantNo=xxx&sign=xxx
2)https
协议:
POST 方式请求:
Copy
https://cha.ebaitian.cn/api/json?appid=xxx&module=getPosmccInfo&merchantNo=xxx&sign=xxx
GET 方式请求:
Copy
https://cha.ebaitian.cn/api/json?type=get&appid=xxx&module=getPosmccInfo&merchantNo=xxx&sign=xxx
请求参数
数据包体
Copy
{
"type": "get",
"appid": "1000xxxx",
"module": "getPosmccInfo",
"merchantNo": "820521154110001",
"sign": "ecab4881ee80ad3d76bb1da68387428ca752eb885e52621a3129dcf4d9bc4fd4"
}
参数说明
参数 | 必选 | 类型 | 描述 |
---|---|---|---|
type | 否 | string | 授权接口的请求方式 |
appid | 是 | string | 授权接口的 AppID,请填写您在我要查官网上申请到的 AppID |
module | 是 | string | 目标请求的数据模块,查询 POS 商户编号为:getPosmccInfo |
merchantNo | 是 | string | 目标要查询的商户编号,即 POS 签购单上的商户编号,一般为15位数字 |
sign | 是 | string | 请求凭证,具体计算方式见下面的其他说明 |
其他说明
1)type:可选值 get,如果赋值 get,则以 get 方式提交数据;默认以 post 方式提交数据;
2)sign:签名校验,根据公式 $sign=sha256(appid=$appid&module=getPosmccInfo&merchantNo=$merchantNo&appkey=$appkey)
生成;其中:appkey 为授权接口的 AppKey,请填写您在我要查官网上申请到的 AppKey 。
构造伪代码如下:
Copy
string type = "get"; //请求方式,可以赋值为:post
string appid = "1000xxxx"; //sdkappid 对应的 appid,需要业务方高度保密
string module = "getPosmccInfo"; //请求的数据模块,此处赋值:getMobileArea
string merchantNo = "820521154110001"; //要查询的手机号码,注意仅能为中国大陆地区11位手机号码
string sign = sha256(appid=1000xxxx&module=getPosmccInfo&merchantNo=820521154110001&appkey=56cf61af4b7897e704f67deb88ae8f24);
响应参数
数据包体
Copy
{
"result":1,
"description":"TRUE",
"flag":"",
"posmccInfo":{
"posbankInfo":{
"bankclass":"收单资质机构",
"bankcode":"820",
"bankareacode":"0",
"bankareaname":null,
"bankname":"盛付通"
},
"posareaInfo":{
"areacode":"5211",
"province":"湖北省",
"city":"武汉市",
"dis":"江岸区"
},
"posmccInfo":{
"bclass":"民生类",
"sclass":"加油、超市类",
"mcccode":"5411",
"broad":"大型仓储式超级市场大型仓储式超级市场",
"rates":"0.34",
"note":"包含“超市、仓储式大卖场、连锁店、便利店”等字样;
开架式连锁便利店集团,当其以整体方式签订入网协议,且在同一地区门店数量在20 家以上;
食品饮料自动售货机,以及综合菜市场的零售活动"
}
}
}
参数说明
参数说明
参数 | 必选 | 类型 | 描述 |
---|---|---|---|
result | 是 | string | 接口响应结果:0-失败;1-成功 |
description | 是 | string | 接口响应描述:一般为 TURE(result=1) 与 FALSE(result=0),或者返回错误信息 |
flag | 否 | string | 错误说明,没有错误则返回空 |
posmccInfo< |