Skip to main content
Version: 1.0 版本

4.0-支付结算

接入方传入需要发放的人员结算单信息,可以选择使用分步支付流程或一键支付流程完成结算单的发放工作,流程如下:

4.1 结算申请

4.1.1 简要描述

创建结算支付订单

请求URL
  • /settlement/openapi/v1/settle/create
请求方式
  • POST
返回类型
  • JSON

4.1.3 请求参数

请求参数不传则查所有账户的余额信息,有参数则按照参数条件查询

参数名称参数类型必填参数说明备注
subAccountNoStringY账户号码接口(基础业务-1.1充值账户查询)返回此信息
bizCodeStringY内部业务编号接入方系统中的结算单编码
orderDetailListY订单明细如下

订单明细详情

参数名称参数类型必填参数说明备注
subBizCodeStringY子业务编码接入方系统中的结算单明细编码
oppositeAccountTypeStringN收款人交易账户类型银行卡 2.子账户 3.支付宝账户, 默认值:1
oppositeAccountNoStringY收款人账户号
oppositeAccountNameStringN收款人开户名如果交易账户类型为银行卡时必填
oppositeCardNoStringN收款人身份证号
amountBigDecimalY交易金额(元)单位:元,保留两位小小数截位

4.1.4 返回参数(JSON)

参数名称参数类型参数说明备注
msgString返回结果描述
codeString返回状态码200成功,其他均为失败
successboolean是否成功true/false
dataString返回数据详情见下表

返回数据明细(data)

参数名称参数类型参数说明备注
subAccountNoString账户号码
bizCodeString内部业务编码
prodRateBigDecimal服务费率
orderDetailList订单明细
successInfoString成功信息成功订单数_成功金额
failureInfoString失败信息失败订单数_失败金额
orderCodeString订单号系统生成的结算订单唯一编码
orderStatusString订单状态数据字典-0005-订单状态
orderTypeString订单类型数据字典-0006-订单操作类型
bizCodeString内部业务编码
extraCodeString外部编码
failMsgString失败原因
tradeServiceFeeBigDecimal交易手续费单位:元,保留两位小小数
totalAmountBigDecimal订单总金额单位:元,保留两位小小数
totalCountInteger订单总条数
successAmountBigDecimal成功总金额单位:元,保留两位小小数
successCountInteger成功数
failureAmountBigDecimal失败总金额单位:元,保留两位小小数
failureCountInteger失败数
totalTaskServiceAmountBigDecimal任务服务费总金额单位:元,保留两位小小数
finishTimeDate订单完成时间

订单明细详情

参数名称参数类型参数说明备注
subAccountNoString账户号码
subOrderStatusString子订单状态数据字典-0007-子订单状态
orderCodeString主订单号
subOrderCodeString子订单号
subBizCodeString子业务编码
tradeTypeString交易类型数据字典-0009-交易类型
oppositeAccountTypeString收款人交易账户类型1:银行卡 2.子账户 3.支付宝账户
oppositeAccountNoString收款人账户号
oppositeBankNameString收款人银行名称
oppositeBankBranchNameString收款人户行名称
oppositeBankCityNameString收款人开户城市
oppositeAccountNameString收款人开户名
oppositeCardNoString收款人身份证号
amountBigDecimal交易金额单位:元,保留两位小小数
tradeServiceFeeBigDecimal交易手续费单位:元,保留两位小小数
remarkString备注
failMsgString失败原因
subExtraCodeString子外部编码
extraTradeDateDate外部交易时间
taskServiceAmountBigDecimal任务服务费金额单位:元,保留两位小小数

4.1.5 接口请求示例

{
"subAccountNo":"1001102003000206",
"bizCode":"WOD2020071700005",
"detailDtos":[
{
"subBizCode":"WTD2020071700005",
"accountType":"1",
"oppositeAccountType":"1",
"oppositeAccountNo":"123456789",
"oppositeBankName":"招商银行",
"oppositeAccountName":"张三",
"oppositeCardNo":"330312192311211241",
"amount":"100"
}
]
}

