Login expired. Please log in again.

Feedback

0/300

Feedback

Submitted successfully

ok

Feedback

Network exception, please try again later

ok

Onboarding Sub Merchant(For HK)

Access Guide
API Rules
Parameter Specifications
Public API
Onboarding Sub-merchant
Query Sub-merchant
Sub Merchant Modifying
Help Center
Contact Us

Sub Merchant Modifying API

Latest update time:2020.12.04 Release notes


This api is used to update the existing information of sub merchants


API intro

Request URL: https://api.mch.weixin.qq.com/hk/v3/merchants

Request method: PUT

Applicable object:Institutional mode

API Rules: https://wechatpay-api.gitbook.io/wechatpay-api-v3


path This parameter needs to be set at the request URL

query This parameter needs to be set at the JSON for request body

Request Parameters

Name Variable Name Type Required Description
Official Account ID sp_appid string(32) Yes query Official Account ID assigned by WeChat
Note:The value of this field cannot be modified
Example:wxd678efh567hg6787
Vendor ID sp_mchid string(32) Yes query Specifies vendor ID assigned by WeChat Payment
Note:The value of this field cannot be modified
Example:1230000109
Merchant name name string(128) Yes query Specifies the complete merchant entity name
Note:The value of this field cannot be modified
Example:Fruit Store
Sub-merchant ID sub_mchid string(32) Yes query Sub-merchant ID
Note:The value of this field cannot be modified
Example:20000100
Merchant shortname shortname string(64) Yes query Specifies the brief merchant name, which will be shown to the consumers
Example:FS
Customer Service Phone Number. office_phone string(32) Yes query Specifies the customer service phone number, which will be shown in the payment details page for the consumers.
Please prefix the phone number. See the appendix for prefixes.
Example:+86075586010000
+ Contact information contact object Yes query Contact information object details is listed below
Field Name ID Type Required Description
Full Name name string(64) Yes Specifies the contact person’s name.
Example:Bob Zhang
Mobile Phone No. phone string(32) Yes Specifies the mobile phone number of the merchant for any urgent issues. Please prefix the phone number. See the appendix for prefixes.
Example:+8613633334444
Email email string(256) Yes Specifies the contact email of the merchant.
Example:test@test.com
Business category business_category int Yes query Specifies the business category, please refer to the business ID list of WeChat payment. see to Business Category
Example:101
Channel number channel_id string(20) No query The channel number created by the institution in the WeChat merchant management backend. Fill in the channel number (if any).
Example:3200000001
Registered Country or Region merchant_country_code string(3) Yes query The country where the submerchant was registered ,see to CountryCode
Example:344
Merchant Type merchant_type string(10) Yes query ENTERPRISE or INDIVIDUAL
Example:ENTERPRISE
Registration Certificate Number registration_certificate_number string(50) Yes/No query Company registration document No. Required when Merchant Type is ENTERPRISE. Not required when Merchant Type is INDIVIDUAL
Example:5555-8888
Expiration Date of Registration Certificate registration_certificate_date string(14) Yes/No query The expiration date of the company registration document.
The value should be expire date or “PERMANENT” , “N/A”, the date format should YYYY-MM-DD , such as 2020-10-16. Required when Merchant Type is ENTERPRISE. Not required when Merchant Type is INDIVIDUAL
Example:2020-10-16
Copy of Registration Certificate registration_certificate_copy string(128) No query The photocopy of the company registration document.
The value should be the media ID returned by Uploading Image API.
Example:DsWXok2NqRliv2SDL42QoEmHIPs
Settlement Bank No. settlement_bank_number string(128) No query Settlement bank account number (settlement bank information)
Example:555588889999
+ Business information business object Yes query Business information, the detail is listed below
Field Name ID Type Required Description
Business type business_type string(7) Yes There are three business types:ONLINE,
OFFLINE or BOTH
Example:BOTH
Download link of APP app_download string(128) Yes/No The download link of merchant’s APP. app_download, bus_website,office_account, mini_program choose one field to submit if business type is ONLINE or BOTH
Example:https://download.qq.com
Business website website string(128) Yes/No The business website, app_download, bus_website,office_account, mini_program choose one field to submit if business type is ONLINE or BOTH
Example:https://www.qq.com
Official account office_account string(128) Yes/No Merchant’s official account. app_download, bus_website,office_account, mini_program choose one field to submit if business type is ONLINE or BOTH
Example:wx8888888888888888
Mini Program mini_program string(128) Yes/No Merchant’s mini program. app_download, bus_website,office_account, mini_program choose one field to submit if business type is ONLINE or BOTH
Example:wx8888888888888888
Store address store_address string(128) Yes/No Store address, required if business type is OFFLINE or BOTH
Example:10F World Finance Centre (South Office), 11 Canton Road, Tsim Sha Tsui, Hong Kong
Store photos store_photos string(1024) No

Store photos, required once business type is OFFLINE or BOTH. The value should be at least 3 media IDs, which is returned by Uploading Image API.
Multiple images are submitted in JSON format. Required if business type is OFFLINE or BOTH(Not mandatory)
Example:[Media_id1, Media_id2, Media_id3]

