# Quickly Creating a Mini Program

This API optimizes the registration and verification processes of Mini Programs, which helps third-party platforms quickly expand the number and service scope of offline merchants to take the preemptive offline commercial opportunities for the Mini Programs. Verification by means of recognition of the legal person's face, rather than such methods as small-amount remittance, is employed to greatly reduce the cost for manually collecting the information on entities and category qualification of Mini Programs. By simply collecting the name of the legal person, the Weixin ID of the legal person, the enterprise name, and the enterprise code, a third-party platform can send a template message to the legal person of the enterprise to collect face information of the legal person. In this way, all registration and verification processes are completed.

Mini Programs created by calling this API are "verified" by default without charging 300-CNY verification fee, which lowers the bar for accessing Mini Programs.

Note: Mini Programs only in offline categories can be created by calling this API. Otherwise, your request will be rejected, and the third party platform's quota of calls to this API will also be reduced. For more information, see "Quickly Create Mini Program" API - Category Reference List.

  1. Prepare permission sets. The third-party platform must have the following permission sets. If any permission set is updated, the changes will not take effect until the third-party platform is approved and released network-wide.
Permission Set Required
Account management permissions Yes
Development management and data analysis permissions Yes
Open Platform account management permissions Yes
Mini Program basic information setup permissions Yes
Mini Program verification permissions Yes
Plug-in management permissions Yes
Nearby locations permissions No (Considering future services, we recommend that you select this option.)
  1. The third-party platform collects merchant information, including the Weixin ID of the legal person, the name of the legal person, the enterprise name, and the enterprise code, as well as the third-party customer service number (recommended) to facilitate the communication between the merchant and the third-party platform.

  2. Ensure that the enterprise name is consistent with that registered with the Administration for Industry and Commerce (AIC), and the name of the legal person is consistent with the name of the bank card linked to Weixin. Otherwise, the API cannot be called successfully.

  3. The platform delivers a template message to the Weixin ID of the legal person to complete legal person ID card verification and the enterprise entity verification. The legal person must click the message within 24 hours to collect the ID card and facial information.

  1. After the required information is collected and the verification is approved, the verified Mini Program can be created. The third-party platform server can receive the AppID of the created Mini Program via "Authorization login related events - Authorization event receipt URL".

  2. After receiving the Mini Program's AppID, the third-party platform can call code development-related APIs to perform subsequent operations during the Mini Program code development.

For more information about the Mini Program·development APIs, see:

<a href="https://open.weixin.qq.com/cgi-bin/showdocument?action=dir_list&t=resource/res_list&verify=1&id=21528465979XX32V&token=&lang=zh_CN"target="_blank">Mini Program Basic Information Setup

<a href="https://open.weixin.qq.com/cgi-bin/showdocument?action=dir_list&t=resource/res_list&verify=1&id=open1489140588_nVUgx&token=&lang=zh_CN"target="_blank">Member Management

<a href="https://open.weixin.qq.com/cgi-bin/showdocument?action=dir_list&t=resource/res_list&verify=1&id=open1489140610_Uavc4&token=&lang=zh_CN"target="_blank">Code Management

<a href="https://open.weixin.qq.com/cgi-bin/showdocument?action=dir_list&t=resource/res_list&verify=1&id=open1506504150_nMMh6&token=&lang=zh_CN"target="_blank">Mini Program Code Template Management

1. Creating a Mini Program

HTTP request method: POST (HTTPS protocol should be used)
https://api.weixin.qq.com/cgi-bin/component/fastregisterweapp?action=create&component_access_token=TOKEN

POST data example:

{
  "name": "tencent", // Enterprise name
  "code": "123", // Enterprise code
  "code_type": 1, // Type of the enterprise code. 1: Unified Social Credit Code; 2: Organization Code; 3: Business License Registration Number.
  "legal_persona_wechat": "123", // Weixin ID of the legal person
  "legal_persona_name": "pony", // Name of the legal person
  "component_phone": "1234567" // Contact number of the third-party platform
}

Parameters:

Parameter Description
name Enterprise name, which must be consistent with that registered with the AIC.
code Enterprise code
code_type Type of the enterprise code. 1: Unified Social Credit Code (18-digit); 2: Organization Code (9-digit in the format of xxxxxxxx-x); 3: Business License Registration Number (15-digit).
legal_persona_wechat Weixin ID of the legal person
legal_persona_name Name of the legal person, which must be the same as the name of the linked bank card.
component_phone Contact number of the third-party platform. It facilitates the communication between the legal person and the third-party platform.

Example of returned result

{
  "errcode": 0, // Error code. 0: Successful; others values: Failed. |
  "errmsg": "OK" // Error message
}

Error codes:

