WeChat product management
Commodity Management
Product management
Query product information
By calling this interface, merchants can query the successfully created product information to check the product status or information settings.
Request example
HTTP请求方式:POST https://api.weixin.qq.com/scan/product/get?access_token=access_token POST数据格式:JSON POST数据例子: { "keystandard": "ean13", "keystr": "6900873042720" }
Request parameter description
Parameter | Is it required | Description |
---|---|---|
access_token | Yes | Global credentials of the official account, used for interface calls. |
keystandard | is the | product coding standard. |
keystr | is the | product code content. |
Return example
The correct JSON return result is as follows:
{ "errcode": 0, "errmsg": "ok", "brand_info":{ "base_info":{ "title": "扫一扫动态主页demo", "thumb_url":"http://mmbiz.qpic.cn/mmbiz/AhrnkhhK7rWevHib2pmq1phtply6JicADNrX6Yrvd7LzKERyic3kn3VdSsmFr5F5ibXzj9Al65yWFudmjqcWic1Qe9g/0", "brand_tag": "小耿哥8", "category_id": 0, "retail_price": "0.00", "store_mgr_type": "auto", "store_vendorid_list":[], "color": "auto", "status": "on" }, "detail_info":{ "banner_list":[ {"link":"http://mmbiz.qpic.cn/mmbiz/AhrnkhhK7rWevHib2pmq1phtply6JicADNic0LvlkCw7s6mZpicib7ict5MhoiaL3gPrYXpibnibOpViaYJFpic12nx4bNZcQ/0"}, {"link":"http://mmbiz.qpic.cn/mmbiz/AhrnkhhK7rWevHib2pmq1phtply6JicADNbTfwJmlVXp9k1A80UCFL1a9icwdthmSLh0RuJ5iaKcZBwdXbOicktkwPQ/0"}, {"link":"http://mmbiz.qpic.cn/mmbiz/AhrnkhhK7rWevHib2pmq1phtply6JicADNW4FD74oXjEyqHicE9U3H0nTCdLHibo7rRia2TFBQ6tx2Pvic92ica8Wns4Q/0"} ], "detail_list":[ { "title": "产品名称", "desc": "微信相框moment" }, { "title": "设计团队", "desc": "微信团队" }, { "title": "设计初衷", "desc": "做一个简单纯粹的电子相框" }, { "title": "产品诉求", "desc": "以相框为纽带,增加子女与父母长辈的沟通,用照片通过微信传递感情交流" } ] }, "action_info":{ "action_list":[ { "type": "link", "name": "banner", "link": "http://mp.weixin.qq.com", "image":"http://mmbiz.qpic.cn/mmbiz/AhrnkhhK7rWevHib2pmq1phtply6JicADNgjXTKn0j4TlfXjUOPYBDicVOmG0sdNfUOg9Lzia2g9cbjyTXmOiaB6L1g/0", "showtype": "banner" }, { "type": "link", "name": "自定义活动1", "link": "http://p.url.cn/wxscan.php", }, { "type": "link", "name": "自定义活动2", "link": "http://p.url.cn/wxscan.php", }, { "type": "user", "appid": "wx307e399609946068" }, { "type": "text", "text": "此处可根据品牌商需要,用于简单描述商品或活动。" } ] }, "module_info":{ "module_list":[ { "type": "anti_fake", "native_show": "true" } ] } } }
Return parameter description
Parameters | Description |
---|---|
errcode | 0 means the call is successful, otherwise the relevant error code will be returned. |
errmsg | ok means the call is successful, otherwise an error message will be returned. |
status | The status of the product homepage, on is the published status, off is the unpublished status, check is the review status, and reject is the review failed status. |
For other parameter descriptions, please refer to the "Create Product" interface.
Note: For products whose status is "checking", you cannot call the interface to update or cancel publishing, otherwise an error will be reported.
Query product information in batches
Call this interface, merchants can query and create batches successfully Product information, the query dimensions include product status and coding content.
Request example
HTTP请求方式:POST https://api.weixin.qq.com/scan/product/getlist?access_token=access_toke POST数据格式:JSON POST数据例子: { "offset": "1", "limit": "10", "status":"on", }
Request parameter description
Parameter | Is it required | Description |
---|---|---|
access_token | Yes | Global credentials of the official account, used for interface calls. |
offset | is the starting position of | batch query, starting from 0 and including the starting position. |
limit | is the number of | batch queries. |
status | No | Supports pulling by status. on is the released status, off is the unpublished status, check is the review status, reject is the review failed status, and all is all status. |
keystr | No | Supports pulling by partial encoding content. After filling in this parameter, the product information containing the passed parameters in the encoding content can be pulled out. Similar to keyword search. |
Return example
The correct JSON return result is as follows:
{ "errcode": 0, "errmsg": "ok", "total": 2, "key_list": [ { "keystandard": "ean13", "keystr": "6390000000000", "category_id": 537117576, "category_name": "果泥/菜泥/肉泥", "update_time": 1413181580, "status": "on" }, { "keystandard": "ean13", "keystr": "6390000000002", "category_id": 537117576, "category_name": "果泥/菜泥/肉泥", "update_time": 1412834605, "status": "on" } ] }
Return parameter description
Parameters | Description | |
---|---|---|
0 means the call is successful, otherwise the relevant error code will be returned. | ||
ok means the call is successful, otherwise an error message will be returned. | ||
The total number of products that match the filter criteria. | ||
Product information list. | ||
Commodity coding standard. | ||
Product code content. | ||
Product category ID. | ||
Product category name. | ||
The last update time of product information (integer type). | ||
The status of the product homepage, on is the published status, off is the unpublished status, check is the review status, and reject is the review failed status. |
Parameter | Is it required | Description |
---|---|---|
access_token | Yes | Global credentials of the official account, used for interface calls. |
keystandard | is the | product coding standard. |
keystr | is the | product code content. |
action_info | No | Product promotion service area information. |
详细参数说明,请参考“创建商品”接口。
Return example
The correct JSON return result is as follows:
{ "errcode": 0, "errmsg": "ok", "pid": "5g0B4A90aqc" }
Return parameter description
参数 | 说明 |
---|---|
errcode | 0为调用成功,否则返回相关错误码。 |
errmsg | ok为调用成功,否则返回错误提示。 |
pid | 转译后的商品id,将直接编入“获取商品二维码接口”返回的二维码内容。 |
Clear product information
By calling this interface, merchants can clear successfully created product information.
Request example
HTTP请求方式:POST https://api.weixin.qq.com/scan/product/clear?access_token=access_token POST数据格式:JSON POST数据例子: { "keystandard": "ean13", "keystr": "6900873042720" }
Request example description
Parameter | Is it required | Description |
---|---|---|
access_token | Yes | Global credentials of the official account, used for interface calls. |
keystandard | is the | product coding standard. |
keystr | is the | product code content. |
Return example
The correct JSON return result is as follows:
{ "errcode": 0, "errmsg": "ok" }
Return parameter description
参数 | 说明 |
---|---|
errcode | 0为调用成功,否则返回相关错误码。 |
errmsg | ok为调用成功,否则返回错误提示。 |
Jump URL parameter description
Scenario description:
The user clicks on the product After promoting the Link type link in the service area, the external URL will have four parameters: wxkeystand, wxkeystr, wxticket, and wxextinfo. By checking wxticket, the source and identity information of the accessing user can be confirmed, achieving precise operation.
URL示例:http://p.url.cn/wxscandemo/yangbanjian/fangweilanding?91eddae46161ae26a3e6e928f3c07147=scan&wxkeystandard=qrcode&wxkeystr=cosmetics1&wxticket=azlsdGljdXo4Ymow&wxextinfo=123
Parameter description
Parameters | Description |
---|---|
wxkeystand | Commodity coding standard. |
wxkeystr | Product code content. |
wxticket | Certificate parameter that identifies the source. You can exchange the corresponding product information and access user information through the "check wxticket parameter interface". Specially, when a user shares a link, WeChat will clear the wxticket parameter to ensure security. |
wxextinfo | The extinfo passed in when calling the "Get Product QR Code Interface" is the identification parameter. |
Check wxticket parameters
Call this interface to check the product homepage from which the user is currently accessed, and obtain the information on the front end of the webpage User’s identity information. To ensure the correctness of the scenario, the wxticket parameter is only valid for 20 minutes as a temporary signature. If the validity period is exceeded, the check will fail.
Request example
HTTP请求方式:POST https://api.weixin.qq.com/scan/scanticket/check?access_token=access_token POST数据格式:JSON POST数据例子: { "ticket": " Ym1haDlvNXJqY3Ru1", }
Request parameter description
Parameter | Is it required | Description |
---|---|---|
access_token | Yes | Global credentials of the official account, used for interface calls. |
ticket | is the wxticket parameter in the | request URL. |
Return example
The correct JSON return result is as follows:
{ "errcode":0, "errmsg":"ok", "keystandard":"ean13", "keystr":"6901481811083", "openid":"otAzGjrS4AYCmeJM1GhEOcHXXTAo", "scene":"scan", "is_check": false, "is_contact": false }
Return parameter description
Parameters | Description | |
---|---|---|
0 means the call is successful, otherwise the relevant error code will be returned. | ||
ok means the call is successful, otherwise an error message will be returned. | ||
Commodity coding standard. | ||
Product code content. | ||
The openid of the current visitor can uniquely identify the user. | ||
The scene that opens the product homepage, scan means scanning the code, others means other scenes, which may be conversations, collections or friend circles. | ||
Whether the barcode (QR code) has been scanned, true means yes, false means no. | ||
Whether to follow the public account, true means you have followed it, false means you have not followed it. |
Parameters | Description |
---|---|
ToUserName | The original id of the merchant’s public account. |
FromUserName | The user’s openid. |
CreateTime | Message creation time (integer). |
MsgType | Message type, event. |
Event | Event type, scan_product_callback is the component message event. |
KeyStandard | Commodity coding standard. |
KeyStr | Product code content. |
ExtInfo | The extinfo passed in when calling the "Get Product QR Code Interface" is the identification parameter. |
NeedAntiFake | Please use the pop-up page provided by WeChat to display the anti-counterfeiting results. True means used, false means not used. |
Return XML example
<xml> <ToUserName><![CDATA[otAzGjrJVN21mpDF4ZWQiYZwdK0Y]]></ToUserName> <FromUserName><![CDATA[gh_fbe8a958756e]]></FromUserName> <CreateTime>1447848568</CreateTime> <MsgType><![CDATA[scanproduct]]></MsgType> <ScanProduct> <KeyStandard><![CDATA[qrcode]]></KeyStandard> <KeyStr><![CDATA[weixin_antifake]]></KeyStr> <ExtInfo><![CDATA[hyhy]]></ExtInfo> <AntiFake> <CodeResult><![CDATA[real]]></CodeResult> </AntiFake> </ScanProduct> </xml>
Return parameter description
Parameters | Description |
---|---|
ToUserName | The openid of the user. |
FromUserName | The original ID of the merchant’s public account. |
CreateTime | Message creation time (integer). |
MsgType | Message type, scanproduct. |
KeyStandard | Commodity coding standard. |
KeyStr | Product code content. |
ExtInfo | The extinfo passed in when calling the "Get Product QR Code Interface" is the identification parameter. |
AntiFake | Content of anti-counterfeiting information. |
CodeResult | The result of product anti-counterfeiting query, real means the code is true, fake means the code is false, and not_active means the anti-counterfeiting code is not activated. |
Clear scan code records
When the "native anti-counterfeiting component" is set on the product homepage (for details, please see [ Create a product]), every time a user scans the QR code to view the homepage, it will be counted and then displayed in the "Anti-Counterfeiting Query Details". If the merchant wants to "reset" the scanned records of a certain code to zero, it can call this interface to clear the scanned records of the code.
Request example
HTTP请求方式:POST https://api.weixin.qq.com/scan/scanticket/check?access_token=access_token POST数据格式:JSON POST数据例子: { "keystandard": "ean13", "keystr": "6900000000000", "extinfo":"extinfo" }
Request parameter description
Parameter | Is it required | Description |
---|---|---|
access_token | Yes | Global credentials of the official account, used for interface calls. |
keystandard | is the | product coding standard. |
keystr | is the | product code content. |
extinfo | is the extinfo passed in when | calls the "Get Product QR Code Interface" and is the identification parameter. |
Return example
The correct JSON return result is as follows:
{ "errcode":0, "errmsg":"ok" }
Return parameter description
参数 | 说明 |
---|---|
errcode | 0为调用成功,否则返回相关错误码。 |
errmsg | ok为调用成功,否则返回错误提示。 |