MCC mcc string(4) Yes Mcc code, see to Merchant category codes
Example:4214
+ Director information director object No query Director information,
Specify this field only when the Merchant Type is ENTERPRISE (Not mandatory)
The detail is listed below
Field Name ID Type Required Description
Director Name name string(128) No Director name. Specify this field only when the Merchant Type is ENTERPRISE (Not mandatory).
Example:Bob
Director ID Number number string(128) No Director's ID number. Specify this field only when the Merchant Type is ENTERPRISE (Not mandatory)
Example:5555-8888
+ Principal information principal object No query Principal information,
Specify this field only when the Merchant Type is INDIVIDUAL (Not mandatory)
The detail is listed below
Field Name ID Type Required Description
Principal Name name string(128) No Principal's ID number. Specify this field only when the Merchant Type is INDIVIDUAL (Not mandatory)
Example:Bob
Principal ID Number number string(128) No Principal's ID number. Specify this field only when the Merchant Type is INDIVIDUAL (Not mandatory)
Example:5555-8888

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.


For example:


{
    "sp_appid": "wx82ec4jy334ner1", 
    "sp_mchid": "2422128905",   
    "name": "testname", 
	"sub_mchid": "20000100",
    "shortname": "shortname", 
    "office_phone": "13680534111", 
    "contact": {
        "email": "gP32/1QSaIpKlaFbWgP3hr8W3+YTtiavMRbOJJ6dATymJzxx/b4YPOTKdeRApW6Nt2ZZB9reZ1x45XhIEF/Ztb6mqfFVb6LxpJlHgDL/zpUG51551XQ3Ww+/kVCJcokiIiT1bSwEcCe6tPL2cmdsOEjlTikyrasLc1bG8vaG/i361r0vX9w56O2Mgv3OnJ4fr4xnmxNcVrJnk1f/gBSIiCUWA0163f3LM4KifQelEuz/WtroeKAzRDiI0/pOvXfwrYDK==", 
        "name": "Vxjsrod2RT2aGxeI5i+Z2C4arXYGXZuwE8IrRf6uYu6S5dy4Igw7kjvYWYCNfsgcdXyfjdA4KVntbgSa3zic+ERsOd5u+SNKkaFSH3SwYtpcCyaUMvICTw/6AOY/qy+He9la/gxObgi4zkxvLJmZTJVualTVJWWCIvcuDArW8Kfqp8rBl+IxDEgCojoEmqE7ymVReslGBXWiaPS1UsZx1QJyez3/ijzBa4AKch3XuPx6d3qvM+J8iMx/b94LAfpTihU/j==", 
        "phone": "l8JH2dAGLNJ8P5DENoMV0eW4JgIquV2ZO4conHnZp48g/eVpgvIfMj4Ge6LRVENW4eZksErJnYCQB+EOFEGR0lMhA1LexPLu0en08iM2ghkftYWAsOD4JPkvvc36SAfWal29eoZh4maO6kOGW7G4uBua6JoMsEjR6uuw5Gw5DC2eikcdkDBGk9vHSP/oxRs3Qu8a83GikhLgdpAPitXbZX/TEPG5SUg8Fx4BCMCKOfxy8uakq2/EeCtyBMjaiheUePoA=="
    }, 
    "business_category": 343, 
    "merchant_country_code": "344", 
    "merchant_type": "ENTERPRISE", 
    "registration_certificate_number": "519723407213085723", 
    "registration_certificate_date": "2022-06-03", 
    "settlement_bank_number": "559304578245298347923856", 
    "business": {
        "business_type": "ONLINE", 
        "mcc": "5344", 
        "mini_program": "flowerplus"
    }, 
    "director": {
        "name": "Tom", 
        "number": "1234567890"
    }
}
    
{
JAVA示例代码
}
    

Returned Result

Response for failed request:

Name Variable Name Type Required Description
Returned status code code string(32) Yes Error code. See the error code list for the enumerated values.
Example:INVALID_REQUEST
Returned message message string(256) Yes Returned message. It indicates the reason for the error if not empty.
Example:Parameter format verification error
+ Detailed error description detail object No It is returned when code is PARAM_ERROR. Details will be described below.
Name Variable Name Type Required Description
Location of the incorrect parameter field string(256) Yes If the incorrect parameter is in the JSON for request body,it is populated with the JSON Pointer pointing to the parameter is entered;
If the incorrect parameter is in the request URL or querystring, it is populated with the variable name of the parameter.
Example:#/properties/payer
Value of the incorrect parameter value string(256) Yes Value of the incorrect parameter
Example:1346177081915535577
Cause of error issue string(256) Yes Cause of error
Example:It is different from ALLOF schema
Location of the incorrect parameter location string(256) No body:The incorrect parameter is in the JSON for request body
url:The incorrect parameter is in the request URL
query:The incorrect parameter is in the querystring of the request
Example:body

Response for successful request:

Name Variable Name Type Required Description
Sub-merchant ID sub_mchid string(32) Yes Sub-merchant ID assigned by WeChat Pay
Note:Only forInstitutional mode
Example:1900000109

For example::

{
    "sub_mchid": "20000100"
}
{
"code":"INVALID_REQUEST",
"message":"Parameter format verification error",
"detail":{
    "field":"#/properties/payer",
    "value":"1346177081915535577",
    "issue":"It is different from ALLOF schema",
    "location":"body"
   }
}

Error Codes

PARAM_ERROR 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.


Release notes

close
V1.0
2020.12.25
1.Sub Merchant Modifying API released online

About  WeChat  Pay

Powered By Tencent & Tenpay Copyright©

2005-2024 Tenpay All Rights Reserved.

Contact Us
Wechat Pay Global

WeChat Pay Global