WeChat Open Platform

Mini Programs Documentation

Get QR codes

Get Mini Program page QR codes

QR codes for any Mini Program page can be obtained through the backend interface. Scanning these QR codes enables you to directly enter the corresponding Mini Program page.

Get Mini Program codes

Interface address:

https://api.weixin.qq.com/wxa/getwxacode?access_token=ACCESS_TOKEN

POST parameter descriptions

Parameter Type Default value Description
path String Cannot be empty, maximum length 128 bytes
width Int 430 QR code width
auth_color Bool false Automatically configures line color. The instructions do not recommend configuring the main tone if the color is still black
line_color Object {"r":"0","g":"0","b":"0"} Takes effect when auth_color is false, uses rgb to set colors, for example {"r":"xxx","g":"xxx","b":"xxx"}

Get ordinary QR codes

Interface address:

https://api.weixin.qq.com/cgi-bin/wxaapp/createwxaqrcode?access_token=ACCESS_TOKEN

Refer to this document for more details on getting access_tokens.

POST parameter descriptions

Parameter Type Default value Description
path String Cannot be empty, maximum length 128 bytes
width Int 430 QR code width

Example:

{"path": "pages/index?query=1", "width": 430}

Note: pages/index needs to be defined in app.json pages.

Bugs & Tips

  1. tip: Only published Mini Program QR codes can be generated using this interface.
  2. tip: Development version QR codes with parameters can be generated when previewing in Developer Tools.
  3. tip: There are only 100,000 QR codes with parameters, please be careful when calling them.
  4. tip: POST parameters need to be converted into json strings, form submission is not supported.
  5. tip: auth_color line_color parameters are only effective for Mini Program codes.