接口返回示例

{
"msg": "请求成功",
"code": "200",
"success": true,
"data": {
"prodRate": 0.07,
"subAccountNo": "1001102003000206",
"orderCode": "2200717000000104",
"orderType": "2",
"bizCode": "WOD2020071700005",
"failMsg": null,
"tradeServiceFee": 0,
"totalAmount": 100,
"totalCount": 1,
"successAmount": null,
"successCount": null,
"failureAmount": null,
"failureCount": null,
"totalTaskServiceAmount": 7.00,
"orderStatus": "1",
"finishTime": null,
"orderDetails": [
{
"subOrderStatus": "1",
"subBizCode": "WTD2020071700005",
"tradeType": "2",
"accountType":"1",
"oppositeAccountType": "1",
"oppositeAccountNo": "123456789",
"oppositeBankName": "招商银行",
"oppositeBankBranchName": "南方商城支行",
"oppositeBankCityName": "上海",
"oppositeAccountName": "张三",
"oppositeCardNo":"330312192311211241",
"amount": 100,
"tradeServiceFee": 0,
"remark": null,
"failMsg": null,
"taskServiceAmount": 7.00
}
]
}
}

4.1.6 备注

更多返回错误代码请看首页的错误代码描述

4.2 结算查询

4.2.1 简要描述

查询已申请的结算单信息

请求URL
  • /settlement/openapi/v1/settle/query
请求方式
  • POST
返回类型
  • JSON

4.2.3 请求参数(POST)

请求参数不传则查所有账户的余额信息,有参数则按照参数条件查询

参数名称参数类型必填参数说明备注
pageNoIntegerN分页号不填默认第一页
subAccountNoStringY账户号码
bizCodeStringN内部业务编码
orderTypeStringN订单类型数据字典-0006-订单操作类型
orderStatusStringN订单状态数据字典-0005-订单状态
createTimeStartDateN创建时间起
createTimeEndDateN创建时间止
finishTimeStartDateN交易金额起
finishTimeEndDateN完成时间止

4.2.4 返回参数(JSON)

参数名称参数类型参数说明备注
msgString返回结果描述
codeString返回状态码200成功,其他均为失败
successboolean是否成功true/false
dataString返回数据详情见下表

返回数据明细(data)

参数名称参数类型参数说明备注
pageNoInteger页号
pageSizeInteger分页大小
pageCountInteger分页总数
totalCountInteger数据总条数
entityListList结果集

entityList元素对象

参数名称参数类型参数说明备注
subAccountNoString账户号码
orderCodeInteger页号
orderTypeInteger订单类型数据字典-0005-订单类型
bizCodeInteger内部业务编码
tradeServiceFeeBigDecimal交易手续费单位:元,保留两位小小数
totalAmountBigDecimal订单总金额单位:元,保留两位小小数
totalCountInteger订单数
successAmountBigDecimal成功订金额单位:元,保留两位小小数
successCountInteger成功订单数
failureAmountBigDecimal失败订金额单位:元,保留两位小小数
failureCountInteger失败订单数
totalTaskServiceAmountBigDecimal任务服务费总金额单位:元,保留两位小小数
orderStatusString订单状态数据字典-0005-订单状态
finishTimeDate完成时间
orderDetailsList订单明细见下表orderDetails元素对象

orderDetails元素对象

参数名称参数类型参数说明备注
subOrderStatusString子订单状态数据字典-0007-子订单状态
subBizCodeString子业务编码
tradeTypeString交易类型数据字典-0006-订单操作类型
oppositeAccountTypeString对方交易账户类型
oppositeAccountNoString对方账户号
oppositeBankNameString对方银行名称
oppositeBankBranchNameString对方开户行名称
oppositeBankCityNameString对方开户城市
oppositeAccountNameString对方开户名
oppositeCardNoString对方身份证号
amountBigDecimal交易金额单位:元,保留两位小数
tradeServiceFeeBigDecimal交易手续费单位:元,保留两位小数
remarkString备注
failMsgString失败原因
subExtraCodeString子外部编码
extraTradeDateDate外部交易时间
taskServiceAmountBigDecimal任务服务费金额单位:元,保留两位小数

