Skip to content

下载账单

下载账单API为通用接口,交易/资金账单都可以通过该接口获取到对应的账单。

请求参数类型描述
queryobject声明请求的查询参数
tokenstring前序接口返回的URL.query.token
tartypestring前序接口返回的URL.query.tartype
php
$savedTo = \GuzzleHttp\Psr7\Utils::tryFopen('./somehowfile.csv.gz', 'w+');
$stream  = \GuzzleHttp\Psr7\Utils::streamFor($savedTo);

$instance->v3->billdownload->file->getAsync([
  'sink' => $stream,
  'query' => [
    'token'   => 'dN7J6yDgUzbX8Uk3sD4a4e',
    'tartype' => 'GZIP',
  ],
])
->wait();
php
$savedTo = \GuzzleHttp\Psr7\Utils::tryFopen('./somehowfile.csv.gz', 'w+');
$stream  = \GuzzleHttp\Psr7\Utils::streamFor($savedTo);

$instance->chain('v3/billdownload/file')->getAsync([
  'sink' => $stream,
  'query' => [
    'token'   => 'dN7J6yDgUzbX8Uk3sD4a4e',
    'tartype' => 'GZIP',
  ],
])
->wait();
php
$savedTo = \GuzzleHttp\Psr7\Utils::tryFopen('./somehowfile.csv.gz', 'w+');
$stream  = \GuzzleHttp\Psr7\Utils::streamFor($savedTo);

$instance['v3/billdownload/file']->getAsync([
  'sink' => $stream,
  'query' => [
    'token'   => 'dN7J6yDgUzbX8Uk3sD4a4e',
    'tartype' => 'GZIP',
  ],
])
->wait();
php
$savedTo = \GuzzleHttp\Psr7\Utils::tryFopen('./somehowfile.csv.gz', 'w+');
$stream  = \GuzzleHttp\Psr7\Utils::streamFor($savedTo);

$instance->v3->billdownload->file->get([
  'sink' => $stream,
  'query' => [
    'token'   => 'dN7J6yDgUzbX8Uk3sD4a4e',
    'tartype' => 'GZIP',
  ],
]);
php
$savedTo = \GuzzleHttp\Psr7\Utils::tryFopen('./somehowfile.csv.gz', 'w+');
$stream  = \GuzzleHttp\Psr7\Utils::streamFor($savedTo);

$instance->chain('v3/billdownload/file')->get([
  'sink' => $stream,
  'query' => [
    'token'   => 'dN7J6yDgUzbX8Uk3sD4a4e',
    'tartype' => 'GZIP',
  ],
]);
php
$savedTo = \GuzzleHttp\Psr7\Utils::tryFopen('./somehowfile.csv.gz', 'w+');
$stream  = \GuzzleHttp\Psr7\Utils::streamFor($savedTo);

$instance['v3/billdownload/file']->get([
  'sink' => $stream,
  'query' => [
    'token'   => 'dN7J6yDgUzbX8Uk3sD4a4e',
    'tartype' => 'GZIP',
  ],
]);
返回字典类型描述
文件流(需解析为对应数据)

参阅 官方文档

Published on the GitHub by TheNorthMemory