# Obtaining Merchant Information

This API is used to obtain the category and barcode segment of the account.

Request Example

HTTP request method: GET
https://api.weixin.qq.com/scan/merchantinfo/get?access_token=TOKEN

Request Parameters

Parameter Required Description
access_token Yes The global certificate of the Official Account, which can be used for the API call.

Response Example

The response JSON packet for a successful request:

{
 "errcode": 0,
 "errmsg": "ok",
 "brand_tag_list":[
  "Mr. Geng8",
  "testtag"
 ],
 "verified_list": [
  {
   "verified_firm_code": 69300570, 
   "verified_cate_list": [
    {
     "verified_cate_id": 538071212, 
     "verified_cate_name":"Food/Tea/Special local products/Food supplements"
     }
    ]
   }, 
   {
    "verified_firm_code": 123, 
    "verified_cate_list": [
     {
      "verified_cate_id": 538071212, 
      "verified_cate_name":"Food/Tea/Special local products/Food supplements"
     }
    ]
   }
  ] 
 }

Response Parameters

Parameter Description
errcode 0: Success. Otherwise, relevant error code is returned.
errmsg Ok: Success. Otherwise, relevant error message is returned.
brand_tag_list A list of brand tags, which are passed when a product is created. Merchants can customize the generated brand tag field.
verified_list Permission list, including the merchant's barcode segment, category ID, category name and their relationship.
verified_firm_code Verified barcode segment of the merchant
verified_cate_list A list of merchant categories, including category IDs and the category names.
verified_cate_id Merchant category ID for the created product
verified_cate_name Merchant category name, corresponding to the category ID.

Note: Merchants may ignore verified_cate_id, causing failure to create products in the next step.

# Creating Products

This API is used to create product information and set the product homepage via barcodes or QR codes. A maximum of 100,000 pieces of information can be created in an account.

Request Example

HTTP request method: POSThttps://api.weixin.qq.com/scan/product/create?access_token=TOKEN
POST data format: JSON
POST data example:
{
 "keystandard": "ean13",
 "keystr": "6900000000000",
 "brand_info":{
  "base_info":{
   "title": "Scan Dynamic Homepage Demo",
"thumb_url":"http://mmbiz.qpic.cn/mmbiz/AhrnkhhK7rWevHib2pmq1phtply6JicADNrX6Yrvd7LzKERyic3kn3VdSsmFr5F5ibXzj9Al65yWFudmjqcWic1Qe9g/0",
   "brand_tag": "Mr. Geng8",
   "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": "Weixin Photo Frame"},
{"link":"http://mmbiz.qpic.cn/mmbiz/AhrnkhhK7rWevHib2pmq1phtply6JicADNbTfwJmlVXp9k1A80UCFL1a9icwdthmSLh0RuJ5iaKcZBwdXbOicktkwPQ/0",
"desc": "Weixin Photo Frame"},
{"link":"http://mmbiz.qpic.cn/mmbiz/AhrnkhhK7rWevHib2pmq1phtply6JicADNW4FD74oXjEyqHicE9U3H0nTCdLHibo7rRia2TFBQ6tx2Pvic92ica8Wns4Q/0",
"desc": "Weixin Photo Frame"}
   ],
   "detail_list":[
    {
     "title": "Product Name",
     "desc": "Weixin Photo Framemoment"
    },
    {
     "title": "Design Team",
     "desc": "Weixin Team"
    },
    {
     "title": "Design Intention",
     "desc": "Make a simple e-frame"
    },
    {
     "title": "Product Demand",
     "desc": "Increase the communication and between children and parents via photos decorated by Weixin Photo Frame"
    }
   ]
  },
  "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": "Custom activity1",
     "link": "http://p.url.cn/wxscan.php",
    },
    {
     "type": "link",
     "name": "Custom activity2",
     "link": "http://p.url.cn/wxscan.php",
    },
    {
     "type": "user"
    },
    {
     "type": "text",
     "text": "Add product or activity description here according to the brand owner's demand."
    }
   ]
  },
  "module_info":{
   "module_list":[
    {
     "type": "anti_fake",
     "native_show": "fales",
     "anti_fake_url": "weixin.qq.com"
    }
   ]
  }
 }
}

