Modify Sub-merchant
Update Time:2025.01.07The institution submits the sub-merchant information, and the WeChat Pay system creates a Sub-merchant ID for each sub-merchant.
|
1. API Intro
Applicable object: Institutional mode
Request URL:https://apihk.mch.weixin.qq.com/v3/global/merchants/{sub_mchid}
Request method:PATCH
Path parameter is a path parameter.
Query parameter needs to be passed in the request URL.
Body parameter needs to be passed in the request JSON.
2. Request Parameters
Name | Variable Name | Type | Required | Description | |||
---|---|---|---|---|---|---|---|
Official Account ID | sp_appid | string[1,32] | Yes | Body Official Account ID assigned by WeChat | |||
Vendor ID | sp_mchid | string[1,32] | Yes | Body Specifies vendor ID assigned by WeChat Payment | |||
Merchant name | name | string[1,128] | Yes | Body Specifies the complete merchant entity name | |||
Sub-merchant ID | sub_mchid | string[1,32] | Yes | path Sub-merchant ID | |||
Merchant shortname | shortname | string[1,64] | Yes | Body Specifies the brief merchant name, which will be shown to the consumers | |||
Customer Service Phone Number. | office_phone | string[1,32] | Yes | Body Specifies the customer service phone number, which will be shown in the payment details page for the consumers. | |||
Contact information | contact | object | Yes | Body Contact information object details is listed below | |||
| |||||||
Business category | business_category | int | Yes | Body Specifies the business category, please refer to the business ID list of WeChat payment. see to Business Category | |||
Channel number | channel_id | string[1,20] | No | Body The channel number created by the institution in the WeChat merchant management backend. Fill in the channel number (if any). | |||
Registered Country or Region | merchant_country_code | string[1,3] | Yes | Body The country where the submerchant was registered ,see to CountryCode | |||
Merchant Type | merchant_type | string[1,10] | Yes | Body ENTERPRISE or INDIVIDUAL | |||
Registration Certificate Number | registration_certificate_number | string[1,50] | Yes | Body Company registration document No. Required when Merchant Type is ENTERPRISE. | |||
Expiration Date of Registration Certificate | registration_certificate_date | string[1,14] | Yes | Body The expiration date of the company registration document. | |||
Copy of Registration Certificate | registration_certificate_copy | string[1,128] | No | Body The photocopy of the company registration document. | |||
Settlement Bank No. | settlement_bank_number | string[1,128] | No | Body Settlement bank account number (settlement bank information) | |||
Business information | business | object | Yes | Body Business information, the detail is listed below | |||
| |||||||
Director information | director | object | No | Body Director information, | |||
| |||||||
Principal information | principal | object | No | Body Principal information, | |||
| |||||||
Apply for H5 payment authorization | apply_h5_payment | boolean | No | Apply for H5 payment authorization? The values are true or false. | |||
H5 payment application info | h5_payment_apply_info | object | Yes/No | Body H5 payment application info. | |||
|
Note on sensitive field encryption:
For parameters that contain sensitive information, such as contact information, a "field encryption" security mechanism is provided to make sure that the sensitive information can only be seen by the data recipient.
Encryption procedures
1、Obtain the WeChat Pay platform certificate and its serial number. For more information, see 5.7 Downloading Platform Certificate. The platform certificate serial number is required to be passed for "Wechatpay-Serial" of the http header of this API request.
2、Perform the RSA encryption for the parameter values with the public key of the WeChat Pay Platform certificate. Use `RSAES-PKCS1-v1_5` as the filling scheme.
3、The encrypted ciphertext that is encoded with base64 is used as the value of the appropriate parameter in the request.
Request Example:
JSON
3. Response Parameters
Response for successful request:
Name | Variable Name | Type | Required | Description |
---|---|---|---|---|
Sub-merchant ID | sub_mchid | string[1,32] | Yes | Sub-merchant ID assigned by WeChat Pay |
H5 payment authorization state | h5_authorization_state | string[1,32] | No | Returned when apply_h5_payment is true; describe the H5 payment authorization state of the sub-merchant: |
Response for failed request:
Name | Variable Name | Type | Required | Description | |||
---|---|---|---|---|---|---|---|
Returned status code | code | string[1,32] | Yes | Error code. See the error code list for the enumerated values. | |||
Returned information | message | string[1,256] | Yes | Returned message. It indicates the reason for the error if not empty. | |||
Detailed error description | detail | object | No | It is returned when code is PARAM_ERROR. Details will be described below. | |||
|
Response Example:
SUCCESS
ERROR
Apply H5 Payment Permissions
4. Error Codes
Error Message | Description | Solution |
---|---|---|
PARAM_ERROR | Req paramerror | For the specific parameter format, please see the relevant document. |
SYSTEM_ERROR | System error please try again | System error. Re-initiate with the original parameters. |
INVALID_REQUEST | Invaild request | Check your program according to the detailed description on the error returned by the API. You can view the specific details returned by the detail field. |
INVALID_REQUEST | please add merchant by page | Log in to the merchant management backend to enter the sub-merchant information manually. |
INVALID_REQUEST | business_code already exists | Define a unique identifier for different sub-merchants. |
INVALID_REQUEST | The sub-merchant has not pass the review and cannot be modified. | Please be patient and wait for the approval before submitting again. |
INVALID_REQUEST | Action has been taken against the merchant. The merchant is not allowed to request to enable H5 payment authorization. | Merchant payment permission has been penalized. Please contact the operation personnel to lift the penalty first. |
INVALID_REQUEST | The submitted website or H5 payment domain name is at risk. Contact your BD for assistance. | The business website or H5 payment domain is blacklisted. Please contact the operation personnel to apply for an exemption. |