Skip to content

代扣协议ID查询签约

查询签约关系接口提供单笔签约关系查询, 查询方式:使用微信返回的委托代扣协议contract_id进行查询。

请求参数类型描述
base_uristring声明接入点https://apihk.mch.weixin.qq.com/(香港接入)
contract_idstring委托代扣协议ID
queryobject声明请求的查询参数
appidstring机构APPID
sub_mchidstring子商户号
sp_appidstring机构appid
sp_mchidstring机构商户号
sub_appidstring子商户应用ID
plan_idinteger模板ID
php
$instance->v3->global->papay->contracts->_contract_id_->getAsync([
  'base_uri' => 'https://apihk.mch.weixin.qq.com/', // 接入点(香港接入)
  'contract_id' => '100005698',
  'query' => [
    'appid'     => 'wxd678efh567hg6787',
    'sub_mchid' => '1230000109',
    'sp_appid'  => 'wx8888888888888888',
    'sp_mchid'  => '3200000001',
    'sub_appid' => 'wxcbda96de0b165484',
    'plan_id'   => 123,
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/global/papay/contracts/{contract_id}')->getAsync([
  'base_uri' => 'https://apihk.mch.weixin.qq.com/', // 接入点(香港接入)
  'contract_id' => '100005698',
  'query' => [
    'appid'     => 'wxd678efh567hg6787',
    'sub_mchid' => '1230000109',
    'sp_appid'  => 'wx8888888888888888',
    'sp_mchid'  => '3200000001',
    'sub_appid' => 'wxcbda96de0b165484',
    'plan_id'   => 123,
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/global/papay/contracts/{contract_id}']->getAsync([
  'base_uri' => 'https://apihk.mch.weixin.qq.com/', // 接入点(香港接入)
  'contract_id' => '100005698',
  'query' => [
    'appid'     => 'wxd678efh567hg6787',
    'sub_mchid' => '1230000109',
    'sp_appid'  => 'wx8888888888888888',
    'sp_mchid'  => '3200000001',
    'sub_appid' => 'wxcbda96de0b165484',
    'plan_id'   => 123,
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->global->papay->contracts->_contract_id_->get([
  'base_uri' => 'https://apihk.mch.weixin.qq.com/', // 接入点(香港接入)
  'contract_id' => '100005698',
  'query' => [
    'appid'     => 'wxd678efh567hg6787',
    'sub_mchid' => '1230000109',
    'sp_appid'  => 'wx8888888888888888',
    'sp_mchid'  => '3200000001',
    'sub_appid' => 'wxcbda96de0b165484',
    'plan_id'   => 123,
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/global/papay/contracts/{contract_id}')->get([
  'base_uri' => 'https://apihk.mch.weixin.qq.com/', // 接入点(香港接入)
  'contract_id' => '100005698',
  'query' => [
    'appid'     => 'wxd678efh567hg6787',
    'sub_mchid' => '1230000109',
    'sp_appid'  => 'wx8888888888888888',
    'sp_mchid'  => '3200000001',
    'sub_appid' => 'wxcbda96de0b165484',
    'plan_id'   => 123,
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/global/papay/contracts/{contract_id}']->get([
  'base_uri' => 'https://apihk.mch.weixin.qq.com/', // 接入点(香港接入)
  'contract_id' => '100005698',
  'query' => [
    'appid'     => 'wxd678efh567hg6787',
    'sub_mchid' => '1230000109',
    'sp_appid'  => 'wx8888888888888888',
    'sp_mchid'  => '3200000001',
    'sub_appid' => 'wxcbda96de0b165484',
    'plan_id'   => 123,
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
mchidstring商户号
appidstring机构APPID
sp_mchidstring机构商户号
sub_mchidstring子商户号
sp_appidstring机构appid
sub_appidstring子商户应用ID
contract_idstring委托代扣协议ID
plan_idinteger模板ID
out_contract_codestring商户侧签约协议号
user_display_namestring用户账户展示名称
statestring协议状态
signed_timestring协议签署时间
terminated_timestring协议签署时间
termination_modestring协议解约方式
termination_notestring解约备注
openidstring商户appid下的用户标识

参阅 官方文档

Published on the GitHub by TheNorthMemory