查询用户签约列表
商户使用本接口来查询用户签约信息,返回用户在该签约模板下的合约列表(包括处于「已解约」状态下的合约);被用户主动删除的合约无法被查询到。结果中「已签约」合约排列于「已解约」合约之前。
请求参数 | 类型 | 描述 |
---|---|---|
openid | string | 商户appid下的用户标识 |
query | object | 声明请求的查询参数 |
plan_id | string | 签约模板号 |
contract_status | string | 签约状态 |
offset | integer | 分页页码 |
limit | integer | 分页大小 |
php
$instance->v3->eduschoolpay->users->_openid_->contracts->getAsync([
'openid' => 'oUpF8uMuAJOM2pxb1Q',
'query' => [
'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/eduschoolpay/users/{openid}/contracts')->getAsync([
'openid' => 'oUpF8uMuAJOM2pxb1Q',
'query' => [
'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/eduschoolpay/users/{openid}/contracts']->getAsync([
'openid' => 'oUpF8uMuAJOM2pxb1Q',
'query' => [
'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->eduschoolpay->users->_openid_->contracts->get([
'openid' => 'oUpF8uMuAJOM2pxb1Q',
'query' => [
'plan_id' => '101164396123311331',
'contract_status' => 'ADD',
'offset' => 0,
'limit' => 20,
],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/eduschoolpay/users/{openid}/contracts')->get([
'openid' => 'oUpF8uMuAJOM2pxb1Q',
'query' => [
'plan_id' => '101164396123311331',
'contract_status' => 'ADD',
'offset' => 0,
'limit' => 20,
],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/eduschoolpay/users/{openid}/contracts']->get([
'openid' => 'oUpF8uMuAJOM2pxb1Q',
'query' => [
'plan_id' => '101164396123311331',
'contract_status' => 'ADD',
'offset' => 0,
'limit' => 20,
],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典 | 类型 | 描述 |
---|---|---|
data | object[] | 查询结果列表 |
contract_id | string | 签约协议号 |
mchid | string | 商户号 |
appid | string | 商户appid |
openid | string | 商户appid下的用户标识 |
plan_id | string | 签约模板号 |
contract_status | string | 签约状态 |
create_time | string | 签约时间 |
out_contract_code | string | 外部签约号 |
offset | integer | 请求资源起始位置 |
limit | integer | 最大资源条数 |
total_count | integer | 资源总条数 |
links | object | 相关链接 |
next | string | 下一页链接 |
prev | string | 上一页链接 |
self | string | 当前链接 |
参阅 官方文档