Skip to content

预约扣费

商户在进行委托代扣费前,需要提前在微信支付系统中预约扣费,预约成功后方可在约定时间内扣费。

请求参数类型描述
contract_idstring委托代扣协议ID
jsonobject声明请求的JSON数据结构
sp_appidstring应用ID
sub_mchidstring子商户号商户号
sub_appidstring子商户的AppID
schedule_amountobject预约的金额信息
totalnumber金额
currencystring货币类型
php
$instance->v3->papay->pay->partner->schedules->contractId->_contract_id_->schedule->postAsync([
  'contract_id' => '123124412412423431',
  'json' => [
    'sp_appid'        => 'wxd678efh567hg6787',
    'sub_mchid'       => '1900000109',
    'sub_appid'       => 'wxd678efh567hg6787',
    'schedule_amount' => [
      'total'    => 1,
      'currency' => 'CNY',
    ],
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/papay/pay/partner/schedules/contract-id/{contract_id}/schedule')->postAsync([
  'contract_id' => '123124412412423431',
  'json' => [
    'sp_appid'        => 'wxd678efh567hg6787',
    'sub_mchid'       => '1900000109',
    'sub_appid'       => 'wxd678efh567hg6787',
    'schedule_amount' => [
      'total'    => 1,
      'currency' => 'CNY',
    ],
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/papay/pay/partner/schedules/contract-id/{contract_id}/schedule']->postAsync([
  'contract_id' => '123124412412423431',
  'json' => [
    'sp_appid'        => 'wxd678efh567hg6787',
    'sub_mchid'       => '1900000109',
    'sub_appid'       => 'wxd678efh567hg6787',
    'schedule_amount' => [
      'total'    => 1,
      'currency' => 'CNY',
    ],
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->papay->pay->partner->schedules->contractId->_contract_id_->schedule->post([
  'contract_id' => '123124412412423431',
  'json' => [
    'sp_appid'        => 'wxd678efh567hg6787',
    'sub_mchid'       => '1900000109',
    'sub_appid'       => 'wxd678efh567hg6787',
    'schedule_amount' => [
      'total'    => 1,
      'currency' => 'CNY',
    ],
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/papay/pay/partner/schedules/contract-id/{contract_id}/schedule')->post([
  'contract_id' => '123124412412423431',
  'json' => [
    'sp_appid'        => 'wxd678efh567hg6787',
    'sub_mchid'       => '1900000109',
    'sub_appid'       => 'wxd678efh567hg6787',
    'schedule_amount' => [
      'total'    => 1,
      'currency' => 'CNY',
    ],
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/papay/pay/partner/schedules/contract-id/{contract_id}/schedule']->post([
  'contract_id' => '123124412412423431',
  'json' => [
    'sp_appid'        => 'wxd678efh567hg6787',
    'sub_mchid'       => '1900000109',
    'sub_appid'       => 'wxd678efh567hg6787',
    'schedule_amount' => [
      'total'    => 1,
      'currency' => 'CNY',
    ],
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
schedule_statestring扣费预约的状态
deduct_start_datestring可扣费开始日期
deduct_end_datestring可扣费结束日期
scheduled_amountobject已预约的扣费金额信息
totalnumber金额
currencystring货币类型
deduct_amountobject实际扣费金额
totalnumber金额
currencystring货币类型
deduct_datestring实际扣费的日期

参阅 官方文档

Published on the GitHub by TheNorthMemory