Error Code Description Message
0 Successful ok
-1 Invalid action parameter invalid action
89249 This entity has an ongoing task. Try again 24 hours after the task is complete. task running
89247 Internal error inner error
86004 Invalid Weixin ID invalid wechat
61070 The legal person's name is inconsistent with the Weixin ID. name, wechat name not in accordance
89248 Invalid enterprise code. Select a correct code. invalid code type
89250 This task cannot be found. task not found
89251 The legal person does not complete the face verification. legal person checking
89252 The consistency between the legal person and the enterprise information is being verified. front checking
89253 Required parameters are missing. lack of some params
89254 The third-party permission sets are incomplete. Updated permission sets will take effect after the third-party platform is released to the entire network-wide. lack of some component rights

Note: Logically, creation tasks are sequentially executed. Only after a task is completed can the second task be delivered by using the same information. Avoid task congestion.

2. Querying Creation Task Status

HTTP request method: POST (HTTPS protocol should be used)
https://api.weixin.qq.com/cgi-bin/component/fastregisterweapp?action=search&component_access_token=TOKEN

POST data example:

{
    "name": "tencent",   // Enterprise name
    "legal_persona_wechat": "123",   // Weixin ID of the legal person
    "legal_persona_name":"pony" ,   // Name of the legal person
}

Parameters:

Parameter Description
name Enterprise name
legal_persona_wechat Weixin ID of the legal person
legal_persona_name Name of the legal person, which must be the same as the name of the linked bank card.

Example of returned result

{
    "errcode":0,  // Error code. 0: Successful; others values: Failed. |
    "errmsg":"OK"  // Error message
}

Error codes:

Error Code Description Message
0 Successful ok
-1 Invalid action parameter invalid action
89247 Internal error inner error
89250 This task cannot be found. task not found
89251 The template message has been delivered, but the legal person does not complete the face verification. legal person checking
89252 The consistency between the legal person and the enterprise information is being verified. front checking
89253 Required parameters are missing. lack of some params

Note: This API can be used only to query the execution result of the current task. Do not call this API frequently to query the status of created Mini Programs. You can check and query the status in the third-party platform server.

3. Pushing Registration and Review Events

Data example

<xml>
    <AppId><![CDATA[The third-party platform's appid]]></AppId>
    <CreateTime>1535442403</CreateTime>
    <InfoType><![CDATA[notify_third_fasteregister]]></InfoType>
    <appid>The created Mini Program's appid<appid>
    <status>0</status>
    <auth_code>xxxxxThird-party authorization code </auth_code>
    <msg>OK</msg>
    <info>
    <name><![CDATA[Enterprise name]]></name>
    <code><![CDATA[Enterprise code]]></code>
    <code_type>1</code_type>
    <legal_persona_wechat><![CDATA[Weixin ID of the legal person]]></legal_persona_wechat>
    <legal_persona_name><![CDATA[Name of the legal person]]></legal_persona_name>
    <component_phone><![CDATA[Contact number of the third-party platform]]></component_phone>
    </info>
</xml>

Error Code Description
100001 The delivered template message has not been confirmed by the legal person and has timed out (24 hours), and the legal person ID card verification has not been completed.
100002 The delivered template message has not been confirmed by the legal person and has timed out (24 hours), face verification of the legal person has not been completed.
100003 The delivered template message has not been confirmed by the legal person and has timed out (24 hours).
101 The AIC returns "This enterprise has been deregistered."
102 The AIC returns "This enterprise does not exist or the enterprise information is not updated."
103 The AIC returns "The name of the legal person does not match that in the AIC data."
104 The AIC returns "The ID card number of the legal person does not match that in the AIC data."
105 The ID card number of the legal person has not been updated to the AIC. Try again after 5 to 15 business days.
1000 The AIC returns "The enterprise information or the legal person information is inconsistent with that in the AIC data."
-1 The name of the legal person does not match the enterprise.

Recommendation: The four fields, including the enterprise name, enterprise code, Weixin ID of the legal person, and name of the legal person, requested using the API can uniquely identify each task.

# FAQs

  1. The POST information is incorrect. (1) Check whether an encoding error occurs. Chinese characters do not need to be transcoded. (2) Ensure that the entity information is consistent with that registered with the AIC. For example, note the difference between Guangzhou and Guangzhou City. You can check the registered information in National Enterprise Credit Information Publicity System: http://www.gsxt.gov.cn/index.html. (3) Check whether the Weixin ID is incorrect. Open Weixin, tap "Me" to see the Weixin ID. Do not use a mobile number or QQ number. (4) Ensure that the owner of the Weixin ID is consistent with the holder of the bank card linked to WeChat Pay. Check whether the user has recently changed the name or updated the ID card number from 15 digits to 18 digits.

  2. Do not frequently call the search API. Received messages need to be viewed via the server. Calls to the search API consume the overall quota of API calls.

  3. No template message is received. (1) Check whether the third-party platform server has pushed any event message. (2) Provide guidance for users to search for the "Official Accounts Platform Security Assistant" Official Account and find whether a "Mini Program creation application" message is received. (3) Check whether the recipient's Weixin ID is correct.

  4. The arrival of a message may be delayed after a task is submitted depending on the accuracy of the collected information.

  5. If the verification of the legal person failed, view the message error code in the server, modify the information, and submit the task again.