Create products on WeChat


Product creation

Get merchant information

Using this interface, merchants can obtain account numbers Information such as category and number segment below.

Request example

HTTP请求方式:GET
https://api.weixin.qq.com/scan/merchantinfo/get?access_token=TOKEN

Request parameter description

ParameterIs it requiredDescription
access_tokenYesGlobal credentials of the official account, used for interface calls.

Return example

The correct JSON return result is as follows:

{
 "errcode": 0,
 "errmsg": "ok",
 "brand_tag_list":[
  "小耿哥8",
  "testtag"
 ],
 "verified_list": [
  {
   "verified_firm_code": 69300570, 
   "verified_cate_list": [
    {
     "verified_cate_id": 538071212, 
     "verified_cate_name": "食品/茶叶/特产/滋补品"
     }
    ]
   }, 
   {
    "verified_firm_code": 123, 
    "verified_cate_list": [
     {
      "verified_cate_id": 538071212, 
      "verified_cate_name": "食品/茶叶/特产/滋补品"
     }
    ]
   }
  ] 
 }

Return parameter description

##errcode0 means the call is successful, otherwise the relevant error code will be returned. errmsgok means the call is successful, otherwise an error message will be returned. brand_tag_list Brand tag list, passed in when creating a product, the brand identity field generated by the merchant's customization. verified_listPermission list includes the correspondence between merchant number, category ID, and category name. verified_firm_code Merchant number segment, indicating the qualified barcode number segment under the merchant. verified_cate_listMerchant category list, including category ID and corresponding category name. verified_cate_id Merchant category ID, indicating the category ID that can be used to create merchants under this merchantverified_cate_name Merchant category name, corresponding category ID name

Note: Merchants tend to ignore verified_cate_id, causing the next step of product creation to fail.

Create products

Using this interface, merchants can create product information and set up product homepages, supporting both barcodes and QR codes. type. Currently, one account supports the creation of up to 100,000 product information.

Request example

HTTP请求方式:POSThttps://api.weixin.qq.com/scan/product/create?access_token=tT8VqJWVX4C-WvIG41tyelMclMZsAPFbLxbECsJvIghceqQCMB83hI5bxcInUR-amUrVsKq4bcBmF9PgooNrFA POST数据格式:JSON
POST数据例子:
{
 "keystandard": "ean13",
 "keystr": "6900000000000",
 "brand_info":{
  "base_info":{
   "title": "扫一扫动态主页demo",
"thumb_url":"http://mmbiz.qpic.cn/mmbiz/AhrnkhhK7rWevHib2pmq1phtply6JicADNrX6Yrvd7LzKERyic3kn3VdSsmFr5F5ibXzj9Al65yWFudmjqcWic1Qe9g/0",
   "brand_tag": "小耿哥8",
   "category_id": 0,
   "store_mgr_type": "auto",
   "store_vendorid_list":[],
   "color": "auto",
  },
  "detail_info":{
   "banner_list":[
{"link":"http://mmbiz.qpic.cn/mmbiz/AhrnkhhK7rWevHib2pmq1phtply6JicADNic0LvlkCw7s6mZpicib7ict5MhoiaL3gPrYXpibnibOpViaYJFpic12nx4bNZcQ/0",
"desc": "微信相框"},
{"link":"http://mmbiz.qpic.cn/mmbiz/AhrnkhhK7rWevHib2pmq1phtply6JicADNbTfwJmlVXp9k1A80UCFL1a9icwdthmSLh0RuJ5iaKcZBwdXbOicktkwPQ/0",
"desc": "微信相框"},
{"link":"http://mmbiz.qpic.cn/mmbiz/AhrnkhhK7rWevHib2pmq1phtply6JicADNW4FD74oXjEyqHicE9U3H0nTCdLHibo7rRia2TFBQ6tx2Pvic92ica8Wns4Q/0",
"desc": "微信相框"}
   ],
   "detail_list":[
    {
     "title": "产品名称",
     "desc": "微信相框moment"
    },
    {
     "title": "设计团队",
     "desc": "微信团队"
    },
    {
     "title": "设计初衷",
     "desc": "做一个简单纯粹的电子相框"
    },
    {
     "title": "产品诉求",
     "desc": "以相框为纽带,增加子女与父母长辈的沟通,用照片通过微信传递感情交流"
    }
   ]
  },
  "action_info":{
   "action_list":[
    {
     "type": "price",
     "retail_price":"12.00"
    },
    {
     "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"
    },
    {
     "type": "text",
     "text": "此处可根据品牌商需要,用于简单描述商品或活动。"
    }
   ]
  },
  "module_info":{
   "module_list":[
    {
     "type": "anti_fake",
     "native_show": "fales",
     "anti_fake_url": "weixin.qq.com"
    }
   ]
  }
 }
}

