Skip to content

通过用户标识查询签约

商户通过用户标识+签约模板号来查询用户签约信息,只返回用户在该签约模板下的有效签约(一个签约模板仅会存在一个有效签约);若用户未与该签约模板签约,返回明确错误码

请求参数类型描述
openidstring服务商APPID下的用户标识
queryobject声明请求的查询参数
appidstring服务商APPID
sub_mchidstring子商户号
sub_appidstring子商户APPID
sub_openidstring子商户APPID下的用户标识
plan_idstring签约模板号
contract_statusstring签约状态
ADD | DELETE 枚举值之一
offsetinteger分页页码
limitinteger分页大小
php
$instance->v3->eduPapay->user->_openid_->contracts->getAsync([
  'openid' => 'oUpF8uMuAJOM2pxb1Q',
  'query' => [
    'appid' => 'wx8888888888888888',
    'sub_mchid' => '1900000109',
    'sub_appid' => 'wx8888888888888888',
    'sub_openid' => 'oUpF8uMuAJOM2pxb1Q',
    'plan_id' => '101164396123311331',
    'contract_status' => 'ADD',
    'offset' => 0,
    'limit' => 20,
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/edu-papay/user/{openid}/contracts')->getAsync([
  'openid' => 'oUpF8uMuAJOM2pxb1Q',
  'query' => [
    'appid' => 'wx8888888888888888',
    'sub_mchid' => '1900000109',
    'sub_appid' => 'wx8888888888888888',
    'sub_openid' => 'oUpF8uMuAJOM2pxb1Q',
    'plan_id' => '101164396123311331',
    'contract_status' => 'ADD',
    'offset' => 0,
    'limit' => 20,
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/edu-papay/user/{openid}/contracts']->getAsync([
  'openid' => 'oUpF8uMuAJOM2pxb1Q',
  'query' => [
    'appid' => 'wx8888888888888888',
    'sub_mchid' => '1900000109',
    'sub_appid' => 'wx8888888888888888',
    'sub_openid' => 'oUpF8uMuAJOM2pxb1Q',
    'plan_id' => '101164396123311331',
    'contract_status' => 'ADD',
    'offset' => 0,
    'limit' => 20,
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->eduPapay->user->_openid_->contracts->get([
  'openid' => 'oUpF8uMuAJOM2pxb1Q',
  'query' => [
    'appid' => 'wx8888888888888888',
    'sub_mchid' => '1900000109',
    'sub_appid' => 'wx8888888888888888',
    'sub_openid' => 'oUpF8uMuAJOM2pxb1Q',
    'plan_id' => '101164396123311331',
    'contract_status' => 'ADD',
    'offset' => 0,
    'limit' => 20,
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/edu-papay/user/{openid}/contracts')->get([
  'openid' => 'oUpF8uMuAJOM2pxb1Q',
  'query' => [
    'appid' => 'wx8888888888888888',
    'sub_mchid' => '1900000109',
    'sub_appid' => 'wx8888888888888888',
    'sub_openid' => 'oUpF8uMuAJOM2pxb1Q',
    'plan_id' => '101164396123311331',
    'contract_status' => 'ADD',
    'offset' => 0,
    'limit' => 20,
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/edu-papay/user/{openid}/contracts']->get([
  'openid' => 'oUpF8uMuAJOM2pxb1Q',
  'query' => [
    'appid' => 'wx8888888888888888',
    'sub_mchid' => '1900000109',
    'sub_appid' => 'wx8888888888888888',
    'sub_openid' => 'oUpF8uMuAJOM2pxb1Q',
    'plan_id' => '101164396123311331',
    'contract_status' => 'ADD',
    'offset' => 0,
    'limit' => 20,
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
dataobject[]结果集
sp_mchidstring服务商商户号
appidstring服务商APPID
sub_mchidstring子商户号
sub_appidstring子商户APPID
openidstring服务商APPID下的用户标识
sub_openidstring子商户APPID下的用户标识
plan_idstring签约模板号
contract_informationobject签约信息
contract_idstring签约协议号
contract_statusstring签约状态
create_timestring签约时间
total_countinteger总数量
offsetinteger分页页码
limitinteger分页大小

参阅 官方文档

Published on the GitHub by TheNorthMemory