Skip to content

查询结算资金明细

商户在交易完结之后,可按结算日期查询已结算资金明细(sette_state为SETTLED),也可以查询未结算资金明细(sette_state为UNSETTLE)。

🔰

本接口服务已于 2022.09.08 (北京时间)发布新版,新接口见这里,此文档仅做留存参考。

请求参数类型描述
base_uristring声明接入点https://api.mch.weixin.qq.com/hk/(国内接入)
queryobject声明请求的查询参数
sub_mchidstring子商户号
settle_statestring结算状态
SETTLED | UNSETTLE 枚举值之一
settle_start_datestring结算开始日期
settle_end_datestring结算结束日期
limitinteger最大记录条数
offsetinteger记录起始位置
php
$instance->v3->settle->settlements->getAsync([
  'base_uri' => 'https://api.mch.weixin.qq.com/hk/', // 接入点(国内接入)
  'query' => [
    'sub_mchid'         => '1900000101',
    'settle_state'      => 'SETTLED',
    'settle_start_date' => '20091225',
    'settle_end_date'   => '20091226',
    'limit'             => 5,
    'offset'            => 10,
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/settle/settlements')->getAsync([
  'base_uri' => 'https://api.mch.weixin.qq.com/hk/', // 接入点(国内接入)
  'query' => [
    'sub_mchid'         => '1900000101',
    'settle_state'      => 'SETTLED',
    'settle_start_date' => '20091225',
    'settle_end_date'   => '20091226',
    'limit'             => 5,
    'offset'            => 10,
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/settle/settlements']->getAsync([
  'base_uri' => 'https://api.mch.weixin.qq.com/hk/', // 接入点(国内接入)
  'query' => [
    'sub_mchid'         => '1900000101',
    'settle_state'      => 'SETTLED',
    'settle_start_date' => '20091225',
    'settle_end_date'   => '20091226',
    'limit'             => 5,
    'offset'            => 10,
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->settle->settlements->get([
  'base_uri' => 'https://api.mch.weixin.qq.com/hk/', // 接入点(国内接入)
  'query' => [
    'sub_mchid'         => '1900000101',
    'settle_state'      => 'SETTLED',
    'settle_start_date' => '20091225',
    'settle_end_date'   => '20091226',
    'limit'             => 5,
    'offset'            => 10,
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/settle/settlements')->get([
  'base_uri' => 'https://api.mch.weixin.qq.com/hk/', // 接入点(国内接入)
  'query' => [
    'sub_mchid'         => '1900000101',
    'settle_state'      => 'SETTLED',
    'settle_start_date' => '20091225',
    'settle_end_date'   => '20091226',
    'limit'             => 5,
    'offset'            => 10,
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/settle/settlements']->get([
  'base_uri' => 'https://api.mch.weixin.qq.com/hk/', // 接入点(国内接入)
  'query' => [
    'sub_mchid'         => '1900000101',
    'settle_state'      => 'SETTLED',
    'settle_start_date' => '20091225',
    'settle_end_date'   => '20091226',
    'limit'             => 5,
    'offset'            => 10,
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
dataobject[]结算信息列表
batch_idstring付款批次号
settlement_datestring结算日期
trade_start_datestring交易开始日期
trade_end_datestring交易结束日期
amountobject金额
settledinteger已结算金额
unsettleinteger未结算金额
currencystring结算币种
payinteger支付金额
refundinteger退款金额
netinteger支付净额
feeinteger手续费金额
wallet_regionstring钱包主体
CHINA_MAINLAND | CHINA_HONGKONG 枚举值之一
total_countinteger总记录条数
offsetinteger记录起始位置
limitinteger本次返回条数

参阅 官方文档

Published on the GitHub by TheNorthMemory