下载对账单
商户可以通过该接口下载历史交易清单。比如掉单、系统错误等导致商户侧和微信侧数据不一致,通过对账单核对后可校正支付状态。
请求参数 | 类型 | 描述 |
---|---|---|
base_uri | string | 声明接入点https://api.mch.weixin.qq.com/hk/ (国内接入) |
query | object | 声明请求的查询参数 |
date | string | 账单日期 |
mchid | string | 商户号 |
headers | object | 声明请求的头参数 |
Accept-Encoding | string | 账单压缩:如需对账单进行压缩,设置HTTP请求头值为gzip |
php
$savedTo = \GuzzleHttp\Psr7\Utils::tryFopen('./somehowfile.csv.gz', 'w+');
$stream = \GuzzleHttp\Psr7\Utils::streamFor($savedTo);
$instance->v3->statements->getAsync([
'base_uri' => 'https://api.mch.weixin.qq.com/hk/', // 接入点(国内接入)
'sink' => $stream,
'query' => [
'date' => '20180130',
'mchid' => '1900000109',
],
'headers' => [
'Accept-Encoding' => 'gzip',
],
])
->wait();
php
$savedTo = \GuzzleHttp\Psr7\Utils::tryFopen('./somehowfile.csv.gz', 'w+');
$stream = \GuzzleHttp\Psr7\Utils::streamFor($savedTo);
$instance->chain('v3/statements')->getAsync([
'base_uri' => 'https://api.mch.weixin.qq.com/hk/', // 接入点(国内接入)
'sink' => $stream,
'query' => [
'date' => '20180130',
'mchid' => '1900000109',
],
'headers' => [
'Accept-Encoding' => 'gzip',
],
])
->wait();
php
$savedTo = \GuzzleHttp\Psr7\Utils::tryFopen('./somehowfile.csv.gz', 'w+');
$stream = \GuzzleHttp\Psr7\Utils::streamFor($savedTo);
$instance['v3/statements']->getAsync([
'base_uri' => 'https://api.mch.weixin.qq.com/hk/', // 接入点(国内接入)
'sink' => $stream,
'query' => [
'date' => '20180130',
'mchid' => '1900000109',
],
'headers' => [
'Accept-Encoding' => 'gzip',
],
])
->wait();
php
$savedTo = \GuzzleHttp\Psr7\Utils::tryFopen('./somehowfile.csv.gz', 'w+');
$stream = \GuzzleHttp\Psr7\Utils::streamFor($savedTo);
$response = $instance->v3->statements->get([
'base_uri' => 'https://api.mch.weixin.qq.com/hk/', // 接入点(国内接入)
'sink' => $stream,
'query' => [
'date' => '20180130',
'mchid' => '1900000109',
],
'headers' => [
'Accept-Encoding' => 'gzip',
],
]);
php
$savedTo = \GuzzleHttp\Psr7\Utils::tryFopen('./somehowfile.csv.gz', 'w+');
$stream = \GuzzleHttp\Psr7\Utils::streamFor($savedTo);
$response = $instance->chain('v3/statements')->get([
'base_uri' => 'https://api.mch.weixin.qq.com/hk/', // 接入点(国内接入)
'sink' => $stream,
'query' => [
'date' => '20180130',
'mchid' => '1900000109',
],
'headers' => [
'Accept-Encoding' => 'gzip',
],
]);
php
$savedTo = \GuzzleHttp\Psr7\Utils::tryFopen('./somehowfile.csv.gz', 'w+');
$stream = \GuzzleHttp\Psr7\Utils::streamFor($savedTo);
$response = $instance['v3/statements']->get([
'base_uri' => 'https://api.mch.weixin.qq.com/hk/', // 接入点(国内接入)
'sink' => $stream,
'query' => [
'date' => '20180130',
'mchid' => '1900000109',
],
'headers' => [
'Accept-Encoding' => 'gzip',
],
]);
返回字典 | 类型 | 描述 |
---|---|---|
文件流(需解析为对应数据) |
参阅 官方文档