Skip to content

申请交易账单

微信支付按天提供交易账单文件,商户可以通过该接口获取账单文件的下载地址。文件内包含交易相关的金额、时间、营销等信息,供商户核对订单、退款、银行到账等情况。

请求参数类型描述
queryobject声明请求的查询参数
bill_datestring账单日期
sub_mchidstring二级商户号
bill_typestring账单类型
ALL | SUCCESS | REFUND | RECHARGE_REFUND | ALL_SPECIAL | SUC_SPECIAL | REF_SPECIAL 枚举值之一
tar_typestring压缩类型
GZIP 枚举值
php
$instance->v3->bill->tradebill->getAsync([
  'query' => [
    'bill_date' => '2019-06-11',
    'sub_mchid' => '19000000001',
    'bill_type' => 'ALL',
    'tar_type'  => 'GZIP',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/bill/tradebill')->getAsync([
  'query' => [
    'bill_date' => '2019-06-11',
    'sub_mchid' => '19000000001',
    'bill_type' => 'ALL',
    'tar_type'  => 'GZIP',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/bill/tradebill']->getAsync([
  'query' => [
    'bill_date' => '2019-06-11',
    'sub_mchid' => '19000000001',
    'bill_type' => 'ALL',
    'tar_type'  => 'GZIP',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->bill->tradebill->get([
  'query' => [
    'bill_date' => '2019-06-11',
    'sub_mchid' => '19000000001',
    'bill_type' => 'ALL',
    'tar_type'  => 'GZIP',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/bill/tradebill')->get([
  'query' => [
    'bill_date' => '2019-06-11',
    'sub_mchid' => '19000000001',
    'bill_type' => 'ALL',
    'tar_type'  => 'GZIP',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/bill/tradebill']->get([
  'query' => [
    'bill_date' => '2019-06-11',
    'sub_mchid' => '19000000001',
    'bill_type' => 'ALL',
    'tar_type'  => 'GZIP',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
hash_typestring哈希类型
hash_valuestring哈希值
download_urlstring账单下载地址

参阅 官方文档 官方文档 官方文档 官方文档 官方文档 官方文档 官方文档 官方文档 官方文档 官方文档 官方文档 官方文档 官方文档 官方文档 官方文档 官方文档 官方文档 官方文档 官方文档 官方文档 官方文档 官方文档 官方文档 官方文档 官方文档 官方文档 官方文档

Published on the GitHub by TheNorthMemory