代理商接口列表 (创建支付订单)

需要授权

纯接口,商户直接调用此接口,返回调起支付所需支付要素,如微信和微信小程序可以直接调起微信支付。

请求参数:

POST请求地址:

环境 https请求地址
正式环境 https://openapi.duolabao.com/v1/agent/order/pay/create

公共请求参数:

参数名称 参数类型 是否必填 最大长度 参数说明 示例值
agentNum String 32 代理商编号 10001014477599412271110
customerNum String 32 商户编号 10001114596730086163709
shopNum String 32 店铺编号 10001214641783052104486
requestNum String 32 流水号(用户系统内唯一) 315080832507485
amount String 32 订单金额 100.00
bankType String 32 WX(微信支付)/JD(京东支付)/ALIPAY(支付宝支付)/QQ(QQ支付)/POS(POS支付)/WX_XCX(微信小程序支付)/UNIONPAY(银联JS支付) WX
authId String 32 微信(或支付宝)openId ojiuXuGrrejS0HwGkU8R_R2MKjY8
callbackUrl String 32 回调地址 https://www.duolabao.com
extraInfo String 255 (可选)用户自定义扩展信息(不支持中文字符) 自定义扩展信息
subscribeRoute String 32 是否启用粉丝路由(1代表启用 0或者不传代表不启用) 1

请求JSON示例:

  • JSON示例
  • 1 {
    2 agentNum: '10001014477599412271110',
    3 customerNum: '10001114991390825070154',
    4 shopNum: '10001214677149716953054',
    5 requestNum: '3454354444432',
    6 amount: '0.01',
    7 bankType: 'WX',
    8 authId: 'ojiuXuGWcejS0HwGkU8R_R2MKjY8',
    9 callbackUrl:' https://www.duolabao.com'
    10 }

返回参数JSON格式:

参数名称 参数类型 是否必填 最大长度 参数说明 示例值
result String 32 success表示成功,fail表示失败,error表示异常 success
orderNum String 32 订单编号 10001214641783052104486
requestNum String 32 流水号(用户系统内唯一) 建议时间戳+5位以上随机数(纯数字)
bankRequestNum String 32 支付流水号 10031115009669622861143
bankRequest PACKAGE String 32 订单详情扩展字符串 prepay_id=wx2017072515131983412f14450071406962
ORDERNUM String 32 订单编号 10001214641783052104486
CUSTOMERNUM String 32 商户编号 10001114991390825070154
PAYSIGN String 32 签名 4B02E702E04B02E39541C27A6989359E
SIBGTYPE String 32 签名方式 MD5
APPID String 32 公众号Id wx290ce4878444369d
NONCESTR String 32 随机字符串 1500966799443
TIMESTAMP String 32 时间戳 1500966799443
OUT_TRADE_NO String 32 银行流水号 10031115009669622861143
errorCode String 32 错误码 customerNotExist
orderNotExist
shopNotExist
errorMsg String 32 错误信息 商户信息不存在
商户下订单信息不存在
商户下店铺不存在

响应JSON示例:

  • JSON示例
  • 1 {
    2 "data": {
    3 "bankRequest": {
    4 "PACKAGE": "prepay_id=wx201707251611354906c3cca00155632910",
    5 "ORDERNUM": "10021015009643395281146",
    6 "CUSTOMERNUM": "10001114991390825070154",
    7 "PAYSIGN": "1F67E304C7BD2B56DDC2EF94CF27C02A",
    8 "SIBGTYPE": "MD5",
    9 "APPID": "wx290ce4878c94369d",
    10 "NONCESTR": "1500970295405",
    11 "TIMESTAMP": "1500970295405",
    12 "OUT_TRADE_NO": "10031115009704582061145"
    13 },
    14 "bankRequestNum": "10031115009704582061145",
    15 "orderNum": "10021015009643395281146",
    16 "requestNum": "10021015009643395281146"
    17 },
    18 "result": "success"
    19 }

错误响应示例:

  • 错误响应示例
  • 1 {
    2 "error": {
    3 "errorCode": "customerNumNotExist",
    4 "errorMsg": "customerNum not exist"
    5 },
    6 "result": "fail"
    7 }

异常示例:

  • 异常示例
  • 1 {
    2 "error": {
    3 "errorCode": "systemError",
    4 "errorMsg":"错误描述"
    5 },
    6 "result": "error"
    7 }

错误码解释:

错误码 错误描述 解决方案
paramsError requestNum must be specified 参数不正确
customerNotExist customer not exist 商户不存在
shopNotExist requestNum invalid 流水号无效,请确认流水号
orderNotExist order not exist 订单不存在
orderHasNotPayRecord order has not pay record 订单无支付记录
accountStatusError account status error 账户状态错误
settleProcess settle process 结算处理中
notEnoughBlance not enough blance 账户余额不足
accountOutRepeat account out repeat 重复出账
orderIsRefund order is refund 订单已退款
orderNotRefunding order not refunding 订单不是退款中状态
notSupportPayWay pay way not support 暂不支持该扫码方式
payAmountExceed customer pay amount exceed 商户正在审核,交易金额超限,请联系客服核实进度。
payFailed pay failed 支付失败,请更换其它付款方式或稍后再试