Update History:
Version No. | Updates | Updated On |
---|---|---|
V2.1 | Temporary poi_id could be returned for the creation of a store. | 2016.7.18 |
V2.2 | 1. Poi_id no longer changes with audit. 2. Added 5 new offset_types to support latitudes and longitudes of other platforms. | 2016.11.29 |
Contents
Weixin Store API Documentation
3.4 Querying Store Information
3.6 Modifying Store Service Information
# Weixin Store API Documentation
# 1. API Introduction
Store Management APIs allow merchants to import, query, modify, and delete stores in batch to manage stores easily and efficiently.
When using the Store Management APIs, merchants should take the following considerations into account:
The store poi_id system has been updated so that the poi_ids are assigned immediately after their creation, without being affected by the audit.
A merchant can submit its internal or custom sid (in a string format) when creating a store to ensure the poi_id obtained after the store is approved is associated with the merchant's own data (Weixin does not verify the uniqueness of the sid. Please ensure its uniqueness).
The store availability parameter available_state indicates the audit status. An update is only allowed when the status is "Approved". Only extension fields (the first 11 fields in Table 1) can be updated.
The extension fields are open for editing. Any updates to them will be submitted to Weixin for audit, but do not affect the store availability (available_state still indicates "Approved"). In this case, the update_status changes to "1" (Under Update), which means no further updates can be made to the store until the submitted updates are approved and adopted by Weixin.
If you call the getpoi API when update_status=1 (Under Update), the obtained extension fields are the updated ones, but not the final results. The updates take effect only after being approved and adopted by Weixin (they may be rejected).
Example of a Store Page
# 2. Development Guide
# 2.1 Applying for Activation
You can apply for activating the store management features if you already have a verified Service Account.
The store management features are activated automatically when a verified Subscription Account has enabled the Cards & Offers, Wi-Fi, Shake, and Advertiser features.
Apply for the activation of store management features in Official Accounts Platform > Add Feature Plug-in > Select Store Features.
# 2.2 Development Process
After obtaining the API permissions, read the following procedures carefully before starting the development and debugging.
1. Preparations for Creating a Store
Upload images: Upload the images for creating the store. The uploaded image URL must be the Weixin domain name's URL.
2. Creating a Store
Call the Store Creation API. Upon a successful request, errcode, errmsg, and the final poiid are returned.
3. Audit Event Push
If a new store is approved, an event is pushed to the callback URL entered by the merchant (log in to the Official Accounts Platform and set it in the Developer Center) in order to obtain the store's unique ID: poi_id.
4. Querying Store Information
After the store is approved and poi_id is obtained, the merchant can query the details of the store using the poi_id.
5. Querying Store List
A merchant can query the list of stores under its name in batch through this API, and obtain the approved poi_ids and the merchant's own sid to be associated with the merchant name, outlet name, and address fields.
6. Modifying Store Service Information
This API is used to modify store service information including the "photo_list", "open_time", "recommend", "special", "introduction", "avg_price" and "telephone" fields, but such modifications are subject to a manual audit. "business_name", "longitude", "latitude", and "address" fields cannot be modified.
7. Deleting a Store
This API is used to delete created stores.
Note: The POST data of all APIs must be UTF-8 encoded. Otherwise, an error is returned.
# 3. Creating a Store
# 3.1 Uploading Images
API Description
When you create a store using the POI API, the image URL to be used must be the Weixin domain name's URL. Therefore, you need to upload the images with the "Upload Images" API and obtain the URL before creating a store.
The uploaded images cannot be larger than 1 MB. JPG files are supported.
API Request Format
Protocol | https |
---|---|
HTTP request method | POST/FORM |
Request URL | https://api.weixin.qq.com/cgi-bin/media/uploadimg?access_token=ACCESS_TOKEN |
POST data format | buffer |
Request Parameters
Parameter | Description | Required |
---|---|---|
access_token | Credential for calling API | Yes |
buffer | Data stream of image files | Yes |
Response Data
Example of response for a successful request:
{
"url":"http://mmbiz.qpic.cn/XXXXX"
}
Example of response for a failed request (errcode is not 0, and errmsg is error message):
{
"errcode":40001,
"errmsg":"invalid credential"
}
Field | Description |
---|---|
errcode | Error code. 0 indicates a successful request. |
errmsg | Error message |
# 3.2 Creating a Store
API Description
The Store Creation API allows merchants to create their own store data. A higher completeness of the field data means more details of the store will be shown on the merchant's page, thus attracting more users and leading to a higher exposure.
Upon a successful request of the Store Creation API, errcode 0, errmsg ok, and the unique poiid are returned.
API Request Format
Protocol | https |
---|---|
HTTP request method | POST |
Request URL | http://api.weixin.qq.com/cgi-bin/poi/addpoi?access_token=TOKEN |
POST data format | json |
Request Parameters
Parameter | Description | Required |
---|---|---|
access_token | Credential for calling API | Yes |
buffer | JSON data | Yes |
POST Data Example
Example of the page view containing the fields:
JSON Data Example
{"business":{
"base_info":{
"sid":"33788392",
"business_name":" Limited to 15 Chinese characters (30 English characters)",
"branch_name":" Limited to 10 Chinese characters (20 English characters). Parentheses and special characters are not allowed.",
"province":"Limited to 10 Chinese characters (20 English characters)",
"city":"Limited to 30 Chinese characters (20 English characters)",
"district":"Limited to 10 Chinese characters (20 English characters)",
"address":"Detailed address of the store without province and city: limited to 80 Chinese characters (160 English characters)",
"telephone":"Limited to 53 characters (only digits are allowed)",
"categories":["Food,Snack and Fast Food"],
"offset_type":1,
"longitude":115.32375,
"latitude":25.097486,
"photo_list":[{"photo_url":"https:// 20 images at most.com"},{"photo_url":"https://XXX.com"}],
"recommend":"Limited to 200 Chinese characters (400 English characters). McCrispy Chicken Burger Combo Meal, Chicken McNuggets, Family Barrels",
"special":"Limited to 200 Chinese characters (400 English characters). Free wifi, delivery service",
"introduction":"Limited to 300 Chinese characters (600 English characters). Founded in 1940 in the US, McDonald's is a large global restaurant chain, with about 3 0,000 outlets all over the world.
It features hamburgers, French fries, chicken products, soft drinks, milkshakes, wraps, salad, and desserts. ",
"open_time":"8:00-20:00",
"avg_price":35
}
}
}
Store Basic Information Fields (important)
Field | Description | Required |
---|---|---|
sid | Merchant's internal or custom ID, used to uniquely identify a merchant when the approved poi_id is sent to the merchant. | No |
business_name | Store name (only enter the merchant name, such as GOME and McDonald's. Do not enter region, address, or outlet information, such as Beijing GOME). It cannot be left empty, and should be limited to 15 Chinese characters (30 English characters). | Yes |
branch_name | Outlet name, which cannot contain region information or duplicate the store name (e.g. Beijing Wangfujing Store is not allowed). It should be limited to 20 Chinese characters (40 English characters). | Yes |
province | Province or municipality (e.g. Beijing) where the store locates. It should be limited to 10 Chinese characters (20 English characters). | Yes |
city | City where the store locates. It should be limited to 10 Chinese characters (20 English characters). | Yes |
district | District where the store locates. It should be limited to 10 Chinese characters (20 English characters). | Yes |
address | Detailed address of the store (Do not enter province and city) | Yes (For cities without districts such as Dongguan, this field can be left empty.) |
telephone | Phone number of the store, with the area code, phone number and extension number separated with "-") | Yes |
categories | Store category (Categories of different levels are separated with ",", e.g. "Food, Sichuan Cuisine, Hotpot". For more information, see "Weixin Store Category List".) | Yes |
offset_type | Coordinates type: 1: Mars Coordinates; 2: Sogou latitude and longitude; 3: Baidu latitude and longitude; 4: Mapbar latitude and longitude; 5: GPS coordinates; 6: Sogou Mercator coordinates. Note: Gaode latitude and longitude can be used directly without conversion. | Yes |
longitude | Longitude of the store's geographic location | Yes |
latitude | Latitude of the store's geographic location (Both longitude and latitude are Mars Coordinates, so it is recommended to use the Tencent Maps coordinates) | Yes |
Store Service Information Fields
Field | Description | Required |
---|---|---|
photo_list | Image URL list. Multiple images are allowed, each having a dimension of 640*340 pixels. The URLs must be the ones generated with the previous API. The images must be closely relevant to the store. QR code, group photos of employees (or model portraits), the business license, street views without the store front, map screenshots, bus/metro stops, and menu screenshots are not allowed. | No |
recommend | Merchant's recommended items depending on the industry. For example, this can be recommended dishes for a restaurant, recommended suites for a hotel, or recommended scenic spots for a tourist attraction. It should be limited to 200 Chinese characters (400 English characters). | No |
special | Special features or services provided by the merchant, such as free Wi-Fi, free parking, or delivery service. | No |
introduction | Merchant description, which is limited to 300 Chinese characters (600 English characters). | No |
open_time | Business hours in a 24-hour format, such as 8:00-20:00 | No |
avg_price | Price per person. It is an integer greater than 0 | No |
Response Data
Example of response for a successful request:
{
"errcode":0,
"errmsg":"ok"
"poi_id":460123456
}
Example of response for a failed request (errcode is not 0, and errmsg is error message):
{
"errcode":40001,
"errmsg":"invalid credential"
}
Field | Description |
---|---|
errcode | Error code. 0 indicates a successful request. |
errmsg | Error message |
Common Field Mistakes to Avoid
1) Store Name
Store name: This field cannot be left empty, and should be limited to 15 Chinese characters (30 English characters). Parentheses and special characters are not allowed. It should be the merchant (brand) name, such as HaiDiLao, Suning, Sinorama, and MOI Dept. Store, without any region, address and outlet information. Bad and good examples are shown below.
Outlet name: It should be limited to 20 Chinese characters (40 English characters ) without parentheses or special characters. This field is used to uniquely identity an outlet (such as Guomao Store, Chunxi Road Store, and Mixc Storeif) if there are multiple outlets under the same merchant (brand). It should not contain region information or contain any words duplicating the store name. Bad and good examples are shown below.
Bad Example 1:
{"business":{
"base_info":{
"sid":"33788392",
"business_name":" Guangzhou Dongxingtang Pharmacy Chain Co., Ltd. (Yongxin Store) ",
"branch_name":"",
Problem: The store name contains an outlet name, region information, and such expressions like "Chain Co., Ltd.".
Good Example:
{"business":{
"base_info":{
"sid":"33788392",
"business_name":" Dongxingtang Pharmacy ",
"branch_name":" Yongxin Store ",
Bad Example 2:
{"business":{
"base_info":{
"sid":"33788392",
"business_name":" Shanxi GOME ",
"branch_name":" Taiyuan Changzhi Road Store ",
Problem: The store and outlet names contain the region information.
Good Example:
{"business":{
"base_info":{
"sid":"33788392",
"business_name":" GOME ",
"branch_name":" Changzhi Road Store ",
Bad Example 3:
{"business":{
"base_info":{
"sid":"33788392",
"business_name":" Watsons (Beijing Road Store) ",
"branch_name":""
Problem: The store name contains parentheses and outlet name.
Good Example:
{"business":{
"base_info":{
"sid":"33788392",
"business_name":" Watsons ",
"branch_name":" Beijing Road Store ",
Bad Example 4:
{"business":{
"base_info":{
"sid":"33788392",
"business_name":" Simmer Huang ",
"branch_name":" Simmer Huang Chengdu Chunxi Road Store ",
Problem: The outlet name contains words duplicating the store name.
Good Example:
{"business":{
"base_info":{
"sid":"33788392",
"business_name":" Simmer Huang ",
"branch_name":" Chunxi Road Store ",
Bad Example 5:
{"business":{
"base_info":{
"sid":"33788392",
"business_name":" Living Mall ",
"branch_name":" McDonald's ",
Problem: Store and outlet names are wrongly reversed.
Good Example:
{"business":{
"base_info":{
"sid":"33788392",
"business_name":" McDonald's ",
"branch_name":" Living Mall ",
Note: The store and outlet names are displayed in the format of "business_name (branch_name)", with the parentheses added automatically. Considering different field search and storage rules, please enter the field information by strictly following the specification to ensure users can find your store easily. No region information is needed in the names because it is included in the address field.
2) Detailed Address
Enter the store's detailed address and house number correctly, with the basic information "No. XX, Road XX" included. Do not simply enter such information as "XX downstairs", "100 meters to the left of XX", "First floor of XX Mall", or "100 meters to the north of XX Metro Station Exit D", as the search and GPS locating features are not available.
Do not enter province and city in the detailed address field. For a municipality, both "province" and "city" should be populated with the municipality name.
Bad Example:
"province":"Zhejiang",
"city":"Hangzhou",
"district":"Xiacheng District",
"address":" 5F, Century Mart Supermarket, No. 86, Qingchun Road, Xiacheng District, Hangzhou", |
Problem: The detailed address contains the city name, which results in a wrong display "5F, Century Mart Supermarket, No. 86, Qingchun Road, Xiacheng District, Hangzhou, Xiacheng District, Hangzhou, Zhejiang.
Good Example:
"province":"Zhejiang",
"city":"Hangzhou",
"district":"Xiacheng District",
"address":"5F, Century Mart Supermarket, No. 86, Qingchun Road",
Correct display: 5F, Century Mart Supermarket, No. 86, Qingchun Road, Xiacheng District, Hangzhou, Zhejiang.
An example for municipality:
"province":"Shanghai",
"city":"Shanghai",
"district":"Xuhui District",
"address":"Building A, Zhonghuan International Plaza, No. 397, Tianlin Road",
3) Category Information
Select the correct store categories according to the category list.
Bad Example:
{"business":{
"base_info":{
"sid":"33788392",
"business_name":"McDonald's",
"branch_name":"Yiyuan Road Outlet",
"province":"Guangdong",
"city":"Guangzhou",
"district":"Haizhu District",
"address":"Yiyuan Road 11 ",
"telephone":"020-12345678",
"categories":["Food,Tea Restaurant"],
Problem: The McDonald's category filed value "Food,Tea Restaurant" is incorrect.
<a href="https://docs.google.com/spreadsheets/d/191n-uUJJFow_n1ySvPsLOpk88FJKXQuzSCKUe7vnjxQ/edit?usp=sharing "For more information on categories, see the "Weixin Store Category List" target="_blank">For more information on categories, see the "Weixin Store Category List"
4) Phone Number
The phone number entered must be true and valid. Spot check will be conducted during audit. An unanswered or invalid phone number can affect the audit result.
This field only consists of digits, with area code, phone number and extension number joined with "-". For a landline telephone number, area code is required. Multiple numbers are not allowed.
Bad Example 1:
"telephone":"(010)87632851",
Problem: The area code is not joined with "-".
Bad Example 2:
"telephone":"34435764",
Problem: The area code is missing in the land-line telephone number.
Bad Example 3:
"telephone":"13880934557, 0351-34435764",
Problem: Multiple numbers are entered.
Bad Example 4:
"telephone":"138-8093-4557",
Problem: The digits in a mobile number should not be separated with "-".
Bad Example 5:
"telephone":"8003800,4010",
Problem: The extension number is not joined with "-".
Bad Example 6:
"telephone":"8003800#4010",
Problem: The extension number is not joined with "-".
Good Example:
"telephone":"021-81445873",
"telephone":"021-81445873-1003",
"telephone":"13867428497",
"telephone":"4008002835",
5) Longitude and Latitude
Obtain the longitude and latitude coordinates of a known location through a third-party platform, and then select the offset_type to upload the coordinates.
You can also find the store's coordinates with the following tool and export them.
For more information, see Coordinate Picker:
http://lbs.qq.com/tool/getpoint/index.html
Note: The longitude and latitude coordinates need to be converted into Tencent Maps coordinates.
For more information, see:
<a href="http://lbs.qq.com/webservice_v1/guide-convert.html "Converting Coordinates"" target="_blank">http://lbs.qq.com/webservice_v1/guide-convert.html
# 3.3 Audit Event Push
When a new store is approved, an event is pushed to the callback URL entered by the merchant (log in to the Official Accounts Platform and set it in the Developer Center).
If the Weixin server does not receive the response within five seconds, the connection is broken and the request is initiated again. A maximum of three retries are made. It is recommended to use FromUserName + CreateTime for de-duplication of requests.
If the merchant's server cannot ensure the request is processed and responded within five seconds, it can return an empty string. When receiving the string, the Weixin server will not take any action or make a retry.**
Example of XML packet:
<xml>
<ToUserName><![CDATA[toUser]]></ToUserName>
<FromUserName><![CDATA[fromUser]]></FromUserName>
<CreateTime>1408622107</CreateTime>
<MsgType><![CDATA[event]]></MsgType>
<Event><![CDATA[poi_check_notify]]></Event>
<UniqId><![CDATA[123adb]]></UniqId>
<PoiId><![CDATA[123123]]></PoiId>
<Result><![CDATA[fail]]></Result>
<msg><![CDATA[xxxxxx]]></msg>
</xml>
Parameters:
Field | Description |
---|---|
ToUserName | Sender ID (OpenID) |
FromUserName | Error message |
CreateTime | Creation time of message (integral) |
MsgType | Message type: event |
Event | Event type: poi_check_notify |
UniqId | Merchant's internal ID (sid in the field) |
PoiId | Store ID, which uniquely identifies the store in Weixin |
Result | Audit result. succ: Successful; fail: Failed |
msg | Notification of success, or reason for rejection |
# 3.4 Querying Store Information
API Description
After creating a store and obtaining the poi_id, the merchant can query the store information with the pio_id. During the query, update_status=1 indicates the store's extension fields have been modified with the Update API in the last 5 business days. The updated extension fields have not been approved and are not final. The result on whether the fields are adopted and take effect is given within 5 business days (This process does not affect the store's availability, and the available_state is still "Approved").
Note: The updates to the extension fields are pushed for audit, but do not affect the store's availability.
API Request Format
Protocol | https |
---|---|
HTTP request method | POST |
Request URL | http://api.weixin.qq.com/cgi-bin/poi/getpoi?access_token=TOKEN |
POST data format | json |
Request Parameters
Parameter | Description | Required |
---|---|---|
access_token | Credential for calling API | Yes |
buffer | JSON data | Yes |
POST Data Example
{
"poi_id":"271262077"
}
Response Data
Data example
{
"errcode":0,
"errmsg":"ok",
"business ":{
"base_info":{
"sid":"001",
"business_name":"McDonald's",
"branch_name":"Yiyuan Road Outlet",
"province":"Guangdong",
"city":"Guangzhou",
"address":"No. 11, Yiyuan Road, Haizhu District",
"telephone":"020-12345678",
"categories":["Food,Snack and Fast Food"],
"offset_type":1,
"longitude":115.32375,
"latitude":25.097486,
"photo_list":[{"photo_url":"https:// XXX.com"} , {"photo_url":"https://XXX.com"}],
"recommend":"McCrispy Chicken Burger Combo Meal, Chicken McNuggets, Family Barrels",
"special":"Free wifi, delivery service",
"introduction":" Founded in 1940 in the US, McDonald's is a large global restaurant chain, with about 30,000 outlets all over the world.
3 It features hamburgers, French fries, chicken products, soft drinks, milkshakes, wraps, salad, and desserts.",
"open_time":"8:00-20:00",
"avg_price":35
"available_state":3
"update_status":0
}
}
}
Field | Description |
---|---|
errcode | Error code. 0 indicates a successful request. |
errmsg | Error message |
available_state | Store availability. 1: System error; 2: Under audit; 3: Approved; 4: Rejected. Poi_id is empty for status 1, 2, and 4. |
update_status | Indicates whether the extension fields are under update. 1: Under update but have not taken effect. No further updates are allowed; 0: Not under update or the updates have take effect. Further updates are allowed. |
business | Store information, as described above. |
*Note: Other fields are same as above.
# 3.5 Querying Store List
API Description
A merchant can query the list of stores under its name in batch through this API, and obtain the approved poi_id, and the merchant's own sid to be associates with the merchant name, outlet name, and address fields.
API Request Format
Protocol | https |
---|---|
HTTP request method | POST |
Request URL | https://api.weixin.qq.com/cgi-bin/poi/getpoilist?access_token=TOKEN |
POST data format | json |
Request Parameters
Parameter | Description | Required |
---|---|---|
access_token | Credential for calling API | Yes |
buffer | JSON data | Yes |
POST Data Example
{
"begin":0,
"limit":10
}
Field Description
Field | Description | Required |
---|---|---|
begin | The position from which the query starts. 0: the query begins with the first data entry. | Yes |
limit | Number of returned data entries. Maximum is 50 and default is 20 | Yes |
Response Data
Example:
The first store has been approved and has a poi_id and all fields; the second one has been rejected and only has basic fields; the third one is under audit and only has basic fields.
{
"errcode":0,
"errmsg":"ok"
"business_list":[
{"base_info":{
"sid":"101",
"business_name":"McDonald's",
"branch_name":"Yiyuan Road Outlet",
"address":"Yiyuan Road 11",
"telephone":"020-12345678",
"categories":["Food,Snack and Fast Food"],
"city":"Guangzhou",
"province":"Guangdong",
"offset_type":1,
"longitude":115.32375,
"latitude":25.097486,
"photo_list":[{"photo_url":"http: ...."}],
"introduction":"Founded in 1940 in the US, McDonald's is a large global restaurant chain, with about 3 0,000 outlets all over the world. It features hamburgers, French fries, chicken products, soft drinks, milkshakes, wraps, salad, and desserts.",
"recommend":"McCrispy Chicken Burger Combo Meal, Chicken McNuggets, Family Barrels",
"special":"Free wifi, delivery service",
"open_time":"8:00-20:00",
"avg_price":35,
"poi_id":"285633617",
"available_state":3,
"district":"Haizhu District",
"update_status":0
}},
{"base_info":{
"sid":"101",
"business_name":"McDonald's",
"branch_name":"Beijing Road Outlet",
"address":"No. 12, Beijing Road",
"telephone":"020-12345689",
"categories":["Food,Snack and Fast Food"],
"city":"Guangzhou",
"province":"Guangdong",
"offset_type":1,
"longitude":115.3235,
"latitude":25.092386,
"photo_list":[{"photo_url":"http: ...."}],
"introduction":"Founded in 1940 in the US, McDonald's is a large global restaurant chain, with about 3 0,000 outlets all over the world. It features hamburgers, French fries, chicken products, soft drinks, milkshakes, wraps, salad, and desserts.",
"recommend":"McCrispy Chicken Burger Combo Meal, Chicken McNuggets, Family Barrels",
"special":"Free wifi, delivery service",
"open_time":"8:00-20:00",
"avg_price":35,
"poi_id":"285633618",
"available_state":4,
"district":"Yuexiu District",
"update_status":0
}},
{"base_info":{
"sid":"101",
"business_name":"McDonald's",
"branch_name":"Longdong Outlet",
"address":"No. 122, Yinglong Road",
"telephone":"020-12345659",
"categories":["Food,Snack and Fast Food"],
"city":"Guangzhou",
"province":"Guangdong",
"offset_type":1,
"longitude":115.32345,
"latitude":25.056686,
"photo_list":[{"photo_url":"http: ...."}],
"introduction":"Founded in 1940 in the US, McDonald's is a large global restaurant chain, with about 3 0,000 outlets all over the world. It features hamburgers, French fries, chicken products, soft drinks, milkshakes, wraps, salad, and desserts.",
"recommend":"McCrispy Chicken Burger Combo Meal, Chicken McNuggets, Family Barrels",
"special":"Free wifi, delivery service",
"open_time":"8:00-20:00",
"avg_price":35,
"poi_id":"285633619",
"available_state":2,
"district":"Tianhe District",
"update_status":0
}},
],
"total_count":"3",
}
Parameter | Description |
---|---|
access_token | Credential for calling API |
buffer | JSON data |
total_count | Total number of stores |
# 3.6 Modifying Store Service Information
API Description
This API is used to modify store service information including the sid, "photo_list", "open_time", "recommend", "special", "introduction", "avg_price" and "telephone" fields, but such modifications are subject to a manual audit. "business_name", "longitude", "latitude" and "address" fields cannot be modified.
API Request Format
Protocol | https |
---|---|
HTTP request method | POST/FROM |
Request URL | https://api.weixin.qq.com/cgi-bin/poi/updatepoi?access_token=TOKEN |
POST data format | buffer |
Request Parameters
Parameter | Description | Required |
---|---|---|
access_token | Credential for calling API | Yes |
buffer | JSON data | Yes |
POST Data Example
{"business ":{
"base_info":{
"poi_id ":"271864249"
"sid":"A00001"
"telephone ":"020-12345678"
"photo_list":[{"photo_url":"https:// XXX.com"},{"photo_url":"https://XXX.com"}],
"recommend":"McCrispy Chicken Burger Combo Meal, Chicken McNuggets, Family Barrels",
"special":"Free wifi, delivery service",
"introduction":"Founded in 1940 in the US, McDonald's is a large global restaurant chain, with about 3 0,000 outlets all over the world. It features hamburgers, French fries, chicken products, soft drinks, milkshakes, wraps, salad, and desserts.",
"open_time":"8:00-20:00",
"avg_price":35
}
}
}
Fields:
All field values are same as above.
Note:
For the above eight fields, any edit to a field will overwrite the old content. If no update is made to a field, the field remains unchanged. For any update to the photo_list field, the old list is completely overwritten with the new list. To add new images, you need to include both the previous and new images in the new list. For example, if you want to add images D and E to the list of images A, B, and C, you need to call the API to input the URLs of all the images (A, B, C, D, E) to the photo_list field.
Response Data
Example:
{
"errcode":0,
"errmsg":"ok"
}
Field | Description |
---|---|
errcode | Error code. 0 indicates a successful request. |
errmsg | Error message |
# 3.7 Deleting a Store
API Description
This API is used to delete created stores and should be used with caution.
API Request Format
Protocol | https |
---|---|
HTTP request method | POST/FROM |
Request URL | https://api.weixin.qq.com/cgi-bin/poi/delpoi?access_token=TOKEN |
POST data format | buffer |
Request Parameters
Parameter | Description |
---|---|
access_token | Credential for calling API |
POST | JSON data |
POST Data Example
{
"poi_id": "271262077"
}
Fields:
Field | Description |
---|---|
poi_id | Store ID |
Response Data
Example:
{
"errcode":0,
"errmsg":"ok"
}
Field | Description |
---|---|
errcode | Error code. 0 indicates a successful request. |
errmsg | Error message |
# 4. Store Category List
API Description
This API is used to provide the store category information. It is recommended to make the categories as specific as possible to target more users accurately and improve exposure.
API Request Description
Protocol | https |
---|---|
HTTP request method | GET |
Request URL | http://api.weixin.qq.com/cgi-bin/poi/getwxcategory?access_token=TOKEN |
Response Data
{
"category_list":
["Food,Jiangzhe Cuisine,Shanghai Cuisine","Food,Jiangzhe Cuisine,Huaiyang Cuisine","Food,Jiangzhe Cuisine,Zhejiang Cuisine","Food,Jiangzhe Cuisine,Nanjing Cuisine ","Food,Jiangzhe Cuisine,Suzhou Cuisine..."]
}
# 5. Common Error Codes
Error code | errmsg | Description |
---|---|---|
-1 | system error | System error. Try again later. |
40009 | Invalid image size | Image size is 0 or exceeds 1 MB. |
40097 | invalid args | Incorrect parameter. Check the JSON field by referring to the field specification. |
65104 | invalid category | Invalid store category. Enter the categories by strictly following the Store Category List. |
65105 | invalid photo url | Invalid image URL. Be sure to upload the URL obtained through "Upload Images" API. |
65106 | poi audit state must be approved | Store status must be "Approved". |
65107 | not allow modify | Extension fields are non-modifiable. |
65109 | invalid business | Store name is empty. |
65110 | invalid address | Detailed address of the store is empty. |
65111 | invalid telephone | Phone number of the store is empty. |
65112 | invalid city | City of the store is empty. |
65113 | invalid province | Province of the store is empty. |
65114 | empty photo list | Image list is empty. |
65115 | invalid poi id | Incorrect poi_id |
For more error codes, see "Basic Support - Common Error Codes".