4.2.5 接口示例

必填参数查询

{
"subAccountNo": "1001102003000206"
}

必填参数查询接口返回示例

{
"msg": "请求成功",
"code": "200",
"success": true,
"data": {
"pageNo": 1,
"pageSize": 20,
"pageCount": 1,
"totalCount": 18,
"entityList": [
{
"prodRate": 0.08,
"subAccountNo": "1001102009000102",
"orderCode": "2201009000000004",
"orderType": "2",
"bizCode": "S2020100900003",
"failMsg": null,
"tradeServiceFee": 0.00,
"totalAmount": 100.00,
"totalCount": 1,
"successAmount": 0,
"successCount": 0,
"failureAmount": 0,
"failureCount": 0,
"totalTaskServiceAmount": 8.00,
"orderStatus": "1",
"createTime": "2020-10-09 16:06:58",
"finishTime": null,
"orderDetails": [
{
"subOrderStatus": "1",
"subBizCode": "S2020100900003",
"tradeType": "2",
"oppositeAccountType": "1",
"oppositeAccountNo": "6222021001099621627",
"oppositeBankName": "工商银行",
"oppositeBankBranchName": null,
"oppositeBankCityName": "工商银行",
"oppositeAccountName": "张三",
"oppositeCardNo":"330312192311211241",
"amount": 100.00,
"tradeServiceFee": 0.00,
"remark": null,
"failMsg": null,
"taskServiceAmount": 8.00
}
]
},
{
"prodRate": 0.08,
"subAccountNo": "1101102009000001",
"orderCode": "2201009000000003",
"orderType": "2",
"bizCode": "AK111111",
"failMsg": null,
"tradeServiceFee": 0.00,
"totalAmount": 1.00,
"totalCount": 1,
"successAmount": 0,
"successCount": 0,
"failureAmount": 0,
"failureCount": 0,
"totalTaskServiceAmount": 0.08,
"orderStatus": "1",
"createTime": "2020-10-09 10:13:53",
"finishTime": null,
"orderDetails": [
{
"subOrderStatus": "1",
"subBizCode": "AK111111",
"tradeType": "2",
"oppositeAccountType": "3",
"oppositeAccountNo": "zhifubao@qq.com",
"oppositeBankName": "招商银行",
"oppositeBankBranchName": "南方商城支行",
"oppositeBankCityName": "上海",
"oppositeAccountName": "张三",
"oppositeCardNo":"330312192311211241",
"amount": 1.00,
"tradeServiceFee": 0.00,
"remark": null,
"failMsg": null,
"taskServiceAmount": 0.08
}
]
},
{
"prodRate": 0.08,
"subAccountNo": "1001102009000102",
"orderCode": "2201009000000001",
"orderType": "2",
"bizCode": "S2020100900002",
"failMsg": null,
"tradeServiceFee": 0.00,
"totalAmount": 100.00,
"totalCount": 1,
"successAmount": 0,
"successCount": 0,
"failureAmount": 0,
"failureCount": 0,
"totalTaskServiceAmount": 8.00,
"orderStatus": "1",
"createTime": "2020-10-09 09:19:13",
"finishTime": null,
"orderDetails": [
{
"subOrderStatus": "1",
"subBizCode": "S2020100900002",
"tradeType": "2",
"oppositeAccountType": "1",
"oppositeAccountNo": "62220210010996226222",
"oppositeBankName": "工商银行",
"oppositeBankBranchName": null,
"oppositeBankCityName": "工商银行",
"oppositeAccountName": "张三",
"oppositeCardNo":"330312192311211241",
"amount": 100.00,
"tradeServiceFee": 0.00,
"remark": null,
"failMsg": null,
"taskServiceAmount": 8.00
}
]
},
{
"prodRate": 0.08,
"subAccountNo": "1001102009000102",
"orderCode": "2200924000000024",
"orderType": "2",
"bizCode": "S2020092400021",
"failMsg": null,
"tradeServiceFee": 0.00,
"totalAmount": 100.00,
"totalCount": 1,
"successAmount": 0,
"successCount": 0,
"failureAmount": 0,
"failureCount": 0,
"totalTaskServiceAmount": 8.00,
"orderStatus": "1",
"createTime": "2020-09-24 14:34:03",
"finishTime": null,
"orderDetails": [
{
"subOrderStatus": "1",
"subBizCode": "S2020092400021",
"tradeType": "2",
"oppositeAccountType": "2",
"oppositeAccountNo": "62220210010996226222",
"oppositeBankName": null,
"oppositeBankBranchName": null,
"oppositeBankCityName": null,
"oppositeAccountName": "张三",
"oppositeCardNo":"330312192311211241",
"amount": 100.00,
"tradeServiceFee": 0.00,
"remark": null,
"failMsg": null,
"taskServiceAmount": 8.00
}
]
}
],
"firstEntityIndex": 0,
"needPage": true
}
}