Request Parameters

The main structure of POST is brand_info, which includes basic product information (base_info), product details (detail_info), service promotion information (action_info) and component information (module_info).

Parameter Required Description
access_token Yes The global certificate of the Official Account, which can be used for the API call.
keystandard Yes Product's coding standard, which supports EAN-13, EAN-8 and QRCode.
keystr Yes Product's code. Enter the product's barcode. For EAN-13 barcode, enter the product's barcode, such as "6901939621608". For QRCode QR code, The QR code content can be customized by merchants. It is recommended to use the product barcode. It should be not more than 20 characters, consisting of letters, numbers, underscores (_) and hyphens (-). Note: When the coding standard is EAN-13, the code must be within the merchant's barcode segment. Otherwise, an error may occur.
base_info Yes Basic product information
detail_info Yes Product details
action_info Yes Service promotion information
module_info No Component information

base_info

Parameter Required Description
title Yes Product name. The recommended length is not more than 15 Chinese characters (30 English characters), and an ellipsis (…) will be displayed at the end to indicate that there are extra characters.
thumb_url Yes Product thumbnail. The recommended dimension is 180*180 pixels and the size cannot exceed 50 KB. Supported formats: JPG, PNG, GIF, and JPEG.
brand_tag Yes Brand field, such as "P&G Head & Shoulders" and "P&G Rejoice".
category_id Yes Product category ID, obtained by the "Obtain Merchant Information" API.
store_mgr_type No Specifies whether to display the e-commerce channel of the product depending on the code. "auto" means the channel is specified automatically by Weixin; "custom" means channels in store_vendorid_list can be specified by merchants.
store_vendorid_list No E-commerce channel. If store_mgr_type is "custom", merchants can select from the following e-commerce channels: 2 indicates Amazon, 3 indicates Dangdang.com, 4 indicates JD.com, 9 indicates Yihaodian, 11 indicates Jumei.com, and 19 indicates Jiuxian.com.
color No Background color of the homepage header. If set as "auto" or left empty, the color is applied automatically. You can also customize the background color with a hexadecimal color code. For example, "FFFFFF" indicates pure white. Note: Color codes are case-insensative and no "#" is required.

detail_info

Parameter Required Description
banner_list Yes Multiple images can be set in article details in the product details page.
link Yes Images in article details in the product details page. The dimension shall be 640*320 pixels and the size of an image cannot exceed 200 KB. Supported formats: JPG, PNG, GIF, and JPEG. A maximum of 6 images can be uploaded.
desc No Description of the article details in the product details page, with a maximum length of 80 Chinese characters.
detail_list Yes Multiple product properties in article details
title Yes Product property name in the product details page, with a maximum length of 6 Chinese characters.
desc No Product property description in the product details page, with a maximum length of 80 Chinese characters.

action_info

Parameter Required Description
action_list Yes Multiple service columns in the product homepage
type Yes Service column type. Media: Video playback; Text: Text description; Link: image URL; Link: URL; User: Official Account; Card: Weixin cards/coupons; Price: Suggested retail price; Product: Weixin eShop; Store: E-commerce link; Recommend: Product recommendation.

Type: Media

Parameter Required Description
type Yes Service column type. The "media" value indicates the video type.
link Yes Video URL. Only videos uploaded on v.qq.com are supported. See the JSON example for the format.
image Yes Video cover. The recommended dimension is 690*320 pixels and the size cannot exceed 200 KB. Supported formats: JPG, PNG, GIF, and JPEG.

Type: Text

Parameter Required Example Description
type Yes text Service column type
name No Product description Title of the text description
text Yes A brief description of products or campaigns as needed by the brand owner Text description

Type: Link

