Contents

Weixin Store Mini Program API Documentation

1. Introduction

2. Notes About Permissions

3. Store API Overview

4. API Development

4.1. Fetching the Store Mini Program Category

4.2 Creating a Store Mini Program

4.3. Querying Audit Result for a Store Mini Program

4.4. Modifying the Store Mini Program Information

4.5 Fetching Province/City/District Information From Tencent Maps

4.6 Searching for a Store in Tencent Maps

4.7. Creating a Store in Tencent Maps

4.8 Adding a Store

4.9 Updating Store Information

4.10. Obtaining Individual Store Information

4.11. Obtaining Store Information List

4.12. Deleting a Store

4.13 Upgrade Process - Migrating From Store Management to the Store Mini Program

4.14. Business API - Cards/Coupons for the Store Mini Program

# Weixin Store Mini Program API Documentation

# 1. Introduction

Store Mini Programs feature is provided by the Official Accounts Platform for merchants to help manage their offline stores. A Store Mini Program can be built in the Official Account introduction page, custom menu, and articles, shown in Mini Programs Nearby based on location, or applied in coupons/cards, ads, and Wi-Fi business.

Store Mini Programs APIs allow merchants to add, query, modify and delete stores in batch, and create the Mini Program merchant accounts, to achieve an easy store management.

Note: You can continue to use the previous Store Management permissions by upgrading to the Store Mini Program.

Example of an Store Mini Program:

# 2. Notes About Permissions

The Store Mini Programs permissions are open to all non-individual Official Accounts. The Official Accounts with the old Store Management permissions can obtain the Store Mini Programs permissions by upgrading to the Store Mini Programs.

If an Official Account has granted the old Store Management permissions to a third party, the third party has the Store Mini Program permissions by default.

# 3. Store API Overview

# 4. API Development

# 4.1. Fetching the Store Mini Program Category

Request method: GET (use the HTTPS protocol) https://api.weixin.qq.com/wxa/get_merchant_category?access_token=TOKEN

Request parameters:

Parameter Description
access_token Credential for calling the API

Example of response JSON data (The Store Mini Program categories are divided into primary category and secondary category):

{
"errcode": 0,
"errmsg": "ok",
"data": {
"all_category_info": {
"categories": [
{
"id": 0,
"name": "root",
"level": 0, //Root node. Its child node is the ID of the primary category.
"children": [ //Child node list
269,
278
]
},
{
"id": 278,
"name": "Shopping",
"level": 1,//Primary Category
"father": 0,
"children": [
279,
280
]
},
{
"id": 280,
"name": "Convenience Store",
"level": 2, //Secondary Category
"father": 278,
"children": [],
"qualify": {
"exter_list": [
{
"inner_list": [
{
"name": "If food is involved, provide the Food Trade License or Sanitation Permit." //Names of the required certificates
}
]
}
]
},
"scene": 3,
"sensitive_type": 1 //If sensitive_type=1, relevant certificates are required when you create a Store Mini Program.
},
…
]
}
}
}

Response parameters:

Parameter Description Note
id Category ID Required
level Category level: primary or secondary categories Required
sensitive_type 0 or 1. 0: no special requirement; 1: relevant certificates are required during the creation of the Store Mini Program under this category. Required
qualify.exter_list.inner_list.name Names of the relevant certificates Required

Please see: Store Mini Program Category List

# 4.2. Creating a Store Mini Program

Note: After being submitted, a created Store Mini Program must be confirmed by the Official Account administrator before it can be audited. If the administrator fails to confirm it within 24 hours, you can submit it again.

Request method: POST (use the HTTPS protocol)

https://api.weixin.qq.com/wxa/apply_merchant?access_token=TOKEN

POST data example:

{
"first_catid": 476, //The primary category ID obtained with the get_store_category API
"second_catid": 477, //The secondary category ID obtained with the get_store_category API
"qualification_list": "RTZgKZ386yFn5kQSWLTxe4bqxwgzGBjs3OE02cg9CVQk1wRVE3c8fjUFX7jvpi-P",
"headimg_mediaid": "RTZgKZ386yFn5kQSWLTxe4bqxwgzGBjs3OE02cg9CVQk1wRVE3c8fjUFX7jvpi-P",
"nickname": "hardenzhang308",
"intro": "hardenzhangtest",
"org_code": "",
"other_files": ""
}