4.2.6 备注

更多返回错误代码请看首页的错误代码描述

4.3 结算单冻结

4.3.1 简要描述

校验机构支付账户中的可用余额(非冻结金额),若可用余额不小于结算单总金额,则通过校验并且冻结此结算单的总金额额度,支付账户可用余额=支付账户总金额-冻结金额;若可用余额小于结算行金额,则校验失败,无法冻结.

请求URL
  • /settlement/openapi/v1/settle/freeze/{orderCode}
请求方式
  • GET
返回类型
  • JSON

4.3.3 请求参数

请求参数不传则查所有账户的余额信息,有参数则按照参数条件查询

参数名称参数类型必填参数说明备注
orderCodeStringY订单号接口(结算业务——1.1 结算申请)返回此信息

4.3.4 返回参数(JSON)

参数名称参数类型参数说明备注
msgString返回结果描述冻结成功
codeString返回状态码200成功,其他均为失败
successboolean是否成功true/false
dataString返回数据orderCode

1.3.5 接口请求示例

请求url

/openapi/v1/settle/freeze/2200805000001005

返回结果

{
"msg": "冻结结算订单成功",
"code": "200",
"success": true,
"data": "2200805000001005"
}

4.3.6 备注

更多返回错误代码请看首页的错误代码描述

4.4 结算单取消冻结

4.4.1 简要描述

解除支付中账户中对应结算单的冻结金额

请求URL
  • /settlement/openapi/v1/settle/unfreeze/{orderCode}
请求方式
  • GET
返回类型
  • JSON

4.4.3 请求参数

请求参数不传则查所有账户的余额信息,有参数则按照参数条件查询

参数名称参数类型必填参数说明备注
orderCodeStringY订单号接口(结算业务——1.1 结算申请)返回此信息

4.4.4 返回参数(JSON)

参数名称参数类型参数说明备注
msgString返回结果描述解除冻结成功
codeString返回状态码200成功,其他均为失败
successboolean是否成功true/false
dataString返回数据orderCode

4.4.5 接口请求示例

请求url

/openapi/v1/settle/unfreeze/2200805000001005

返回结果

{
"msg": "取消冻结结算订单成功",
"code": "200",
"success": true,
"data": "2200805000001005"
}

4.4.6 备注

更多返回错误代码请看首页的错误代码描述

4.5 结算单锁定

4.5.1 简要描述

锁定结算单,此结算单在锁定后则无法操作解冻、删除等其他操作,是正式支付的前置状态

4.5.2 请求URL

  • /settlement/openapi/v1/settle/lock/{orderCode}

4.5.3 请求参数(GET)

请求参数不传则查所有账户的余额信息,有参数则按照参数条件查询