Parameter Required Description
type Yes Service column type. The "link" value indicates the image URL type.
link Yes Webpage URL to redirect to
image Yes Image URL to redirect to. See the JSON example.
showtype Yes The value is "banner", which is required for the image URL type.

Type: Link

Parameter Required Example Description
type Yes link Service column type
name Yes View Official Website The URL name, with a maximum length of 12 Chinese characters.
link Yes http://www.qq.com Webpage URL to redirect to
digest No Tap to View The message on the right side of the service column, with a maximum length of 5 Chinese characters.

Type: User

Parameter Required Example Description
type Yes user Service column type

Type: Card

Parameter Required Example Description
type Yes card Service column type
cardid Yes pbLatjlZyVY2XCKfIDULuD_J_PKI The cards/coupons must be non-custom codes. (See Weixin Coupon APIs for more information)
digest No All-inclusive The message on the right side of the service column, with a maximum length of 5 Chinese characters.

Type: Price

Parameter Required Example Description
type Yes price Service column type
retail_price Yes 12.00 Indicates the suggested retail price (in CNY) of the product

Type: Product

Parameter Required Example Description
type Yes product Service column type
name Yes Official Mall The name of the Weixin eShop link
productid Yes pLHCTjvXB6vIqUYUn51AWsK-sKA8 The ID of products in eShop, which must be valid.
digest No Limited discount The message on the right side of the service column, with a maximum length of 5 Chinese characters.

Type: Store

Parameter Required Example Description
type Yes store Service column type
name Yes JD.com The name of the e-commerce platform
link Yes http://m.jd.com/product/14091549.html The URL to the e-commerce channel. The purchase page of the product is recommended.
sale_price Yes 12.50 The price (in CNY) of the product

Type: Recommend

Parameter Required Description
type Yes Service column type. The value "recommende" is recommended.
recommend_type Yes Indicates the way the product is recommended. Only the specified value "appointed" is supported.
recommend_list Yes Indicates a list of products for recommendation
keystandard Yes Indicates the recommended product's coding standard
keystr Yes Indicates the recommended product's code

JSON example of "Recommend":

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

module_info

Parameter Required Description
module_list No Multiple components, which contains anti-counterfeit component only.
type No Component type, which contains anti-counterfeit component "anti_fake" only.
native_show No If set to true, the authenticity result is displayed using the Weixin pop-up page. Merchants only need to call the component message API of "Product Management" to obtain the true or false result. If set to false, there is no authenticity result.
anti_fake_url No The anti-counterfeit query URL provided by merchants, which is required when native_show is set to false.

Note:

  1. For service promotion area (action_info), the entries must be set as follows:
  1. Set at least one promotion type;

  2. For text description, Official Accounts, and cards/coupons, you can set only one entry for each type;

  3. For common promotion URLs, Official Accounts, and cards/coupons, you can set at most three entries in total;

  4. Entries to image URLs and video playback cannot be set at the same time.

  1. There must be at least one price information in the product homepage. There are four types of price display channels:
  1. Define the store_mgr_type and store_vendorid_list fields in base_info. If the products are available for sale in the set e-commerce channel, there will be a sales entry displayed in "Purchasing Area". For example "Yanghe - Tianzhilan 480ml" is available for sale at JD.com. If JD.com is in the list of e-commerce channels of this product, JD.com entry appear in the page.

  2. Set productid in the Weixin eShop (Product) type. Weixin eShop entry will appear in the purchase area.

  3. Set the destination URL (Link) in the e-commerce link (Store) type. The configured external mall entry will appear in the purchasing area.

  4. Set the retail_price field in the suggested retail price (Price) type. If no channel mentioned previously is available for the product, a suggested retail price will appear.

Response Example

The response JSON packet for a successful request:

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

Response Parameters

Parameter Description
errcode 0: Success. Otherwise, relevant error code is returned.
errmsg Ok: Success. Otherwise, relevant error message is returned.
pid Product ID after translation, which will be directly incorporated into the QR code returned by calling the "Get Product QR Code" API.