代理商通过该接口创建交易的支付链接。
POST请求地址:
环境 | https请求地址 |
---|---|
正式环境 | https://openapi.duolabao.com/v1/agent/order/payurl/create |
公共请求参数:
参数名称 | 参数类型 | 是否必填 | 最小长度 | 最大长度 | 参数说明 | 示例值 |
---|---|---|---|---|---|---|
agentNum | String | 是 | 32 | 代理商编号 | 10001114514826219621868 | |
customerNum | String | 是 | 32 | 商户编号 | 10001114513826266541863 | |
shopNum | String | 是 | 32 | 店铺编号 | 10001214653797401143127 | |
machineNum | String | 否 | 32 | 建议填写虚拟机具序列号 | 10011014593073262477203 | |
requestNum | String | 是 | 18 | 32 | 流水号(用户系统内唯一) | 建议时间戳+5位以上随机数(纯数字) |
amount | String | 是 | 15, 2 | 订单金额,单位:元,精确到分 | 100.00 | |
source | String | 是 | 255 | 定值:API | API | |
tableNum | String | 否 | 11 | 桌号 | 15 | |
callbackUrl | String | 否 | 255 | (可选)交易完成后,会调用此地址通知交易结果(目前只有交易成功会通知) | openapi.duolabao.com | |
extraInfo | String | 否 | 255 | (可选)用户自定义扩展信息(不支持中文字符) | 自定义扩展信息 | |
completeUrl | String | 否 | 255 | (可选)用户自定义支付完成页 | 自定义支付完成页 |
1 | { |
2 | "agentNum": "10001114514826219621868", |
3 | "customerNum": "10001114495558121971726", |
4 | "shopNum": "10001214653797401143127", |
5 | "machineNum": "10011014593073262477203", |
6 | "requestNum": "2014072300007148", |
7 | "amount": "100.00", |
8 | "tableNum": "15", |
9 | "source": "API", |
10 | "callbackUrl":"openapi.duolabao.com", |
11 | "extraInfo":"自定义扩展信息" |
12 | "completeUrl":"https://openapi.duolabao.com" |
13 | } |
参数名称 | 参数类型 | 是否必填 | 最大长度 | 参数说明 | 示例值 |
---|---|---|---|---|---|
result | String | 是 | 32 | success表示成功,fail表示失败,error表示异常 | success |
errorCode | String | 否 | 32 | 详见错误码表 | shopNumNotExist |
errorMsg | String | 否 | 32 | 详见错误信息 | shopNum not exist |
url | String | 否 | 255 | 二维码链接(根基url生成二维码) | https://order.duolabao.com/active/c?state=315080832507485%7CmachineNum%7C10.50%7C15%7CPCCLIENT |
1 | { |
2 | "data": { |
3 | "url": "https://order.duolabao.com/active/c?state=315080832507485%7Cmachine |
Num"%7C10.50%7C15%7CPCCLIENT" | |
4 | }, |
5 | "result": "success" |
6 | } |
1 | { |
2 | "error": { |
3 | "errorCode": "shopNumNotExist", |
4 | "errorMsg": "shopNum not exsit" |
5 | }, |
6 | "result": "fail" |
7 | } |
1 | { |
2 | "error": { |
3 | "errorCode": "systemError", |
4 | "errorMsg":"错误描述" |
5 | }, |
6 | "result": "error" |
7 | } |
错误码 | 错误描述 | 解决方案 |
---|---|---|
paramsError | requestNum must be specified | 参数不正确,请确认参数 |
amountInvalid | amount invalid | 金额无效,请确认金额 |
requestNumInvalid | requestNum invalid | 流水号无效,请确认流水号 |
tableNumInvalid | tableNum invalid | 桌号无效,请确认桌号 |
callbackUrlInvalid | callbackUrl invalid | 回调地址无效,请确认回调地址 |
extraInfoInvalid | extraInfo invalid | 扩展信息无效,请确认扩展信息 |
customerNotExist | customer not exist | 商户不存在 |
customerNotActive | customer not active | 商户未激活 |
shopNotExist | shop not exist | 店铺不存在 |
shopIsClosed | shop is closed | 店铺已关闭 |
machineNotExist | machine not exist | 机具不存在 |
machineNotUsing | machine not using | 机具未使用 |
machineExsit | machine:[编号] is exsit | 机具号已经存在,请确认机具号 |
generalUrlFailed | general url failed | 生成支付链接失败,请重新生成支付链接 |