参数名称参数类型必填参数说明备注
orderCodeStringY订单号接口(结算业务——1.1 结算申请)返回此信息

4.5.4 返回参数(JSON)

参数名称参数类型参数说明备注
msgString返回结果描述锁定成功
codeString返回状态码200成功,其他均为失败
successboolean是否成功true/false
dataString返回数据orderCode

4.5.5 接口请求示例

请求url

/openapi/v1/settle/lock/2200805000001005

返回结果

{
"msg": "锁定结算订单成功",
"code": "200",
"success": true,
"data": "2200805000001005"
}

4.5.6 备注

更多返回错误代码请看首页的错误代码描述

4.6 结算单取消锁定

4.6.1 简要描述

结算单解除锁定

请求URL
  • /settlement/openapi/v1/settle/unlock/{orderCode}
请求方式
  • GET
返回类型
  • JSON

4.6.3 请求参数

请求参数不传则查所有账户的余额信息,有参数则按照参数条件查询

参数名称参数类型必填参数说明备注
orderCodeStringY订单号接口(结算业务——1.1 结算申请)返回此信息

4.6.4 返回参数(JSON)

参数名称参数类型参数说明备注
msgString返回结果描述解除锁定成功
codeString返回状态码200成功,其他均为失败
successboolean是否成功true/false
dataString返回数据orderCode

4.6.5 接口请求示例

请求url

/openapi/v1/settle/unlock/2200805000001005

返回结果

{
"msg": "取消锁定结算订单成功",
"code": "200",
"success": true,
"data": "2200805000001005"
}

4.6.6 备注

更多返回错误代码请看首页的错误代码描述

4.7 结算单支付

4.7.1 简要描述

结算单支付前置条件是锁定状态,只允许支付已锁定状态的结算单

请求URL
  • /settlement/openapi/v1/settle/pay/{orderCode}
请求方式
  • GET
返回类型
  • JSON

4.7.3 请求参数

请求参数不传则查所有账户的余额信息,有参数则按照参数条件查询

参数名称参数类型必填参数说明备注
orderCodeStringY订单号申请支付的结算单状态必须为锁定、冻结状态,
否则支付失败

4.7.4 返回参数(JSON)

参数名称参数类型参数说明备注
msgString返回结果描述支付成功
codeString返回状态码200成功,其他均为失败
successboolean是否成功true/false
dataString返回数据orderCode

4.7.5 接口请求示例

请求url

/openapi/v1/settle/pay/2200805000001005

返回结果

{
"msg": "支付结算订单成功",
"code": "200",
"success": true,
"data": "2200805000001005"
}

4.7.6 备注

更多返回错误代码请看首页的错误代码描述

4.8 结算单申请并支付

4.8.1 简要描述

创建结算支付订单并支付,此接口可以直接生成结算订单并且发起支付.

请求URL
  • /settlement/openapi/v1/settle/create_and_pay
请求方式
  • POST
返回类型
  • JSON

4.8.3 请求参数

内部业务编码

参数名称参数类型必填参数说明备注
subAccountNoStringY账户号码
bizCodeStringY内部业务编码接入方系统中的结算单编码,具有唯一性
orderDetailListN订单明细

订单明细详情

参数名称参数类型必填参数说明备注
subBizCodeStringY子业务编码接入方系统中的结算单明细编码,具有唯一性
oppositeAccountTypeStringN收款人交易账户类型1:银行卡 2.子账户 3.支付宝账户 默认值:1
oppositeAccountNoStringY收款人账户号
oppositeAccountNameStringN收款人开户名如果交易账户类型为银行卡时必填
oppositeCardNoStringN收款人身份证号
amountBigDecimalY交易金额单位:元,保留两位小数

4.8.4 返回参数(JSON)

参数名称参数类型参数说明备注
msgString返回结果描述
codeString返回状态码200成功,其他均为失败
successboolean是否成功true/false
dataString返回数据详情见下表

返回数据明细(data)

