Appearance
分账订单查询接口 ¶
提示
用于分账订单创建后,可以通过该接口主动查询订单状态,完成下一步的业务逻辑。
接口说明 ¶
参数 | 说明 |
---|---|
请求URL | /unipay/query/allocationOrder |
请求方式 | POST |
请求类型 | application/json |
请求参数 ¶
字段名 | 变量名 | 必填 | 类型 | 示例值 | 描述 | |
---|---|---|---|---|---|---|
分账号 | allocationNo | 否 | String | 32 | 1753370980523384832 | 分账号与商户分账号不可以同时为空,同时传输是以分账号为准 |
商户分账号 | bizAllocationNo | 否 | String | 100 | A0001 | 分账号与商户分账号不可以同时为空,同时传输是以分账号为准 |
用户IP | clientIp | 否 | String | 64 | 127.0.0.1 | 支持Ipv4和Ipv6,部分支付通道要求必填,如调用微信支付时 |
随机数值 | nonceStr | 否 | String | 32 | d112892e382a7093 | |
签名值 | sign | 否 | String | 64 | 072695d112892e382a7093b81e6a52af | |
请求时间 | reqTime | 是 | Long | 123123121 | 使用时间戳(秒级) |
响应结果 ¶
提示
业务数据包裹在公共响应参数
中的data
字段,在code
为0
时才会有返回数据。
分账订单 ¶
字段名 | 变量名 | 必传 | 类型 | 示例值 | 描述 |
---|---|---|---|---|---|
分账单号 | allocationNo | 是 | String | 1753370980523384832 | 系统生成的分账号 |
商户分账单号 | bizAllocationNo | 是 | String | 1753370980523384832 | 商户生成的分账号 |
通道分账号 | outAllocationNo | 否 | String | 1753370980523384832 | 三方支付系统的分账号 |
支付订单号 | orderNo | 是 | String | 1753370980523384832 | 系统生成的订单号 |
商户支付订单号 | bizOrderNo | 是 | String | P0001 | 商户传输的订单号 |
通道支付订单号 | outOrderNo | 是 | String | 22212137757334130130 | 三方支付系统返回的交易号 |
支付订单标题 | title | 是 | String | 测试支付 | |
所属通道 | autoAllocation | 是 | String | wechat_pay | |
分账描述 | description | 否 | String | qrcode | |
总分账金额 | amount | 是 | int | 20 | |
分账状态 | status | 是 | String | progress | |
处理结果 | result | 是 | String | progress | |
完成时间 | finishTime | 否 | Long | 114454145 | 使用时间戳(秒级) |
分账明细 | details | 是 | AllocOrderDetailModel[] | 见下方分账明细 | |
错误码(订单) | errorCode | 否 | Integer | 0 | 与状态码(公共)不同,这里返回的是支付订单的错误状态 |
错误信息(订单) | errorCode | 否 | String | 未启用分账 | 与错误信息(公共),这里返回的是支付订单的错误信息提示 |
签名 | sign | 是 | String | 072695d112892e382a7093b81e6a52af | |
状态码(公共) | code | 否 | Integer | 0 | 为0表示成功,非0表示失败 |
错误信息(公共) | msg | 否 | String | 关闭失败 | 状态非0时会有返回值 |
响应时间(公共) | resTime | 是 | Long | 123123121 | 服务返回请求的时间,时间戳(秒级) |
分账明细 ¶
字段名 | 变量名 | 必传 | 类型 | 示例值 | 描述 |
---|---|---|---|---|---|
分账接收方编号 | receiverNo | 是 | String | 1753370980523384832 | 系统生成的分账号 |
分账金额 | amount | 是 | Integer | 分 | |
分账比例 | rate | 是 | Integer | 万分之多少 | |
分账接收方类型 | receiverType | 是 | String | ||
接收方账号 | receiverAccount | 是 | String | ||
接收方姓名 | receiverName | 否 | String | ||
分账结果 | result | 是 | String | ||
状态码 | errorCode | 否 | Integer | 0 | |
错误信息 | errorMsg | 否 | String |
HTTP请求示例 ¶
请求参数 ¶
json
{
"allocationNo": "DEVA24060200024363000001",
"clientIp": "127.0.0.1",
"sign": "cce35cf333daf3dc5914bba8a3db1bbeebc1704564febe5ad4db410763865a28",
"reqTime": 1717419815
}
响应参数(成功) ¶
json
{
"msg": "success",
"code": 0,
"data": {
"allocationNo": "DEVA24060200024363000001",
"bizAllocationNo": "A46974",
"outAllocationNo": "20240602002530020065510304965682",
"orderNo": "DEVP24060123574963000003",
"bizOrderNo": "SDK_1717257469568",
"outOrderNo": "2024060122001451650502837418",
"title": "测试手动分账",
"channel": "ali_pay",
"amount": 6000,
"description": "测试分账",
"status": "allocation_processing",
"result": "all_pending",
"details": [
{
"receiverNo": "123",
"amount": 6000,
"rate": 6000,
"receiverType": "ali_user_id",
"receiverAccount": "2088722032251651",
"result": "pending"
}
],
"code": 0,
"resTime": 1717419940,
"sign": "1690414255dc7ebbce255b9f8ae824f0f5f1c63833a8030a3dadf6f6cb10675e"
},
"traceId": "fvtm0cFqoU4a"
}
响应参数(失败) ¶
json
{
"msg": "success",
"code": 0,
"data": {
"code": 1,
"msg": "分账单不存在",
"resTime": 1717419980,
"sign": "0f23ed66c9f1a326d222ebc1ff4660b992294e61a5cbbc329dca384465cc4c0c"
},
"traceId": "erLD7yDpsHH9"
}
SDK请求示例 ¶
提示
使用SDK可以简化接入支付的速度
java
package cn.daxpay.single.sdk.query;
import cn.daxpay.single.sdk.code.PayChannelEnum;
import cn.daxpay.single.sdk.code.SignTypeEnum;
import cn.daxpay.single.sdk.model.allocation.AllocOrderModel;
import cn.daxpay.single.sdk.model.allocation.AllocReceiversModel;
import cn.daxpay.single.sdk.net.DaxPayConfig;
import cn.daxpay.single.sdk.net.DaxPayKit;
import cn.daxpay.single.sdk.param.allocation.QueryAllocOrderParam;
import cn.daxpay.single.sdk.param.allocation.QueryAllocReceiverParam;
import cn.daxpay.single.sdk.response.DaxPayResult;
import cn.hutool.json.JSONUtil;
import org.junit.Before;
import org.junit.Test;
/**
* 查询分账订单测试类
* @author xxm
* @since 2024/6/3
*/
public class QueryAllocOrderTest {
@Before
public void init() {
// 初始化支付配置
DaxPayConfig config = DaxPayConfig.builder()
.serviceUrl("http://127.0.0.1:9000")
.signSecret("123456")
.signType(SignTypeEnum.HMAC_SHA256)
.build();
DaxPayKit.initConfig(config);
}
/**
* 分账订单查询
*/
@Test
public void queryAllocOrder() {
QueryAllocOrderParam param = new QueryAllocOrderParam();
param.setAllocationNo("DEVA240602000243630000101");
param.setClientIp("127.0.0.1");
DaxPayResult<AllocOrderModel> execute = DaxPayKit.execute(param);
System.out.println(JSONUtil.toJsonStr(execute));
}
}