Skip to content

分账订单查询接口

提示

用于分账订单创建后,可以通过该接口主动查询订单状态,完成下一步的业务逻辑。

接口说明

参数说明
请求URL/unipay/query/allocationOrder
请求方式POST
请求类型application/json

请求参数

字段名变量名必填类型示例值描述
分账号allocationNoString321753370980523384832分账号与商户分账号不可以同时为空,同时传输是以分账号为准
商户分账号bizAllocationNoString100A0001分账号与商户分账号不可以同时为空,同时传输是以分账号为准
用户IPclientIpString64127.0.0.1支持Ipv4和Ipv6,部分支付通道要求必填,如调用微信支付时
随机数nonceStrString32d112892e382a7093
签名值signString64072695d112892e382a7093b81e6a52af
请求时间reqTimeLong123123121使用时间戳(秒级)

响应结果

提示

业务数据包裹在公共响应参数中的data字段,在code0时才会有返回数据。

分账订单

字段名变量名必传类型示例值描述
分账单号allocationNoString1753370980523384832系统生成的分账号
商户分账单号bizAllocationNoString1753370980523384832商户生成的分账号
通道分账号outAllocationNoString1753370980523384832三方支付系统的分账号
支付订单号orderNoString1753370980523384832系统生成的订单号
商户支付订单号bizOrderNoStringP0001商户传输的订单号
通道支付订单号outOrderNoString22212137757334130130三方支付系统返回的交易号
支付订单标题titleString测试支付
所属通道autoAllocationStringwechat_pay
分账描述descriptionStringqrcode
总分账金额amountint20
分账状态statusStringprogress
处理结果resultStringprogress
完成时间finishTimeLong114454145使用时间戳(秒级)
分账明细detailsAllocOrderDetailModel[]见下方分账明细
错误码(订单)errorCodeInteger0与状态码(公共)不同,这里返回的是支付订单的错误状态
错误信息(订单)errorCodeString未启用分账与错误信息(公共),这里返回的是支付订单的错误信息提示
签名signString072695d112892e382a7093b81e6a52af
状态码(公共)codeInteger0为0表示成功,非0表示失败
错误信息(公共)msgString关闭失败状态非0时会有返回值
响应时间(公共)resTimeLong123123121服务返回请求的时间,时间戳(秒级)

分账明细

字段名变量名必传类型示例值描述
分账接收方编号receiverNoString1753370980523384832系统生成的分账号
分账金额amountInteger
分账比例rateInteger万分之多少
分账接收方类型receiverTypeString
接收方账号receiverAccountString
接收方姓名receiverNameString
分账结果resultString
状态码errorCodeInteger0
错误信息errorMsgString

错误码

状态码名称备注
0成功成功

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));
    }

}
本文档内容版权属于济南易杯光年软件技术有限公司