参数名称参数类型参数说明备注
subAccountNoString账户号码
bizCodeString内部业务编码
prodRateBigDecimal服务费率
orderDetailList订单明细
successInfoString成功信息成功订单数_成功金额
failureInfoString失败信息失败订单数_失败金额
orderCodeString订单号
orderStatusString订单状态数据字典-0005-订单状态
orderTypeString订单类型数据字典-0006-订单操作类型
bizCodeString内部业务编码
extraCodeString外部编码
failMsgString失败原因
tradeServiceFeeBigDecimal交易手续费
totalAmountBigDecimal订单总金额单位:元,截位保留两位小数
totalCountInteger订单总条数
successAmountBigDecimal成功总金额单位:元,截位保留两位小数
successCountInteger成功数
failureAmountBigDecimal失败总金额单位:元,截位保留两位小数
failureCountInteger失败数
totalTaskServiceAmountBigDecimal任务服务费总金额单位:元,保留两位小数(向上进位)
finishTimeDate订单完成时间

订单明细详情

参数名称参数类型参数说明备注
subAccountNoString账户号码
subOrderStatusString子订单状态数据字典-0007-子订单状态
orderCodeString主订单号
subOrderCodeString子订单号
subBizCodeString子业务编码
tradeTypeString交易类型数据字典-0006-订单操作类型
oppositeAccountTypeString对方交易账户类型默认为1:银行卡
oppositeAccountNoString对方账户号
oppositeBankNameString对方银行名称
oppositeBankBranchNameString对方开户行名称
oppositeBankCityNameString对方开户城市
oppositeAccountNameString对方开户名
oppositeCardNoString对方身份证号
amountBigDecimal交易金额单位:元,保留两位小数(截位)
tradeServiceFeeBigDecimal交易手续费单位:元,保留两位小数(向上进位)
remarkString备注
failMsgString失败原因
subExtraCodeString子外部编码
extraTradeDateDate外部交易时间
taskServiceAmountBigDecimal任务服务费金额

4.8.5 接口示例

请求参数

{
"subAccountNo":"1001102003000206",
"bizCode":"WOD2020071700013",
"detailDtos":[
{
"subBizCode":"WTD2020071700013",
"oppositeAccountType":"1",
"oppositeAccountNo":"123456789",
"oppositeBankName":"招商银行",
"oppositeBankBranchName":"南方商城支行",
"oppositeBankCityName":"上海",
"oppositeAccountName":"张三",
"oppositeCardNo":"330312192311211241",
"amount":"1"
}
]
}

返回结果

{
"msg": "请求成功",
"code": "200",
"success": true,
"data": {
"prodRate": 0.07,
"subAccountNo": "1001102003000206",
"orderCode": "2200805000001011",
"orderType": "2",
"bizCode": "WOD2020071700013",
"failMsg": null,
"tradeServiceFee": 0,
"totalAmount": 1,
"totalCount": 1,
"successAmount": null,
"successCount": null,
"failureAmount": null,
"failureCount": null,
"totalTaskServiceAmount": 0.07,
"orderStatus": "1",
"createTime": "2020-08-05 13:57:46",
"finishTime": null,
"orderDetails": [
{
"subOrderStatus": "1",
"subBizCode": "WTD2020071700013",
"tradeType": "2",
"oppositeAccountType": "1",
"oppositeAccountNo": "123456789",
"oppositeBankName": "招商银行",
"oppositeBankBranchName": "南方商城支行",
"oppositeBankCityName": "上海",
"oppositeAccountName": "张三",
"oppositeCardNo":"330312192311211241",
"amount": 1,
"tradeServiceFee": 0,
"remark": null,
"failMsg": null,
"taskServiceAmount": 0.07
}
]
}
}

返回结果(幂等重复验证结果),建议根据bizCode查询 1.2 结算查询接口

{
"msg":"内部业务编码重复",
"code":"010004",
"success":false,
"data":null
}

4.8.6 备注

更多返回错误代码请看首页的错误代码描述