/v2/miniprogram/qrcode/create
POST /v2/miniprogram/qrcode/create
The create
API is used to create the QR code value and return it to the merchant. The merchant then uses the QR code value to generate the URL of QR code images.
Message structure
Request
Property | Data type | Required | Description | Example |
appId | String | Yes | The Mini Program App ID. Max. length: 32 characters. | "P000000000000001xxxx" |
urlParameter | String | Yes | Is a page path that can be accessed by a Mini-Program, for example: Max. length: 256 characters. | "page/component/component-pages/view" |
queryParameter | String | Yes | The launch parameters for Mini Program. When Mini Program starts up, the Max. length: 64 characters. | "x=1" |
description | String | Yes | The QR code description. Max. length: 64 characters. | "My shop QR code" |
extendInfo | String | No | The extensive information. Wallets and merchants can put extensive information in this property. Max. length: 4096 characters. | "This is additional information" |
Response
Property | Data type | Required | Description | Example |
result | Yes | The request result, which contains like status and error codes. | { "resultCode": "SUCCESS", "resultStatus": "S", "resultMessage": "success" } | |
qrcode | String | Yes | The QR code value. Max. length: 1024 characters. | "https://miniprogram.alipay.com/mini-qr/28166612109YMP7RLw7zT2HU1k6AXzSOFfv4qu3xxxx" |
Result Process Logic
In the response, the result.resultStatus
field indicates the result of processing a request as follows.
resultStatus | Decription |
S | The request is sent successful. The QR code value is generated and and returned to the merchant. The merchant can use the QR code value to generate the URL of QR code images. The corresponding |
U | The API status is unknown. The corresponding For details, see the Common error codes section. |
F | The request fails to send. The corresponding |
Error codes
Error codes are usually classified into the following categories:
- Common error codes: are common for all Mini Program OpenAPIs.
- API-specific error codes: this OpenAPI does not have its dedicated error codes.
Sample

- Create the QR code value
- Return the generated QR code value to the merchant
Request
{
"appId": "P000000000000001xxxx",
"urlParameter": "page/component/component-pages/view",
"queryParameter": "x=1",
"description": "My shop QR code"
}
Response
{
"result": {
"resultCode":"SUCCESS",
"resultStatus":"S"
},
"qrcode": "https://miniprogram.alipay.com/mini-qr/28166612109YMP7RLw7zT2HU1k6AXzSOFfv4qu3xxxx"
}