Skip to content

受理商家转账

发起商家转账接口。商户可以通过该接口同时向多个已经确认预约的用户进行转账操作。

请求参数类型描述
jsonobject声明请求的JSON数据结构
sub_mchidstring二级商户号
sp_appidstring服务商AppID
sub_appidstring二级商户AppID
out_batch_nostring商家批次单号
batch_namestring批次名称
batch_remarkstring批次备注
total_amountnumber转账总金额
total_numnumber转账总笔数
transfer_scene_idstring转账场景ID
transfer_detail_listobject[]转账明细列表
out_detail_nostring商家明细单号
transfer_amountnumber转账金额
transfer_remarkstring转账备注
reservation_idstring微信转账预约单号
openidstring收款用户OpenID
notify_urlstring商户回调地址
php
$instance->v3->platsolution->mchTransfer->batches->apply->postAsync([
  'json' => [
    'sub_mchid'            => '1900001109',
    'sp_appid'             => 'wxf636efh567hg4356',
    'sub_appid'            => 'wxf636efh567hg4356',
    'out_batch_no'         => 'sjzz20230223',
    'batch_name'           => '2023年2月深圳分部报销单',
    'batch_remark'         => '2023年2月深圳分部报销单',
    'total_amount'         => 4000000,
    'total_num'            => 200,
    'transfer_scene_id'    => '1000',
    'transfer_detail_list' => [[
      'out_detail_no'   => 'x23zy545Bd5436',
      'transfer_amount' => 200000,
      'transfer_remark' => '2023年2月报销',
      'reservation_id'  => '1330000071100999991182020050700019480001',
      'openid'          => 'o-MYE42l80oelYMDE34nYD456Xoy',
    ],],
    'notify_url'           => 'https://www.weixin.qq.com/wxpay/pay.php',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/platsolution/mch-transfer/batches/apply')->postAsync([
  'json' => [
    'sub_mchid'            => '1900001109',
    'sp_appid'             => 'wxf636efh567hg4356',
    'sub_appid'            => 'wxf636efh567hg4356',
    'out_batch_no'         => 'sjzz20230223',
    'batch_name'           => '2023年2月深圳分部报销单',
    'batch_remark'         => '2023年2月深圳分部报销单',
    'total_amount'         => 4000000,
    'total_num'            => 200,
    'transfer_scene_id'    => '1000',
    'transfer_detail_list' => [[
      'out_detail_no'   => 'x23zy545Bd5436',
      'transfer_amount' => 200000,
      'transfer_remark' => '2023年2月报销',
      'reservation_id'  => '1330000071100999991182020050700019480001',
      'openid'          => 'o-MYE42l80oelYMDE34nYD456Xoy',
    ],],
    'notify_url'           => 'https://www.weixin.qq.com/wxpay/pay.php',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/platsolution/mch-transfer/batches/apply']->postAsync([
  'json' => [
    'sub_mchid'            => '1900001109',
    'sp_appid'             => 'wxf636efh567hg4356',
    'sub_appid'            => 'wxf636efh567hg4356',
    'out_batch_no'         => 'sjzz20230223',
    'batch_name'           => '2023年2月深圳分部报销单',
    'batch_remark'         => '2023年2月深圳分部报销单',
    'total_amount'         => 4000000,
    'total_num'            => 200,
    'transfer_scene_id'    => '1000',
    'transfer_detail_list' => [[
      'out_detail_no'   => 'x23zy545Bd5436',
      'transfer_amount' => 200000,
      'transfer_remark' => '2023年2月报销',
      'reservation_id'  => '1330000071100999991182020050700019480001',
      'openid'          => 'o-MYE42l80oelYMDE34nYD456Xoy',
    ],],
    'notify_url'           => 'https://www.weixin.qq.com/wxpay/pay.php',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->platsolution->mchTransfer->batches->apply->post([
  'json' => [
    'sub_mchid'            => '1900001109',
    'sp_appid'             => 'wxf636efh567hg4356',
    'sub_appid'            => 'wxf636efh567hg4356',
    'out_batch_no'         => 'sjzz20230223',
    'batch_name'           => '2023年2月深圳分部报销单',
    'batch_remark'         => '2023年2月深圳分部报销单',
    'total_amount'         => 4000000,
    'total_num'            => 200,
    'transfer_scene_id'    => '1000',
    'transfer_detail_list' => [[
      'out_detail_no'   => 'x23zy545Bd5436',
      'transfer_amount' => 200000,
      'transfer_remark' => '2023年2月报销',
      'reservation_id'  => '1330000071100999991182020050700019480001',
      'openid'          => 'o-MYE42l80oelYMDE34nYD456Xoy',
    ],],
    'notify_url'           => 'https://www.weixin.qq.com/wxpay/pay.php',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/platsolution/mch-transfer/batches/apply')->post([
  'json' => [
    'sub_mchid'            => '1900001109',
    'sp_appid'             => 'wxf636efh567hg4356',
    'sub_appid'            => 'wxf636efh567hg4356',
    'out_batch_no'         => 'sjzz20230223',
    'batch_name'           => '2023年2月深圳分部报销单',
    'batch_remark'         => '2023年2月深圳分部报销单',
    'total_amount'         => 4000000,
    'total_num'            => 200,
    'transfer_scene_id'    => '1000',
    'transfer_detail_list' => [[
      'out_detail_no'   => 'x23zy545Bd5436',
      'transfer_amount' => 200000,
      'transfer_remark' => '2023年2月报销',
      'reservation_id'  => '1330000071100999991182020050700019480001',
      'openid'          => 'o-MYE42l80oelYMDE34nYD456Xoy',
    ],],
    'notify_url'           => 'https://www.weixin.qq.com/wxpay/pay.php',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/platsolution/mch-transfer/batches/apply']->post([
  'json' => [
    'sub_mchid'            => '1900001109',
    'sp_appid'             => 'wxf636efh567hg4356',
    'sub_appid'            => 'wxf636efh567hg4356',
    'out_batch_no'         => 'sjzz20230223',
    'batch_name'           => '2023年2月深圳分部报销单',
    'batch_remark'         => '2023年2月深圳分部报销单',
    'total_amount'         => 4000000,
    'total_num'            => 200,
    'transfer_scene_id'    => '1000',
    'transfer_detail_list' => [[
      'out_detail_no'   => 'x23zy545Bd5436',
      'transfer_amount' => 200000,
      'transfer_remark' => '2023年2月报销',
      'reservation_id'  => '1330000071100999991182020050700019480001',
      'openid'          => 'o-MYE42l80oelYMDE34nYD456Xoy',
    ],],
    'notify_url'           => 'https://www.weixin.qq.com/wxpay/pay.php',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
out_batch_nostring商家批次单号
batch_idstring商家转账批次单号
create_timestring批次创建时间
batch_statestring批次状态

参阅 官方文档

Published on the GitHub by TheNorthMemory