Skip to content

进件子商户

机构提交子商户资料,微信支付系统会为每个子商户创建子商户号。

请求参数类型描述
addinstitutionsubstring固定值addInstitutionsub
xmlobject声明请求的XML数据结构
app_idstring机构appid
mch_idstring机构商户号
channel_idstring渠道编号
merchant_namestring子商户全称
merchant_shortnamestring子商户简称
merchant_remarkstring子商户唯一标识
merchant_country_codestring注册国家或区域
merchant_typestring商户类型
business_categorystring业务类目
mccstringMCC码
registration_certificate_numberstring公司注册文件编号
registration_certificate_datestring公司注册文件过期时间
registration_certificate_copystring公司注册文件照片
business_typestring业务类型
app_downloadstringAPP下载链接
business_websitestring业务网站
office_accountstring公众号
mini_programstring小程序
store_addressstring门店地址
store_photosstring门店照片
director_namestring董事姓名
director_id_numberstring董事证件号码
principal_namestring负责人姓名
principal_id_numberstring负责人证件号
office_phonestring公司电话
contact_namestring联系人姓名
contact_phonestring联系人电话
contact_emailstring联系人邮箱
settlement_bank_numberstring子商户结算银行账户
apply_h5_paymentstring是否申请H5支付权限
YES | NO 枚举值之一
h5_website_urlstringH5经营网址
h5_domainsstringH5支付域名
noncelessboolean声明请求的XML无随机字符串参数
固定值true
securityboolean声明加载商户API证书
固定值true
php
$instance->v2->secapi->mch->_addinstitutionsub_->postAsync([
  'addinstitutionsub' => 'addInstitutionsub', // 固定参数(URI上有大写字符)
  'xml' => [
    'app_id' => 'wx8888888888888888',
    'mch_id' => '3200000001',
    'channel_id' => '101',
    'merchant_name' => 'Merchantname',
    'merchant_shortname' => 'Merchantshortname',
    'merchant_remark' => 'ABC123456',
    'merchant_country_code' => '344',
    'merchant_type' => 'ENTERPRISE',
    'business_category' => '343',
    'mcc' => '4214',
    'registration_certificate_number' => '5555-8888',
    'registration_certificate_date' => '2020-10-16',
    'registration_certificate_copy' => 'aoGhHuxkrIaqB4GzPCeo963zXKcO2hDVD8AjXIpgrj',
    'business_type' => 'BOTH',
    'app_download' => 'https://download.qq.com',
    'business_website' => 'https://www.qq.com',
    'office_account' => 'wx8888888888888888',
    'mini_program' => 'wx8888888888888888',
    'store_address' => '广东省深圳市南山区科技中一道10000号',
    'store_photos' => '["ySdrxMVb92Rmf9p2n7aJ4nAkJsqjYAt8uWQxBQ_p2Jgs","ySdVr5RR9cPRAq5FS0BKJxc78190x27psCzAwNzi6VdEI","yS2xjJ9lhuVwUyQbq0AYmP80p50vVuhdSjsKM"]',
    'director_name' => 'BobZhang',
    'director_id_number' => '5555—8888',
    'principal_name' => 'BobZhang',
    'principal_id_number' => '5555—8888',
    'office_phone' => '075586010000',
    'contact_name' => '李先生',
    'contact_phone' => '075586010000',
    'contact_email' => 'test@test.com',
    'settlement_bank_number' => '555588889999',
    'apply_h5_payment' => 'YES',
    'h5_website_url' => 'https://qq.com',
    'h5_domains' => '["www.qq.com","www.weixin.com"]',
  ],
  'nonceless' => true,
  'security' => true,
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();
php
$instance->chain('v2/secapi/mch/{addinstitutionsub}')->postAsync([
  'addinstitutionsub' => 'addInstitutionsub', // 固定参数(URI上有大写字符)
  'xml' => [
    'app_id' => 'wx8888888888888888',
    'mch_id' => '3200000001',
    'channel_id' => '101',
    'merchant_name' => 'Merchantname',
    'merchant_shortname' => 'Merchantshortname',
    'merchant_remark' => 'ABC123456',
    'merchant_country_code' => '344',
    'merchant_type' => 'ENTERPRISE',
    'business_category' => '343',
    'mcc' => '4214',
    'registration_certificate_number' => '5555-8888',
    'registration_certificate_date' => '2020-10-16',
    'registration_certificate_copy' => 'aoGhHuxkrIaqB4GzPCeo963zXKcO2hDVD8AjXIpgrj',
    'business_type' => 'BOTH',
    'app_download' => 'https://download.qq.com',
    'business_website' => 'https://www.qq.com',
    'office_account' => 'wx8888888888888888',
    'mini_program' => 'wx8888888888888888',
    'store_address' => '广东省深圳市南山区科技中一道10000号',
    'store_photos' => '["ySdrxMVb92Rmf9p2n7aJ4nAkJsqjYAt8uWQxBQ_p2Jgs","ySdVr5RR9cPRAq5FS0BKJxc78190x27psCzAwNzi6VdEI","yS2xjJ9lhuVwUyQbq0AYmP80p50vVuhdSjsKM"]',
    'director_name' => 'BobZhang',
    'director_id_number' => '5555—8888',
    'principal_name' => 'BobZhang',
    'principal_id_number' => '5555—8888',
    'office_phone' => '075586010000',
    'contact_name' => '李先生',
    'contact_phone' => '075586010000',
    'contact_email' => 'test@test.com',
    'settlement_bank_number' => '555588889999',
    'apply_h5_payment' => 'YES',
    'h5_website_url' => 'https://qq.com',
    'h5_domains' => '["www.qq.com","www.weixin.com"]',
  ],
  'nonceless' => true,
  'security' => true,
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();
php
$instance['v2/secapi/mch/{addinstitutionsub}']->postAsync([
  'addinstitutionsub' => 'addInstitutionsub', // 固定参数(URI上有大写字符)
  'xml' => [
    'app_id' => 'wx8888888888888888',
    'mch_id' => '3200000001',
    'channel_id' => '101',
    'merchant_name' => 'Merchantname',
    'merchant_shortname' => 'Merchantshortname',
    'merchant_remark' => 'ABC123456',
    'merchant_country_code' => '344',
    'merchant_type' => 'ENTERPRISE',
    'business_category' => '343',
    'mcc' => '4214',
    'registration_certificate_number' => '5555-8888',
    'registration_certificate_date' => '2020-10-16',
    'registration_certificate_copy' => 'aoGhHuxkrIaqB4GzPCeo963zXKcO2hDVD8AjXIpgrj',
    'business_type' => 'BOTH',
    'app_download' => 'https://download.qq.com',
    'business_website' => 'https://www.qq.com',
    'office_account' => 'wx8888888888888888',
    'mini_program' => 'wx8888888888888888',
    'store_address' => '广东省深圳市南山区科技中一道10000号',
    'store_photos' => '["ySdrxMVb92Rmf9p2n7aJ4nAkJsqjYAt8uWQxBQ_p2Jgs","ySdVr5RR9cPRAq5FS0BKJxc78190x27psCzAwNzi6VdEI","yS2xjJ9lhuVwUyQbq0AYmP80p50vVuhdSjsKM"]',
    'director_name' => 'BobZhang',
    'director_id_number' => '5555—8888',
    'principal_name' => 'BobZhang',
    'principal_id_number' => '5555—8888',
    'office_phone' => '075586010000',
    'contact_name' => '李先生',
    'contact_phone' => '075586010000',
    'contact_email' => 'test@test.com',
    'settlement_bank_number' => '555588889999',
    'apply_h5_payment' => 'YES',
    'h5_website_url' => 'https://qq.com',
    'h5_domains' => '["www.qq.com","www.weixin.com"]',
  ],
  'nonceless' => true,
  'security' => true,
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();
php
$response = $instance->v2->secapi->mch->_addinstitutionsub_->post([
  'addinstitutionsub' => 'addInstitutionsub', // 固定参数(URI上有大写字符)
  'xml' => [
    'app_id' => 'wx8888888888888888',
    'mch_id' => '3200000001',
    'channel_id' => '101',
    'merchant_name' => 'Merchantname',
    'merchant_shortname' => 'Merchantshortname',
    'merchant_remark' => 'ABC123456',
    'merchant_country_code' => '344',
    'merchant_type' => 'ENTERPRISE',
    'business_category' => '343',
    'mcc' => '4214',
    'registration_certificate_number' => '5555-8888',
    'registration_certificate_date' => '2020-10-16',
    'registration_certificate_copy' => 'aoGhHuxkrIaqB4GzPCeo963zXKcO2hDVD8AjXIpgrj',
    'business_type' => 'BOTH',
    'app_download' => 'https://download.qq.com',
    'business_website' => 'https://www.qq.com',
    'office_account' => 'wx8888888888888888',
    'mini_program' => 'wx8888888888888888',
    'store_address' => '广东省深圳市南山区科技中一道10000号',
    'store_photos' => '["ySdrxMVb92Rmf9p2n7aJ4nAkJsqjYAt8uWQxBQ_p2Jgs","ySdVr5RR9cPRAq5FS0BKJxc78190x27psCzAwNzi6VdEI","yS2xjJ9lhuVwUyQbq0AYmP80p50vVuhdSjsKM"]',
    'director_name' => 'BobZhang',
    'director_id_number' => '5555—8888',
    'principal_name' => 'BobZhang',
    'principal_id_number' => '5555—8888',
    'office_phone' => '075586010000',
    'contact_name' => '李先生',
    'contact_phone' => '075586010000',
    'contact_email' => 'test@test.com',
    'settlement_bank_number' => '555588889999',
    'apply_h5_payment' => 'YES',
    'h5_website_url' => 'https://qq.com',
    'h5_domains' => '["www.qq.com","www.weixin.com"]',
  ],
  'nonceless' => true,
  'security' => true,
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
php
$response = $instance->chain('v2/secapi/mch/{addinstitutionsub}')->post([
  'addinstitutionsub' => 'addInstitutionsub', // 固定参数(URI上有大写字符)
  'xml' => [
    'app_id' => 'wx8888888888888888',
    'mch_id' => '3200000001',
    'channel_id' => '101',
    'merchant_name' => 'Merchantname',
    'merchant_shortname' => 'Merchantshortname',
    'merchant_remark' => 'ABC123456',
    'merchant_country_code' => '344',
    'merchant_type' => 'ENTERPRISE',
    'business_category' => '343',
    'mcc' => '4214',
    'registration_certificate_number' => '5555-8888',
    'registration_certificate_date' => '2020-10-16',
    'registration_certificate_copy' => 'aoGhHuxkrIaqB4GzPCeo963zXKcO2hDVD8AjXIpgrj',
    'business_type' => 'BOTH',
    'app_download' => 'https://download.qq.com',
    'business_website' => 'https://www.qq.com',
    'office_account' => 'wx8888888888888888',
    'mini_program' => 'wx8888888888888888',
    'store_address' => '广东省深圳市南山区科技中一道10000号',
    'store_photos' => '["ySdrxMVb92Rmf9p2n7aJ4nAkJsqjYAt8uWQxBQ_p2Jgs","ySdVr5RR9cPRAq5FS0BKJxc78190x27psCzAwNzi6VdEI","yS2xjJ9lhuVwUyQbq0AYmP80p50vVuhdSjsKM"]',
    'director_name' => 'BobZhang',
    'director_id_number' => '5555—8888',
    'principal_name' => 'BobZhang',
    'principal_id_number' => '5555—8888',
    'office_phone' => '075586010000',
    'contact_name' => '李先生',
    'contact_phone' => '075586010000',
    'contact_email' => 'test@test.com',
    'settlement_bank_number' => '555588889999',
    'apply_h5_payment' => 'YES',
    'h5_website_url' => 'https://qq.com',
    'h5_domains' => '["www.qq.com","www.weixin.com"]',
  ],
  'nonceless' => true,
  'security' => true,
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
php
$response = $instance['v2/secapi/mch/{addinstitutionsub}']->post([
  'addinstitutionsub' => 'addInstitutionsub', // 固定参数(URI上有大写字符)
  'xml' => [
    'app_id' => 'wx8888888888888888',
    'mch_id' => '3200000001',
    'channel_id' => '101',
    'merchant_name' => 'Merchantname',
    'merchant_shortname' => 'Merchantshortname',
    'merchant_remark' => 'ABC123456',
    'merchant_country_code' => '344',
    'merchant_type' => 'ENTERPRISE',
    'business_category' => '343',
    'mcc' => '4214',
    'registration_certificate_number' => '5555-8888',
    'registration_certificate_date' => '2020-10-16',
    'registration_certificate_copy' => 'aoGhHuxkrIaqB4GzPCeo963zXKcO2hDVD8AjXIpgrj',
    'business_type' => 'BOTH',
    'app_download' => 'https://download.qq.com',
    'business_website' => 'https://www.qq.com',
    'office_account' => 'wx8888888888888888',
    'mini_program' => 'wx8888888888888888',
    'store_address' => '广东省深圳市南山区科技中一道10000号',
    'store_photos' => '["ySdrxMVb92Rmf9p2n7aJ4nAkJsqjYAt8uWQxBQ_p2Jgs","ySdVr5RR9cPRAq5FS0BKJxc78190x27psCzAwNzi6VdEI","yS2xjJ9lhuVwUyQbq0AYmP80p50vVuhdSjsKM"]',
    'director_name' => 'BobZhang',
    'director_id_number' => '5555—8888',
    'principal_name' => 'BobZhang',
    'principal_id_number' => '5555—8888',
    'office_phone' => '075586010000',
    'contact_name' => '李先生',
    'contact_phone' => '075586010000',
    'contact_email' => 'test@test.com',
    'settlement_bank_number' => '555588889999',
    'apply_h5_payment' => 'YES',
    'h5_website_url' => 'https://qq.com',
    'h5_domains' => '["www.qq.com","www.weixin.com"]',
  ],
  'nonceless' => true,
  'security' => true,
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
返回字典类型描述
return_codestring返回状态码
return_msgstring返回信息
result_codestring业务返回码
err_codestring错误编码
err_code_desstring错误描述
sub_mch_idstring子商户号
signstring签名
verification_statusstring验证状态
descriptionstring验证状态描述
h5_authorization_statestringH5支付权限状态
APPROVED | UNAUTHORIZED | UNDER_REVIEW | REJECTED | UNDER_PUNISHMENT | APPLICATION_FAILED 枚举值之一

参阅 官方文档

Published on the GitHub by TheNorthMemory