Request parameter description

The main structure of POST is brand_info, which contains basic product information There are four parts: base_info, product details information detail_info, promotion service information action_info and component information module_info.

微信扫一扫请求参数


Parameters Description
ParameterIs it requiredDescription
access_tokenYesGlobal credentials of the official account, used for interface calls.
keystandard is the product coding standard, supporting ean13, ean8 and qrcode standards.
keystr is the

product code content. Directly fill in the product barcode, the

standard is ean13, then directly fill in the product barcode, such as "6901939621608".

The standard is QRcode. The content of the QR code can be customized by the merchant. It is recommended to use product barcodes, ≤20 characters, consisting of large and small letters, numbers, underscores and hyphens.

Note: When the encoding standard is ean13, the encoding content must be under the merchant's number range, otherwise an error will be reported.

base_info is the basic information of the product.
detail_info is the detailed description information of the product.
action_info is the promotion service area information of product.
module_infoNoThe component information of the product.

base_info part

ParameterIs it necessaryDescription
titleYes It is recommended that the product name should not exceed 15 characters. The excess part will be displayed with ellipses on the client.
thumb_url is the product thumbnail, the recommended size is 180px*180px, the size does not exceed 50k, supports jpg, png, gif, jpeg Format.
brand_tag is the brand field, such as "Procter & Gamble Head & Shoulders", "P&G Rejoice".
category_id is the product category ID, which is obtained through the "Get Merchant Information" interface.
store_mgr_typeNoWhether the e-commerce channel for the product is displayed, the identification condition is the encoding content. auto means automatic, WeChat identifies the display channels; custom means customized, merchants can specify the channels in store_vendorid_list to appear.
store_vendorid_listNoE-commerce channel, if store_mgr_type is custom, you can choose from the following e-commerce channels: 2 is Amazon, 3 It is Dangdang.com, 4 is JD.com, 9 is Yihaodian, 11 is Jumei Youpin, 19 is Jiuxian.com
colorNoHome page header background color. Set "auto" or leave it blank to automatically pick the color; it also supports customizing the background color by passing in a hexadecimal color code. For example, "FFFFFF" represents pure white. Note: The color code does not recognize upper and lower case, and there is no need to pass in "#"

detail_info part

ParameterIs it necessaryDescription
banner_listYes Multiple images can be set for graphic and text details on the product details page.
link is the picture with graphic details in the product details page, 640px*320px, single ≤200k, supports jpg, png, gif, jpeg format, up to 6 photos can be uploaded.
descNoDescription of graphic and text details on the product details page, ≤80 Chinese characters.
detail_list is Multiple sets of product attributes can be set on the product details page.
title is the product attribute name in the product details page, ≤6 Chinese characters.
descNoThe product attribute content in the product details page must be ≤80 Chinese characters.

action_info part

##Is the parameter required?Descriptionaction_listYes Multiple service columns can be set on the product homepage. type is the type of service bar, Media, video playback; Text, text introduction; Link, picture jump; Link, normal Link; User, official account; Card, WeChat coupon; Price, recommended retail price; Product, WeChat store; Store, e-commerce link; recommendation, product recommendation.

Type: Video playback

ParameterIs it requiredDescription
type is the service bar type, and the parameter value of the video type is "media".
#link is the video link corresponding to . It only supports video content uploaded on v.qq.com. Please follow the JSON example for the format. .
image is the cover of the video corresponding to , the recommended size is 690px*320px, the size does not exceed 200k, supports jpg, png, gif, jpeg Format.

Type: text introduction

ParameterIs it necessaryExample valueDescription
type is the text service bar type.
nameNoProduct introductionThe title corresponding to the text introduction.
text is This can be used to briefly describe products or activities according to the needs of the brand owner. corresponds to the content of the text introduction.

Type: Image jump

ParameterIs it required?Description
type is the service bar type, and the parameter value of the image jump type is "link".
#link is the web link to the corresponding image.
image is the image link corresponding to . Please refer to the JSON example.
showtype is value is banner, required when setting the service bar of image jump type.

Type: Ordinary link

