Skip to content

查询签约关系

查询签约关系接口提供单笔签约关系查询。注意:查询签约关系可通过下面两种方式查询:方式一:使用微信返回的委托代扣协议contract_id进行查询。方式二:plan_id+contract_code模式:传入模板id和签约协议号进行查询。两种查询方式返回结果相同。

请求参数类型描述
noncelesstrue声明请求的XML无随机字符串参数
xmlobject声明请求的XML数据结构
appidstring请求appid
mch_idinteger商户号
contract_idstring委托代扣协议id
plan_idinteger模板id
contract_codestring签约协议号
versionstring版本号
1.0 枚举值
php
$instance->v2->papay->querycontract->postAsync([
  'nonceless' => true,
  'xml' => [
    'appid'         => 'wxcbda96de0b165486',
    'mch_id'        => '10000098',
    'contract_id'   => '100005698',
    'plan_id'       => '123',
    'contract_code' => '1023658866',
    'version'       => '1.0',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();
php
$instance->chain('v2/papay/querycontract')->postAsync([
  'nonceless' => true,
  'xml' => [
    'appid'         => 'wxcbda96de0b165486',
    'mch_id'        => '10000098',
    'contract_id'   => '100005698',
    'plan_id'       => '123',
    'contract_code' => '1023658866',
    'version'       => '1.0',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();
php
$instance['v2/papay/querycontract']->postAsync([
  'nonceless' => true,
  'xml' => [
    'appid'         => 'wxcbda96de0b165486',
    'mch_id'        => '10000098',
    'contract_id'   => '100005698',
    'plan_id'       => '123',
    'contract_code' => '1023658866',
    'version'       => '1.0',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();
php
$response = $instance->v2->papay->querycontract->post([
  'nonceless' => true,
  'xml' => [
    'appid'         => 'wxcbda96de0b165486',
    'mch_id'        => '10000098',
    'contract_id'   => '100005698',
    'plan_id'       => '123',
    'contract_code' => '1023658866',
    'version'       => '1.0',
  ],
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
php
$response = $instance->chain('v2/papay/querycontract')->post([
  'nonceless' => true,
  'xml' => [
    'appid'         => 'wxcbda96de0b165486',
    'mch_id'        => '10000098',
    'contract_id'   => '100005698',
    'plan_id'       => '123',
    'contract_code' => '1023658866',
    'version'       => '1.0',
  ],
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
php
$response = $instance['v2/papay/querycontract']->post([
  'nonceless' => true,
  'xml' => [
    'appid'         => 'wxcbda96de0b165486',
    'mch_id'        => '10000098',
    'contract_id'   => '100005698',
    'plan_id'       => '123',
    'contract_code' => '1023658866',
    'version'       => '1.0',
  ],
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
返回字典类型描述
return_codestring返回状态码
SUCCESS | FAIL 枚举值之一
return_msgstring返回信息
result_codestring业务结果
SUCCESS | FAIL 枚举值之一
mch_idinteger商户号
appidstring公众账号id
contract_idstring委托代扣协议id
plan_idinteger模板id
contract_codestring签约协议号
contract_display_accountstring用户账户展示名称
contract_stateinteger协议状态
contract_signed_timestring协议签署时间
contract_expired_timestring协议到期时间
contract_terminated_timestring协议解约时间
contract_termination_modeinteger协议解约方式
signstring签名
contract_termination_remarkstring解约备注
openidstring用户标识
err_codestring错误代码
err_code_desstring错误代码描述

参阅 官方文档

Published on the GitHub by TheNorthMemory