查询对账单下载地址

名称:alipay.data.dataservice.bill.downloadurl.query
类型:服务端接口
功能:为方便商户快速查账,支持商户通过本接口获取商户离线账单下载地址。

提醒:该接口默认不输出账单,调用前提供商户ID和名称,联系BD进行申请。


注意:接口为通用接口,该场景下,请参考如下编写:

/**
 * 测试
 */
@Test
public void billQuery() throws AlipayApiException {
    AlipayClient alipayClient = new DefaultAlipayClient("https://openapi.alipay.com/gateway.do","app_id","your private_key","json","GBK","alipay_public_key","RSA2");
    AlipayDataDataserviceBillDownloadurlQueryRequest request = new AlipayDataDataserviceBillDownloadurlQueryRequest();
    request.setBizContent("{" +
                        "\"bill_type\":\"trade\"," +
                        "\"bill_date\":\"2018-04-05\"" +
                        "}");
    AlipayDataDataserviceBillDownloadurlQueryResponse response = alipayClient.execute(request);
    if(response.isSuccess()){
        System.out.println("调用成功");
        System.out.println("下载地址:" + response.getBillDownloadUrl());
    } else {
        System.out.println("调用失败");
    }
}


返回结果:

{
    "billDownloadUrl": "http://dwbillcenter.alipay.com/downloadBillFile.resource?bizType=trade&userId=20880315752097830156&fileType=csv.zip&bizDates=20180612&downloadFileName=20880315752097830156_20180612.csv.zip&fileId=%2Ftrade%2F20880315752097830156%2F20180612.csv.zip&timestamp=1529063362&token=6d390c70765bb110ce303d9680e8871a",
    "code": "10000",
    "msg": "Success",
    "body": "{\"alipay_data_dataservice_bill_downloadurl_query_response\":{\"code\":\"10000\",\"msg\":\"Success\",\"bill_download_url\":\"http:\\/\\/dwbillcenter.alipay.com\\/downloadBillFile.resource?bizType=trade&userId=20880315752097830156&fileType=csv.zip&bizDates=20180612&downloadFileName=20880315752097830156_20180612.csv.zip&fileId=%2Ftrade%2F20880315752097830156%2F20180612.csv.zip&timestamp=1529063362&token=6d390c70765bb110ce303d9680e8871a\"},\"sign\":\"bilfAOig2ujJeu7LszKRFPSktd1U1ujAmxFMT9BzATQY0a53CzP8JXqXCLbwR1HocYZd8/Q6sS8As+HeA6BloOdKd7zw0H1RF7KNKYt0BPI45Exc3avKNmJ5RPK0Lnp5LNBFjtE0bCQoMkT04N6uXbmbm686PX/I4Nw26PcIWd6Mj4cm6kght+H1d//T3SeWUnZlC/Fnmyvidvr0BwVe0CWI52tDMzQ5fgaFdAucrVVjy1YxYMSWr1RK/8hSaLQOYtQ7WuGA2WIxrM3++6d9jBPPU9vVBGVKkaXBPDAgNZnADrBEX4EvYIc++s9GZAoPwaZvsqXEBPuJiDg/yyLbpQ==\"}",
    "params": {
        "biz_content": "{\"bill_type\":\"trade\",\"bill_date\":\"2018-06-12\"}"
    }
}


注意:下载地址有效时间为30s,请尽快下载!

onlineServer