ParameterIs it necessaryExample valueDescription
type is the link service bar type.
name is the name of the View official website link entrance, no more than 12 Chinese characters.
#link is the web link corresponding to http://www.qq.com after the jump.
digestNoClick to view the guide on the right side of the service bar, no more than 5 Chinese characters.
Type: Public account

Parametertype

Type: WeChat Card Coupon

Is it requiredExample valueDescription
is the user service column type .
ParameterIs it necessaryExample valueDescription
type is the card service column type.
cardid ispbLatjlZyVY2XCKfIDULuD_J_PKICard and coupon must be a non-custom code (see the WeChat card and coupon interface document for concept description ).
digestNo Common to allThe guide on the right side of the service column should not exceed 5 Chinese characters.

Type: Suggested retail price

ParameterIs it requiredExample valueDescription
type is the price service column type.
retail_price is 12.00 represents the recommended retail price of the product, in "yuan".

Type: WeChat store

ParameterIs it necessaryExample valueDescription
type is the product service column type.
name is the name of the official website mall WeChat store entrance.
productid is the id of pLHCTjvXB6vIqUYUn51AWsK-sKA8 corresponding to the store product, which must be valid.
digestNoLimited time discountThe guide on the right side of the service bar should not exceed 5 Chinese characters.

Type: E-commerce link

ParameterIs it necessaryExample valueDescription
type is the store service column type.
name is the name of the Jingdong Mall e-commerce portal.
link is http://m.jd.com/product/14091549.html corresponding e-commerce The link is recommended to be a page where you can directly purchase the product.
sale_price is the price of 12.50, in yuan.

Type: Product recommendation

ParameterIs it necessaryDescription
typeYesService column type, product recommendation value is recommendation.
recommend_type is the way represents product recommendation. Currently, it only supports specified, and the value is appointed.
recommend_list is indicating a list of products to be recommended
keystandard is indicating the recommended product coding format.
keystr is the encoding content of indicating the recommended product.

JSON example of "Product Recommendation":

{
 "type": "recommend",
 "recommend": {
  "recommend_type": "appointed",
  "recommend_list": [
   {
    "keystandard": "ean13",
    "keystr": "6900000000001"
   },
   {
    "keystandard": "ean13",
    "keystr": "6900873042720"
   }
  ]
 }
}

module_info part

ParameterIs it necessaryDescription
module_listNo Multiple components can be set up in the future, but currently only anti-counterfeiting components are supported.
typeNoThe type of component, currently only includes the anti-counterfeiting component anti_fake.
native_showNoWhen set to true, the anti-counterfeiting results are displayed using the pop-up page provided by WeChat, and the merchant only needs to call "Product Management" Some component message interfaces return product authenticity information. When set to false, there will be no anti-counterfeiting pop-up window effect.
anti_fake_urlNo Anti-counterfeiting query link provided by the merchant, required when native_show is set to false.

Note:

1. In the action_info part of the promotion service area, the rules for the number of entries are as follows:

1) Set at least one promotion type;

2) There are three promotion types: text introduction, official account and WeChat coupons. Each type can only be set up to 1 respectively;

3) Ordinary link, official account and WeChat coupons A maximum of 3 types can be set in total for the three types;

4) Image jump links and video playback can only be displayed in one of two choices;

2. There must be at least one price information on the product homepage, and the price There are four display channels:

1) Define the store_mgr_type and store_vendorid_list fields in base_info. If the product is sold on the set e-commerce channel, there will be a sales entrance displayed in the [Purchase Area]. For example: "Yanghe - Sky Blue 480ml" is sold on "Jingdong Mall". If Jingdong Mall is in the e-commerce channel list set for this product, the sales entrance of "Jingdong Mall" will appear.

2) Set the productid in the WeChat store (Product) type, and the WeChat store sales entrance for the corresponding product will appear in the purchase area.

3)在电商链接(Store)类型中设置目标地址链接(link),购买区将出现所配置的外部商城售卖入口。

4)在建议零售价(Price)类型中设置retail_price字段。如果商品没有设置前文所述的任何一种购买渠道,也会有该商品建议零售价展示。

Return example

The correct JSON return result is as follows:

{
 "errcode": 0,
 "errmsg": "ok",
 "pid": "5g0B4A90aqc"
}

Return parameter description

##errcode0 means the call is successful, otherwise the relevant error code will be returned. errmsgok means the call is successful, otherwise an error message will be returned. pidThe translated product ID will be directly incorporated into the QR code content returned by the "Get Product QR Code Interface".
Parameters Description