Request parameters:

Parameter Description Note
first_catid Primary category ID Required
second_catid Secondary category ID Required
qualification_list Certificates required for the category (temporary assets' mediaIDs). If the sensitive_type for second_catid is 1, the qualification_list field is required. 0-5 mediaIDs are allowed, e.g. mediaid1, mediaid2... Optional
headimg_mediaid Profile photo (temporary asset's mediaID) obtained with the existing media/upload API. Obtain it through the API: https://mp.weixin.qq.com/wiki?t=t=resource/res_main&id=mp1444738726 (JPG and PGN image files are supported now. Other formats will be supported in the future.) Required
nickname Alias of the Store Mini Program, with a length of 4-30 bytes (2-15 Chinese characters) Required
intro Introduction to the Store Mini Program Required
org_code Business License or Organization Code Certificate (temporary asset's mediaID). If error code 85024 is returned, the field is required. Optional
other_files Supplementary documents (temporary assets' mediaIDs). If error code 85024 is returned, the field is required. 0-5 mediaIDs are allowed, such as mediaid1, mediaid2... Optional
access_token Credential for calling the API Required

Example of response JSON data:

{
"errcode" : 0,
"errmsg" : "ok"
}

Error Codes:

Error Code Description
85024 Supplementary documents are required for the Store Mini Program name you apply for. The request parameters org_code and other_files are required.
85025 The number of stores registered with the admin's mobile number exceeds the limit. No more store can be activated under this entity.
85026 The Weixin ID has been linked to 5 administrators. Use another Weixin ID for the registration.
85027 The admin's ID card has been registered 5 times. Use another ID card for the registration.
85028 The number of stores registered under the entity exceeds the limit. No more store can be activated under this entity.
85029 Merchant name has been used by another store. Use a different one.
85030 The name should contain 4-30 bytes (2-15 Chinese characters). Special characters and reserved words such as "Weixin" are not allowed.
85031 The name cannot be used.
85032 This name is within the protection period for an infringement. You cannot apply for it now. Submit a different name.
85033 The name cannot contain any content violating the Official Accounts Platform agreement and applicable laws/regulations/policies. Reserved words such as "Weixin" are not allowed.
85034 The merchant name is within the 15-day protection period for a name change. Change to another one.
85035 The applicant must be the entity of the account.
85036 The introduction should not contain false, confusing or misleading information, or any content involving impersonation or violating laws/regulations/ policies.
85049 The number of times the profile photo or introduction is modified reaches the monthly limit.
43104 No permission
85050 Under audit. Do not submit again.
85053 Call it only after the store is successfully created.
85056 Invalid temporary mediaID

Event push - Audit result of the Store Mini Program creation

<xml> 
  <ToUserName><![CDATA[gh_4346ac1514d8]]></ToUserName>  
  <FromUserName><![CDATA[od1P50M-fNQI5Gcq-trm4a7apsU8]]></FromUserName>  
  <CreateTime>1488856741</CreateTime>  
  <MsgType><![CDATA[event]]></MsgType>  
  <Event><![CDATA[apply_merchant_audit_info]]></Event>  
  <audit_id>11111</audit_id>  
  <status>3</status>  
  <reason><![CDATA[xxx]]></reason> 
</xml>

Parameter Description Note
audit_id Audit ID Required
status Audit status (1: Approved, 3: Failed, 4: Rejected by the admin) Required
reason If status is 3 or 4, the reason for failure is returned. Required

# 4.3. Querying Audit Result for a Store Mini Program

Request method: GET (use the HTTPS protocol)

https://api.weixin.qq.com/wxa/get_merchant_audit_info?access_token=TOKEN

Request parameters:

Parameter Description Note
access_token Credential for calling the API Required

Example of response JSON data:

{
"errcode":0,
"errmsg":"ok",
"data": {
"audit_id": 414569513,
"status": 1,
"reason": ""
}

Response parameters:

Parameter Description Note
audit_id Audit ID Required
status Audit status (0: Not submitted; 1: Approved; 2: Under audit; 3: Failed; 4: Rejected by the admin) Required
reason If status is 3 or 4, the reason for failure is returned. Required

# 4.4. Modifying the Store Mini Program Information

Request method: POST (use the HTTPS protocol)

https://api.weixin.qq.com/wxa/modify_merchant?access_token=TOKEN

POST data example:

{
"headimg_mediaid":"xxxxx",
"intro":"x"
}

Request parameters:

Parameter Description Note
headimg_mediaid Temporary asset mediaID of the store profile photo. Leave it empty if no change is made. Obtain it through the API: https://mp.weixin.qq.com/wiki?t=t=resource/res_main&id=mp1444738726 Required
intro Introduction to the Store Mini Program. Leave it empty if no change is made. Required
access_token Credential for calling the API Required

See the Error Codes in Creating a Store Mini Program.

Example of response JSON data:

{
"errcode" : 0,
"errmsg" : "ok"
}

# 4.5. Fetching Province/City/District Information From Tencent Maps

Request method: GET (use the HTTPS protocol)

https://api.weixin.qq.com/wxa/get_district?access_token=TOKEN

Request parameters:

Parameter Description Note
access_token Credential for calling the API Required

Example of response JSON data:

{
"status": 0,
"message": "query ok",
"data_version": "20170510",
"result": [ //result is a two-dimensional array.
[ //result[0]:The first dimension is the province information.
{
"id": "440000",
"name": "Guangdong",
"fullname": "Guangdong Province",
"pinyin": [
"guang",
"dong"
],
"location": {
"lat": 23.13171,
"lng": 113.26627
},
"cidx": [ //Lists the subscripts of all cities under the Guangdong province (subscripts of result[1]).
246,
266
]
},
......
],
[ //result[1]:The second dimension is the city information.
{
"id": "440100",
"name": "Guangzhou",
"fullname": "Guangzhou City",
"pinyin": [
"guang",
"zhou"
],
"location": {
"lat": 23.12908,
"lng": 113.26436
},
"cidx": [ //Lists the subscripts of all districts under the Guangzhou city (subscripts of result[2]).
1667,
1677
]
},
......
],
[
{
"id": "440105",
"fullname": "Haizhu District",
"location": {
"lat": 23.08331,
"lng": 113.3172
}
},
{
"id": "440106",
"fullname": "Tianhe District",
"location": {
"lat": 23.12463,
"lng": 113.36199
}
}
......
]
]
}

Response parameters:

Parameter Description Note
result A two-dimensional array. The first dimension is the province information, the second city, and the third district. Required
id ID of district (districtid) Required
cidx All the cities under the Guangdong province can be found in result[1] through the cidx of Guangdong. Required
fullname Name of the province/city/district Required

See: List of Province/City/District IDs on Map

# 4.6. Searching for a Store in Tencent Maps

Request method: POST (use the HTTPS protocol) https://api.weixin.qq.com/wxa/search_map_poi?access_token=TOKEN

POST data example:

{
"districtid":440105,
"keyword":"x"
}

Request parameters:

Parameter Description Note
districtid Corresponds to the id field in the "Fetch Province/City/District Information" API Required
keyword Keyword for search Required
access_token Credential for calling the API Required

Example of response JSON data:

{
"errcode": 0,
"errmsg": "ok",
"data": {
"item": [
{
"branch_name": "X-MAX Factory",
"address": "2F and 3F of Yi'an Garden (Zhonghai Mingdu), No. 172-174, Yi'an Road , Haizhu District, Guangzhou, Guangdong, China",
"longitude": 113.274810791,
"latitude": 23.1088695526,
"telephone": " 020-89190388",
"category": "Sports and Fitness:Gym",
"sosomap_poi_uid": "2708071440732747189",
"data_supply": 2,
"pic_urls": [],
"card_id_list": []
},
....
]
}
}

Response parameters:

Parameter Description Note
sosomap_poi_uid Location ID obtained from Tencent Maps (the map_poi_id parameter in the Store Creation API Required
address Detailed address Required

# 4.7 Creating a Store in Tencent Maps

Request method: POST (use the HTTPS protocol) https://api.weixin.qq.com/wxa/create_map_poi?access_token=TOKEN

POST data example:

{
"name": "hardenzhang",
"longitude": "113.323753357",
"latitude": "23.0974903107",
"province": "Guangdong",
"city": "Guangzhou",
"district": "Haizhu District",
"address": "TIT",
"category": "Category 1:Category 2",
"telephone": "12345678901",
"photo": "http://mmbiz.qpic.cn/mmbiz_png/tW66AWE2K6ECFPcyAcIZTG8RlcR0sAqBibOm8gao5xOoLfIic9ZJ6MADAktGPxZI7MZLcadZUT36b14NJ2cHRHA/0?wx_fmt=png",
"license": "http://mmbiz.qpic.cn/mmbiz_png/tW66AWE2K6ECFPcyAcIZTG8RlcR0sAqBibOm8gao5xOoLfIic9ZJ6MADAktGPxZI7MZLcadZUT36b14NJ2cHRHA/0?wx_fmt=png",
"introduct": "test",
"districtid": "440105",
}

Request parameters:

Parameter Description Note
name Name Required
longitude Longitude Required
latitude Latitude Required
province Province Required
city City Required
district District Required
address Detailed address Required
category Category, such as "Food:Chinese Restaurant" Required
telephone Phone number. Multiple numbers are allowed and separated with semicolons, e.g. 010-6666666-111; 010-6666666; 010-6666666-222 Required
photo Store image URL Required
license Business License URL Required
introduct Introduction to the store Required
districtid ID returned from the "Fetch Province/City/District Information From Tencent Maps" API Required
poi_id For a migrated store, this field is required. Optional
access_token Credential for calling the API Required

Example of response JSON data:

{
"error": null, //Indicates the reason for error.
"data": {
"base_id": 42160,
"rich_id": 42010
}
}

Event push - Audit result of store creation in Tencent Maps

<xml>
  <ToUserName><![CDATA[gh_4346ac1514d8]]></ToUserName>  
  <FromUserName><![CDATA[od1P50M-fNQI5Gcq-trm4a7apsU8]]></FromUserName>  
  <CreateTime>1488856741</CreateTime>  
  <MsgType><![CDATA[event]]></MsgType>  
  <Event><![CDATA[create_map_poi_audit_info]]></Event>  
  <audit_id>11111</audit_id>  
  <status>1</status>  
  <map_poi_id><![CDATA[xxx]]></map_poi_id>  
  <name><![CDATA[xxx]]></name>  
  <address><![CDATA[xxx]]></address>  
  <latitude><![CDATA[xxx]]></latitude>  
  <longitude><![CDATA[xxx]]></longitude>  
  <sh_remark><![CDATA[xxx]]></sh_remark> 
</xml>

Parameter Description Note
audit_id Audit ID (the base_id field returned above) Required
status Audit status (0: Approved; 1: Failed) Required
map_poi_id Location ID obtained from Tencent Maps Required
name Store name Required
address Detailed address Required
latitude Latitude Required
longitude Longitude Required
sh_remark Additional information on the store Required

Note: It takes 3 business days for Tencent Maps to audit the store. The audit result may be pushed to you during the period.

# 4.8 Adding a Store

Request method: POST (use the HTTPS protocol) https://api.weixin.qq.com/wxa/add_store?access_token=TOKEN

POST data example:

{
"poi_id": "",
"map_poi_id": "2880741500279549033",
"pic_list":"{\"list\":[\"http://mmbiz.qpic.cn/mmbiz_jpg/tW66AWvE2K4EJxIYOVpiaGOkfg0iayibiaP2xHOChvbmKQD5uh8ymibbEKlTTPmjTdQ8ia43sULLeG1pT2psOfPic4kTw/0?wx_fmt=jpeg\"]}",
"contract_phone": "1111222222",
"credential": "22883878-0",
"qualification_list": "RTZgKZ386yFn5kQSWLTxe4bqxwgzGBjs3OE02cg9CVQk1wRVE3c8fjUFX7jvpi-P"
}

Request parameters:

Parameter Description Note
map_poi_id Location ID obtained from Tencent Maps (the sosomap_poi_uid parameter returned in the search_map_poi API Required
pic_list Store image. Multiple images are allowed. This field is in a JSON format. Required
contract_phone Contact number Required
hour Business hours in a format like 11:11-12:12 Required
credential Business qualification certificate number Required
company_name Entity name (temporary asset's mediaID). If the Official Account entity is used, leave it empty. Otherwise, enter the actual entity name. Optional
qualification_list Supporting documents (temporary assets' mediaIDs). This field is only required when the Official Account entity is not used. 0-5 mediaIDs are allowed, e.g. mediaid1, mediaid2... Optional
card_id Card/Coupon ID. Leave it empty if no card/coupon is added. Only member cards, Weixin Checkout, and Quick Pay coupons are supported. Custom code is not supported. You need to create a cardID in the Cards & Offers feature on the Official Accounts Platform first. Required
poi_id This field is required if the store is migrated from Store Management to the Store Mini Program. Optional
access_token Credential for calling the API Required

Example of response JSON data:

{
"errcode" : 0,
"errmsg" : "ok",
"data" : {"audit_id":111}
}

Error Codes:

Error Code Description
-1 System error
85038 Duplicate store is not allowed.
85039 No information can be obtained under this store status.
85040 The store is already linked.
85041 This business qualification document has already been added.
85042 Number of Nearby locations reaches the limit.
85054 Upgrade to the Store Mini Program has not been done. Poi_id is required to migrate the store.
85055 Invalid map_poi_id
85056 Invalid temporary mediaID

Event push - Audit result of store creation

<xml>
  <ToUserName><![CDATA[gh_4346ac1514d8]]></ToUserName>  
  <FromUserName><![CDATA[od1P50M-fNQI5Gcq-trm4a7apsU8]]></FromUserName>  
  <CreateTime>1488856741</CreateTime>  
  <MsgType><![CDATA[event]]></MsgType>  
  <Event><![CDATA[add_store_audit_info]]></Event>  
  <audit_id>11111</audit_id>  
  <status>3</status>  
  <reason><![CDATA[xxx]]></reason>  
  <is_upgrade>3</is_upgrade>  
  <poiid>12344</poiid> 
</xml>

Parameter Description Note
audit_id Audit ID Required
status Audit status (1: Approved; 3: Failed) Required
reason If status is 3, the reason for failure is returned. Required
is_upgrade 0: create stores; 1: add stores. Required
poiid Store ID Only valid when status=1

# 4.9 Updating Store Information

Request method: POST (use the HTTPS protocol)

https://api.weixin.qq.com/wxa/update_store?access_token=TOKEN

POST data example:

{
"map_poi_id":"5938314494307741153",
"poi_id":"472671857",
"hour":"10:00-21:00",
"contract_phone":"123456",
"pic_list":"{\"list\":[\"http://mmbiz.qpic.cn/mmbiz_jpg/tW66AWvE2K4EJxIYOVpiaGOkfg0iayibiaP2xHOChvbmKQD5uh8ymibbEKlTTPmjTdQ8ia43sULLeG1pT2psOfPic4kTw/0?wx_fmt=jpeg\"]}"
}

Parameters:

Parameter Description Note
access_token Credential for calling the API Required
poi_id Store ID returned when the addition of a store to the Store Mini Program is approved Required
hour Custom business hours in a format like 10:00-12:00 Required
contract_phone Custom contact number Required
pic_list Store image. Multiple images are allowed. This field is in a JSON format. Required
card_id Card/Coupon ID. Leave is empty if no update is made. Fetch the card_id through the API: https://api.weixin.qq.com/card/storewxa/get?access_token=ACCESS_TOKEN

Note: Updating images for a store means adding images for the store from scratch, with all the old images discarded. Any new images same as the old images are exempt from audit.

Response for a successful request:

{
"errcode" : 0,
"errmsg" : "ok",
//has_audit_id indicates whether an audit is required (1: Yes; 0: No).
//audit_id: Audit ID
"data" : {"has_audit_id":1,"audit_id":1111}
}

Error Codes:

Error Code Description
-1 System error
40097 Incorrect input parameter
65115 Store does not exist.
65118 Update is not allowed under this store status.
85053 Call it only after the store is successfully created.

If store images are changed when the store is updated, an audit is required.

Event push - Audit result of store image modification

<xml>
  <ToUserName><![CDATA[gh_4346ac1514d8]]></ToUserName>  
  <FromUserName><![CDATA[od1P50M-fNQI5Gcq-trm4a7apsU8]]></FromUserName>  
  <CreateTime>1488856741</CreateTime>  
  <MsgType><![CDATA[event]]></MsgType>  
  <Event><![CDATA[modify_store_audit_info]]></Event>  
  <audit_id>11111</audit_id>  
  <status>3</status>  
  <reason><![CDATA[xxx]]></reason> 
</xml>

Parameter Description Note
audit_id Audit ID Required
status Audit status (1: Approved; 3: Failed) Required
reason If status is 3, the reason for failure is returned. Required

# 4.10 Obtaining Individual Store Information

Request method: POST (use the HTTPS protocol)

https://api.weixin.qq.com/wxa/get_store_info?access_token=TOKEN

POST data example:

{
"poi_id":"472671857"
}

Parameters:

Parameter Description Note
access_token Credential for calling the API Required
poi_id Store ID returned when the addition of a store to the Store Mini Program is approved Required

Response for a successful request:

{
"errcode": 0,
"errmsg": "ok",
"business": {
"base_info": {
"business_name": "Longdi Neighborhood Deli",
"address": "Near Asheng Computer, Longdi Neighborhood, Zhongdu Avenue, Sheli Street",
"telephone": "12345678",
"city": "Harbin",
"province": "Heilongjiang",
"longitude": 126.94355011,
"latitude": 45.556098938,
"photo_list": [
{
"photo_url": "http://mmbiz.qpic.cn/mmbiz_png/tW66AWvE2K6icjle1q6nbfKr0HMibzxKqOUfG1hARktHV84ZZojt9cXZ0UicDevZQUicckPw68lfo2Le3RjpEo6oLg/0?wx_fmt=png"
}
],
"open_time": "11:00-12:00",
"poi_id": "472671857",
"status":2,
"district": "value",
"qualification_num": "91750100ME2XCR6A70",
"qualification_name": "Longdi Neighborhood Deli"
}
}
}

"status" field value returned in the response for a successful request:

Error Code Description
1 Approved
2 Under audit
3 Failed

Error Codes:

Error Code Description
-1 System error
40097 Incorrect input parameter
65115 Store does not exist.

# 4.11 Obtaining Store Information List

Request method: POST (use the HTTPS protocol)

https://api.weixin.qq.com/wxa/get_store_list?access_token=TOKEN

POST data example:

{
"offset": 0,
"limit": 10
}

Parameters:

Parameter Description Note
access_token Credential for calling the API Required
offset Position from which the fetch of store list begins. Starting value is 0. Required
limit Number of stores to be fetched Required

For example, if there are 10 stores under a Store Mini Program, then the offset cannot be greater than 9. The "limit" parameter cannot be greater than 50. If 0 is input, it is treated as the default 20.

Response for a successful request:

{
"errcode": 0,
"errmsg": "ok",
"business_list": [
{
"base_info": {
"business_name": "Chaosu Tianshi Club",
"address": "No. 19, Xinhua Road",
"telephone": "12345678",
"categories": [],
"city": "Handan",
"province": "Hebei",
"longitude": 114.958480835,
"latitude": 36.7714881897,
"photo_list": [
{
"photo_url": "http://mmbiz.qpic.cn/mmbiz_jpg/tW66AWvE2K4e52sLYyA90ZKuicdfhkf5ibQk1icmcRWjrMxmVibo8sVQAllABxG5ic0D5x62gfsPVL4aibxQ2SicfPyjQ/0?wx_fmt=jpeg"
}
],
"open_time": "10:00-21:00",
"poi_id": "472665875",
"status":1,
"district": "Quzhou County",
"qualification_list": [],
"qualification_num": "01650100NE2XCT6Z70",
"qualification_name": "Chaosu Tianshi Club"
}
},
{
"base_info": {
"business_name": "Longdi Neighborhood Deli",
"address": "Near Asheng Computer, Longdi Neighborhood, Zhongdu Avenue, Sheli Street",
"telephone": "12345678",
"categories": [],
"city": "Harbin",
"province": "Heilongjiang",
"longitude": 126.94355011,
"latitude": 45.556098938,
"photo_list": [
{
"photo_url": "http://mmbiz.qpic.cn/mmbiz_png/tW66AWvE2K6icjle1q6nbfKr0HMibzxKqOUfG1hARktHV84ZZojt9cXZ0UicDevZQUicckPw68lfo2Le3RjpEo6oLg/0?wx_fmt=png"
}
],
"open_time": "11:00-12:00",
"poi_id": "472671857",
"status":3,
"district": "Acheng District",
"qualification_list": [],
"qualification_num": "91750100ME2XCR6A70",
"qualification_name": "Longdi Neighborhood Deli"
}
}
],
"total_count": 2
}

"status" field value returned in the response for a successful request:

Error Code Description
1 Approved
2 Under audit
3 Failed

Error Codes:

Error Code Description
-1 System error
40097 Incorrect input parameter

# 4.12 Deleting a Store

Request method: POST (use the HTTPS protocol) https://api.weixin.qq.com/wxa/del_store?access_token=TOKEN

POST data example:

{
"poi_id":"472671857"
}

Parameters:

Parameter Description Note
access_token Credential for calling the API Required
poi_id Store ID returned when the addition of a store to the Store Mini Program is approved Required

Error Codes:

Error Code Description
-1 Deletion failed.
85053 Call it only after the store is successfully created.

# 4.13 Upgrade Process - Migrating From Store Management to the Store Mini Program

Step 1: After the Store Mini Program creation is approved, fetch the list of stores to be migrated (poi/getpoilist is an existing API, with three new fields added):

https://api.weixin.qq.com/cgi-bin/poi/getpoilist?access_token=TOKEN

The following fields are set for each store in Store Management:

upgrade_status Migration status (0: To be migrated; 1: Failed; 2: Under migration; 3: Successful; 4. Migration is not allowed)
upgrade_comment Reason for rejecting migration (upgrade_status=1)
mapid map_poi_id in Tencent Maps
poi_id poi_id of the store

Step 2:

For the stores with an upgrade_status 0 or 1, call the wxa/add_store API to migrate the stores.

For the stores with an upgrade_status 4 (Migration is not allowed), call the cgi-bin/poi/delpoi API to delete the stores.

Only when the upgrade_status is 3 (Successful) for all the stores in the list, the upgrade is completed.

# 14. Business API - Cards/Coupons for the Store Mini Program

Step 1: Obtaining cards/coupons for the Store Mini Program

URL

https://api.weixin.qq.com/card/storewxa/get?access_token=ACCESS_TOKEN

Example of request parameters

{
"poi_id" : 1234567
}
**Example of response parameters**
{
"errcode" : 0,
"errmsg" : "ok",
"card_id" : "pabcedfg1234567hijklmn"
}

Description:

  • poi_id indicates the store ID.
  • card_id indicates the Weixin card/coupon ID.
  • poi_id must belong to the Store Mini Program of the Official Account that calls the API.
  • If no store is set under the poi_id, card_id field is not returned in the response.

Step 2: Setting cards/coupons for the Store Mini Program

URL

https://api.weixin.qq.com/card/storewxa/set?access_token=ACCESS_TOKEN

Example of request parameters

{
"poi_id" : 1234567
"card_id" : "pabcedfg1234567hijklmn"
}
**Example of response parameters**
{
"errcode" : 0,
"errmsg" : "ok"
}

Description

  • poi_id indicates the store ID.
  • card_id indicates the Weixin card/coupon ID.
  • poi_id must belong to the Store Mini Program of the Official Account that calls the API.
  • card_id should be a non-custom code, i.e. base_info.use_custom_code==fase

If you have any questions regarding store development, please join the QQ group 463320265.