Skip to content

发起批量转账

服务商可以通过该接口,批量向用户零钱或务工卡进行转账操作。

请求参数类型描述
jsonobject声明请求的JSON数据结构
platform_mchidstring服务平台商户号
specialized_payment_mchidstring付款企业商户号
sponsor_mchidstring实际出资商户号
user_authorized_mchidstring用户授权商户号
user_authorized_appidstring用户授权appid
out_batch_nostring银行批次单号
batch_namestring批次名称
batch_remarkstring批次备注
attach_remarkstring附加信息
total_amountinteger转账总金额
total_countinteger转账总笔数
transfer_scenestring转账场景
transfer_purposestring批量转账用途
transfer_detail_listobject[]转账明细列表
out_detail_nostring银行明细单号
transfer_amountinteger转账金额
transfer_remarkstring转账备注
openidstring收款用户openid
user_namestring收款用户姓名
user_id_cardstring收款用户身份证
headersobject声明请求的头参数
Wechatpay-Serialstring平台公钥ID/平台公钥证书序列号
php
$instance->v3->bankTransfer->batches->postAsync([
  'json' => [
    'platform_mchid'            => '1900001109',
    'specialized_payment_mchid' => '1900001109',
    'sponsor_mchid'             => '1900001109',
    'user_authorized_mchid'     => '1900001109',
    'user_authorized_appid'     => 'wxaffdakkk11112e3',
    'out_batch_no'              => 'plfk2020042013',
    'batch_name'                => '2019年1月深圳分部报销单',
    'batch_remark'              => '2019年1月深圳分部报销单',
    'attach_remark'             => '付款专用商户单号11111',
    'total_amount'              => 4000000,
    'total_count'               => 200,
    'transfer_scene'            => 'ORDINARY_TRANSFER',
    'transfer_purpose'          => 'COMMISSION',
    'transfer_detail_list'      => [[
      'out_detail_no'   => 'x23zy545Bd5436',
      'transfer_amount' => 200000,
      'transfer_remark' => '2020年4月报销',
      'openid'          => 'o-MYE42l80oelYMDE34nYD456Xoy',
      'user_name'       => '757b340b45ebef5467rter35gf464344v3542sdf4t6re4tb4f54ty45t4yyry45',
      'user_id_card'    => '8609cb22e1774a50a930e414cc71eca06121bcd266335cda230d24a7886a8d9f',
    ],],
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/bank-transfer/batches')->postAsync([
  'json' => [
    'platform_mchid'            => '1900001109',
    'specialized_payment_mchid' => '1900001109',
    'sponsor_mchid'             => '1900001109',
    'user_authorized_mchid'     => '1900001109',
    'user_authorized_appid'     => 'wxaffdakkk11112e3',
    'out_batch_no'              => 'plfk2020042013',
    'batch_name'                => '2019年1月深圳分部报销单',
    'batch_remark'              => '2019年1月深圳分部报销单',
    'attach_remark'             => '付款专用商户单号11111',
    'total_amount'              => 4000000,
    'total_count'               => 200,
    'transfer_scene'            => 'ORDINARY_TRANSFER',
    'transfer_purpose'          => 'COMMISSION',
    'transfer_detail_list'      => [[
      'out_detail_no'   => 'x23zy545Bd5436',
      'transfer_amount' => 200000,
      'transfer_remark' => '2020年4月报销',
      'openid'          => 'o-MYE42l80oelYMDE34nYD456Xoy',
      'user_name'       => '757b340b45ebef5467rter35gf464344v3542sdf4t6re4tb4f54ty45t4yyry45',
      'user_id_card'    => '8609cb22e1774a50a930e414cc71eca06121bcd266335cda230d24a7886a8d9f',
    ],],
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/bank-transfer/batches']->postAsync([
  'json' => [
    'platform_mchid'            => '1900001109',
    'specialized_payment_mchid' => '1900001109',
    'sponsor_mchid'             => '1900001109',
    'user_authorized_mchid'     => '1900001109',
    'user_authorized_appid'     => 'wxaffdakkk11112e3',
    'out_batch_no'              => 'plfk2020042013',
    'batch_name'                => '2019年1月深圳分部报销单',
    'batch_remark'              => '2019年1月深圳分部报销单',
    'attach_remark'             => '付款专用商户单号11111',
    'total_amount'              => 4000000,
    'total_count'               => 200,
    'transfer_scene'            => 'ORDINARY_TRANSFER',
    'transfer_purpose'          => 'COMMISSION',
    'transfer_detail_list'      => [[
      'out_detail_no'   => 'x23zy545Bd5436',
      'transfer_amount' => 200000,
      'transfer_remark' => '2020年4月报销',
      'openid'          => 'o-MYE42l80oelYMDE34nYD456Xoy',
      'user_name'       => '757b340b45ebef5467rter35gf464344v3542sdf4t6re4tb4f54ty45t4yyry45',
      'user_id_card'    => '8609cb22e1774a50a930e414cc71eca06121bcd266335cda230d24a7886a8d9f',
    ],],
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->bankTransfer->batches->post([
  'json' => [
    'platform_mchid'            => '1900001109',
    'specialized_payment_mchid' => '1900001109',
    'sponsor_mchid'             => '1900001109',
    'user_authorized_mchid'     => '1900001109',
    'user_authorized_appid'     => 'wxaffdakkk11112e3',
    'out_batch_no'              => 'plfk2020042013',
    'batch_name'                => '2019年1月深圳分部报销单',
    'batch_remark'              => '2019年1月深圳分部报销单',
    'attach_remark'             => '付款专用商户单号11111',
    'total_amount'              => 4000000,
    'total_count'               => 200,
    'transfer_scene'            => 'ORDINARY_TRANSFER',
    'transfer_purpose'          => 'COMMISSION',
    'transfer_detail_list'      => [[
      'out_detail_no'   => 'x23zy545Bd5436',
      'transfer_amount' => 200000,
      'transfer_remark' => '2020年4月报销',
      'openid'          => 'o-MYE42l80oelYMDE34nYD456Xoy',
      'user_name'       => '757b340b45ebef5467rter35gf464344v3542sdf4t6re4tb4f54ty45t4yyry45',
      'user_id_card'    => '8609cb22e1774a50a930e414cc71eca06121bcd266335cda230d24a7886a8d9f',
    ],],
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/bank-transfer/batches')->post([
  'json' => [
    'platform_mchid'            => '1900001109',
    'specialized_payment_mchid' => '1900001109',
    'sponsor_mchid'             => '1900001109',
    'user_authorized_mchid'     => '1900001109',
    'user_authorized_appid'     => 'wxaffdakkk11112e3',
    'out_batch_no'              => 'plfk2020042013',
    'batch_name'                => '2019年1月深圳分部报销单',
    'batch_remark'              => '2019年1月深圳分部报销单',
    'attach_remark'             => '付款专用商户单号11111',
    'total_amount'              => 4000000,
    'total_count'               => 200,
    'transfer_scene'            => 'ORDINARY_TRANSFER',
    'transfer_purpose'          => 'COMMISSION',
    'transfer_detail_list'      => [[
      'out_detail_no'   => 'x23zy545Bd5436',
      'transfer_amount' => 200000,
      'transfer_remark' => '2020年4月报销',
      'openid'          => 'o-MYE42l80oelYMDE34nYD456Xoy',
      'user_name'       => '757b340b45ebef5467rter35gf464344v3542sdf4t6re4tb4f54ty45t4yyry45',
      'user_id_card'    => '8609cb22e1774a50a930e414cc71eca06121bcd266335cda230d24a7886a8d9f',
    ],],
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/bank-transfer/batches']->post([
  'json' => [
    'platform_mchid'            => '1900001109',
    'specialized_payment_mchid' => '1900001109',
    'sponsor_mchid'             => '1900001109',
    'user_authorized_mchid'     => '1900001109',
    'user_authorized_appid'     => 'wxaffdakkk11112e3',
    'out_batch_no'              => 'plfk2020042013',
    'batch_name'                => '2019年1月深圳分部报销单',
    'batch_remark'              => '2019年1月深圳分部报销单',
    'attach_remark'             => '付款专用商户单号11111',
    'total_amount'              => 4000000,
    'total_count'               => 200,
    'transfer_scene'            => 'ORDINARY_TRANSFER',
    'transfer_purpose'          => 'COMMISSION',
    'transfer_detail_list'      => [[
      'out_detail_no'   => 'x23zy545Bd5436',
      'transfer_amount' => 200000,
      'transfer_remark' => '2020年4月报销',
      'openid'          => 'o-MYE42l80oelYMDE34nYD456Xoy',
      'user_name'       => '757b340b45ebef5467rter35gf464344v3542sdf4t6re4tb4f54ty45t4yyry45',
      'user_id_card'    => '8609cb22e1774a50a930e414cc71eca06121bcd266335cda230d24a7886a8d9f',
    ],],
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
out_batch_nostring银行批次单号
batch_idstring微信支付批次单号
create_timestring批次创建时间

参阅 官方文档

Published on the GitHub by TheNorthMemory