下载账单
本章主要介绍下载账单接口,商户可以通过本接口下载商户三个月内的交易账单。
应用场景
商户在 T+1 日的十二点之后下载 T 日账单,下载日期时区为东八区。如果当日不存在交易成功或退款成功的流水,则不生成对账单。
商户先通过下载账单接口,获取将要下载的对账单 URL、哈希值等信息,然后通过请求获取的 URL,下载指定日期的对账单,通过 URL 下载时不再需要签名。
接口描述
- URL 地址:GET https://api.edgeros.com/pay/v1/transactions/bill。
- 传参方式:query(参数需在请求 URL 传参)。
- 是否需要数字签名:需要,详情请参见 生成数字签名。
请求参数
字段名 | 类型 | 是否必填 | 示例值 | 说明 |
---|---|---|---|---|
bill_date | String(32) | 是 | 2024-04-06 | 账单日期,格式:yyyy-MM-dd,时区:东八区,仅支持三个月内的账单下载申请 |
aco_pay_sdk | String(12) | 否 | 2.0.0 | 翼辉支付 Java SDK 的版本号 |
version | String(3) | 否 | 1.0 | 调用接口版本,固定值 1.0 |
请求示例
https://api.edgeros.com/pay/v1/transactions/bill?bill_date=2024-04-06&aco_pay_sdk=2.0.0&version=1.0
响应参数
字段名 | 类型 | 示例值 | 说明 |
---|---|---|---|
status | int | 200 | 返回状态码 |
message | String(100) | SUCCESS | 返回信息,取值为 SUCCESS 表示调用成功,其余均为调用失败,详情请参见 错误码 |
fieldErrors | String(50) | 格式错误 | 异常信息,当 message 不为 SUCCESS 时,返回具体错误原因 |
data | object | "data": {} | 具体业务返回信息 |
status
为 200
时,data
返回如下字段:
字段名 | 类型 | 示例值 | 说明 |
---|---|---|---|
mch_no | String(32) | ea887713933c42a0bd7e657b06f279d3 | 翼辉支付分配的商户号 |
nonce | String(32) | 5K8264ILTKCH16CQ2502SI8ZNMTM67VS | 随机字符串,长度不大于 32 位 |
sign | String(344) | C380BEC2BFD727A4B6845133519F3AD6 | 签名值,商户需要验证签名,详情请参见 验证数字签名 |
sign_type | String(20) | SHA256withRSA | 签名类型,目前支持 SHA256withRSA |
code | String(20) | SUCCESS | 账单状态码,取值如下:
|
description | String(20) | 成功 | 业务状态代码描述 |
url | String(200) | https://api.edgeros.com/pay/v1/transactions/bill?token=sah282n2j2jn | 下载对账单 URL,只有 code 为 SUCCESS 时有返回值,有效期 40 s ,请求方式:GET |
hash_code | String(200) | 036298c7752a6c0d2d0be244dd63f972 | 账单文件哈希值,只有 code 为 SUCCESS 时有返回值 |
hash_type | String(200) | MD5 | 账单文件哈希算法,只有 code 为 SUCCESS 时有返回值 |
响应示例
正确响应示例
{
"status": 200,
"message": "SUCCESS",
"fieldErrors": null,
"data": {
"mch_no": "ea887713933c42a0bd7e657b06f279d3",
"nonce": "5K8264ILTKCH16CQ2502SI8ZNMTM67VS",
"sign": "C380BEC2BFD727A4B6845133519F3AD6",
"sign_type": "SHA256withRSA",
"code": "SUCCESS",
"description": "成功",
"url": "https://api.edgeros.com/pay/v1/transactions/bill?token=sah282n2j2jn",
"hash_code": "036298c7752a6c0d2d0be244dd63f972",
"hash_type": "MD5"
}
}
{
"status": 200,
"message": "SUCCESS",
"fieldErrors": null,
"data": {
"mch_no": "MCH1000000",
"sign_type": "SHA256withRSA",
"sign": "A3opqa9TkVaE1kBJ9+pKiaoRofp6BQOZskcmqL4Ji6Kvq9udNBDCuUBiIpuORCeTwGAjLvWTGYzNQMQdpm7tDWrsKO1WPrm6Aoy6v3yjKQLPcG1vQpKe+4shPF/p+2/mJLgbmnC6DwF5iqTMmgrA669EWyQYyW5hFJC/ginGBFa0jhn2WtfjCf+5/9AZHdvXxYSgiyHi0oAragqSSppnlSk38Gr7yzihTcPTA3uXCDtpXIZNXQo3/VCArRzS0Cf7xvxj4eFJiBWNnZ3nGeN+god63NfqLZGMw1Rt/XVr4ou41yD/y6jvHVUfGln/GVWd6Ec6lH4wN89tF6mzimpBRw==",
"nonce": "OwCNOZLTiKzJyWVBkB7Yw2L9Yfy3llbl",
"code": "BILL_NOT_EXIST",
"description": "账单不存在",
"url": null,
"hash_code": null,
"hash_type": null
}
}
错误响应示例
{
"status": 1001,
"message": "INVALID_PARAMETER",
"fieldErrors": "格式错误",
"data": {
"mch_no": "MCH1000000",
"sign_type": "SHA256withRSA",
"sign": "MtQ2scdxcVAYCnylZJ1cQ2DYNYMZo5NDbYPIBoRX3EknVvAuYx2HAG9+RL35NeUZvmyu9Gn8VN7eOb13ZJOIkOC/m8RNCFRDB/Y/FXaxaGhl1dUh1QUn7kJksuhZwXahxGVd6spm8y5dzDgrGE2t8MydhZrRKTBdiaWP97ycsudTIj2cVb5Lv7ASgrqUevpn2nzfWF66byk8uEcwcy2g13Ii27dPzdA1X6G/Jx9y6pEoqpv0zHAvU0lbVW/h0yXXfpo32nrDZGfTiTgiLywOO8UKChgvtbgNej3gm6FuX1W6gEJuM6oPVT1A9CJTeHOtq9XByjiRZI4Gxi6TDvpUUQ==",
"nonce": "j26x6NhRDLxtcUHT2Kf5B2c8viAmfIqc"
}
}
下载对账单
通过获取对账单信息接口获取下载对账单 URL,以 GET 请求方式获取对账单。
成功返回示例
CSV 格式文件,示例:
交易时间,商户号,支付应用号,交易类型,支付渠道,交易状态,翼辉支付订单号,商户订单号,支付金额,翼辉支付退款订单号,商户退款订单号,退款金额,手续费,商品描述,备注
2022-01-04T17:14:35+08:00,MCH1000000,APP1000000,PAY,ALI_PAY,SUCCESS,AP20220104171435170432886598631735156,mp202104061059289242066253446422,0.01,,,,0.00,"test pay ","测试"
2022-01-04T17:15:22+08:00,MCH1000000,APP1000000,REFUND,ALI_PAY,SUCCESS,AP20220104171435170432886598631735156,mp202104061059289242066253446422,0.01,AR20220104171522536432886596353678115,MR20220104171522536432886591647705785,0.01,0.00,"test pay ","测试"
2022-01-04T17:16:16+08:00,MCH1000000,APP1000000,PAY,ALI_PAY,SUCCESS,AP20220104171616251432886594780225441,mp202104061130442096637738262638,0.01,,,,0.00,"test pay ","测试"
2022-01-04T17:17:08+08:00,MCH1000000,APP1000000,REFUND,ALI_PAY,SUCCESS,AP20220104171616251432886594780225441,mp202104061130442096637738262638,0.01,AR20220104171708977432886590643572461,MR20220104171708976432886597208264152,0.01,0.00,"test pay ","测试"
2022-01-04T17:21:33+08:00,MCH1000000,APP1000000,PAY,ALI_PAY,SUCCESS,AP20220104172133823432886595111701426,mp202104241700288110071055567331,0.01,,,,0.00,"test pay ","测试"
2022-01-04T17:22:13+08:00,MCH1000000,APP1000000,REFUND,ALI_PAY,SUCCESS,AP20220104172133823432886595111701426,mp202104241700288110071055567331,0.01,AR20220104172213638432886594304354236,MR20220104172213638432886594875767671,0.01,0.00,"test pay ","测试"
2022-01-04T17:25:14+08:00,MCH1000000,APP1000000,PAY,ALI_PAY,SUCCESS,AP20220104172514574432886593431602450,mp202104021606341385640107521832,0.01,,,,0.00,"test pay ","测试"
总笔数,订单总金额,退款总金额,手续费总金额
7,0.04,0.03,0.00
链接失效返回示例
{
"status": 1101,
"message": "INVALID_URL",
"fieldErrors": "账单链接已失效!",
"data": {
"mch_no": null,
"sign_type": null,
"sign": null,
"nonce": "gpahb9kFqhyC7Uoiwoo7Ln5SmncY1DVj"
}
}