Skip to content

微工卡核身预下单(流程中完成授权)

本接口适用于用户需同步完成服务开通、授权及身份核验的场景。在拉起微工卡前端服务为用户核身前,需调用本接口预下单,下单成功后才能进行核身。如此时用户未开通微工卡服务或未完成对商户的授权,则先完成开通、授权,同步完成身份核验,并提供可信的核验结果。

请求参数类型描述
jsonobject声明请求的JSON数据结构
openidstring用户标识
appidstring应用ID
sub_mchidstring子商户号
sub_appidstring子商户应用ID
authenticate_numberstring商家核身单号
project_namestring项目名称
employer_namestring用工单位名称
user_namestring用户实名
id_card_numberstring用户证件号
employment_typestring用工类型
LONG_TERM_EMPLOYMENT | SHORT_TERM_EMPLOYMENT | COOPERATION_EMPLOYMENT 枚举值之一
authenticate_typestring核身类型
SIGN_IN | INSURANCE | CONTRACT 枚举值之一
headersobject声明请求的头参数
Wechatpay-Serialstring平台公钥ID/平台公钥证书序列号
php
$instance->v3->payrollCard->authentications->preOrderWithAuth->postAsync([
  'json' => [
    'openid' => 'onqOjjmo8wmTOOtSKwXtGjg9Gb58',
    'appid' => 'wxa1111111',
    'sub_mchid' => '1111111',
    'sub_appid' => 'wxa1111111',
    'authenticate_number' => 'mcdhehfgisdhfjghed39384564i83',
    'project_name' => '某项目',
    'employer_name' => '某用工企业',
    'user_name' => 'LP7bT4hQXUsOZCEvK2YrSiqFsnP0oRMfeoLN0vBg',
    'id_card_number' => '7FzH5XksJG3a8HLLsaaUV6K54y1OnPMY5',
    'employment_type' => 'LONG_TERM_EMPLOYMENT',
    'authenticate_type' => 'SIGN_IN',
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/payroll-card/authentications/pre-order-with-auth')->postAsync([
  'json' => [
    'openid' => 'onqOjjmo8wmTOOtSKwXtGjg9Gb58',
    'appid' => 'wxa1111111',
    'sub_mchid' => '1111111',
    'sub_appid' => 'wxa1111111',
    'authenticate_number' => 'mcdhehfgisdhfjghed39384564i83',
    'project_name' => '某项目',
    'employer_name' => '某用工企业',
    'user_name' => 'LP7bT4hQXUsOZCEvK2YrSiqFsnP0oRMfeoLN0vBg',
    'id_card_number' => '7FzH5XksJG3a8HLLsaaUV6K54y1OnPMY5',
    'employment_type' => 'LONG_TERM_EMPLOYMENT',
    'authenticate_type' => 'SIGN_IN',
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/payroll-card/authentications/pre-order-with-auth']->postAsync([
  'json' => [
    'openid' => 'onqOjjmo8wmTOOtSKwXtGjg9Gb58',
    'appid' => 'wxa1111111',
    'sub_mchid' => '1111111',
    'sub_appid' => 'wxa1111111',
    'authenticate_number' => 'mcdhehfgisdhfjghed39384564i83',
    'project_name' => '某项目',
    'employer_name' => '某用工企业',
    'user_name' => 'LP7bT4hQXUsOZCEvK2YrSiqFsnP0oRMfeoLN0vBg',
    'id_card_number' => '7FzH5XksJG3a8HLLsaaUV6K54y1OnPMY5',
    'employment_type' => 'LONG_TERM_EMPLOYMENT',
    'authenticate_type' => 'SIGN_IN',
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->payrollCard->authentications->preOrderWithAuth->post([
  'json' => [
    'openid' => 'onqOjjmo8wmTOOtSKwXtGjg9Gb58',
    'appid' => 'wxa1111111',
    'sub_mchid' => '1111111',
    'sub_appid' => 'wxa1111111',
    'authenticate_number' => 'mcdhehfgisdhfjghed39384564i83',
    'project_name' => '某项目',
    'employer_name' => '某用工企业',
    'user_name' => 'LP7bT4hQXUsOZCEvK2YrSiqFsnP0oRMfeoLN0vBg',
    'id_card_number' => '7FzH5XksJG3a8HLLsaaUV6K54y1OnPMY5',
    'employment_type' => 'LONG_TERM_EMPLOYMENT',
    'authenticate_type' => 'SIGN_IN',
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/payroll-card/authentications/pre-order-with-auth')->post([
  'json' => [
    'openid' => 'onqOjjmo8wmTOOtSKwXtGjg9Gb58',
    'appid' => 'wxa1111111',
    'sub_mchid' => '1111111',
    'sub_appid' => 'wxa1111111',
    'authenticate_number' => 'mcdhehfgisdhfjghed39384564i83',
    'project_name' => '某项目',
    'employer_name' => '某用工企业',
    'user_name' => 'LP7bT4hQXUsOZCEvK2YrSiqFsnP0oRMfeoLN0vBg',
    'id_card_number' => '7FzH5XksJG3a8HLLsaaUV6K54y1OnPMY5',
    'employment_type' => 'LONG_TERM_EMPLOYMENT',
    'authenticate_type' => 'SIGN_IN',
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/payroll-card/authentications/pre-order-with-auth']->post([
  'json' => [
    'openid' => 'onqOjjmo8wmTOOtSKwXtGjg9Gb58',
    'appid' => 'wxa1111111',
    'sub_mchid' => '1111111',
    'sub_appid' => 'wxa1111111',
    'authenticate_number' => 'mcdhehfgisdhfjghed39384564i83',
    'project_name' => '某项目',
    'employer_name' => '某用工企业',
    'user_name' => 'LP7bT4hQXUsOZCEvK2YrSiqFsnP0oRMfeoLN0vBg',
    'id_card_number' => '7FzH5XksJG3a8HLLsaaUV6K54y1OnPMY5',
    'employment_type' => 'LONG_TERM_EMPLOYMENT',
    'authenticate_type' => 'SIGN_IN',
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
authenticate_numberstring商家核身单号
openidstring用户标识
mchidstring商户号
sub_mchidstring子商户号
tokenstringtoken值
expires_inintegertoken有效时间

参阅 官方文档

Published on the GitHub by TheNorthMemory