Mini Apps

generateShortLink

Create a short link that opens a Mini App on a specific page.

Overview

POST /v1/miniapps/qrCode/generate creates a short link that opens one of your Mini Apps on a specific page, with an optional query string. Use it when you need a shareable link at runtime — for a campaign, a receipt, a printed QR code, or a referral — instead of hand-assembling a deep link.

The link is returned in the appQrCode field and can be shared with users directly, unlike the raw qicardwallet:// deep link URI.

This is an Open API and must be called from your merchant backend, never from the Mini App client. It requires your signed merchant credentials.

Endpoint

MethodPath
POST/v1/miniapps/qrCode/generate

API Structure

A message consists of a header and body. The following sections are focused on the body structure. For the header structure, see: OpenAPIs Overview.

Request

FieldTypeRequiredDescriptionExample
requestIdstringYesYour own unique identifier for this request."3488020278850353"
appIdstringYesThe Mini App the link should open, from the Miniapps console."683288259"
appQrCodePagestringYesThe page within the Mini App. Must start with /."/pages/shop/index"
appQrCodeParamsstringNoQuery string passed to the page."shopId=1329"
appQrCodeDescstringNoA label for the link, used to identify it later."Shop landing page"
{
  "requestId": "3488020278850353",
  "appId": "683288259",
  "appQrCodePage": "/pages/shop/index",
  "appQrCodeParams": "shopId=1329",
  "appQrCodeDesc": "Shop landing page"
}
appQrCodePage must start with a forward slash (/). A path such as pages/shop/index is rejected.

Response

FieldTypeRequiredDescription
resultobjectYesOutcome metadata containing status and error codes.
appQrCodestringNoThe generated short link. Returned when result.resultStatus is S.
{
  "result": {
    "resultCode": "SUCCESS",
    "resultStatus": "S",
    "resultMessage": "success"
  },
  "appQrCode": "https://link.qi.iq/ref/d6p57826"
}
The exact form of the returned link is assigned by the gateway. Store and share the value as returned rather than reconstructing it — see Deep Links for the short link formats and the deep link URIs they resolve to.

Result Processing Logic

StatusDescription
SLink generated. Use the value in appQrCode.
UResult unknown (resultCode: UNKNOWN_EXCEPTION). Retry with the same requestId, or review Common error codes.
FGeneration failed. Inspect resultCode and see Common error codes.

Example Request

POST /v1/miniapps/qrCode/generate HTTP/1.1
Host: {gateway-host}
Content-Type: application/json; charset=UTF-8
Client-Id: 2021001234567890
Request-Time: 2024-01-01T12:00:00-07:00
Signature: algorithm=RSA256, keyVersion=1, signature={base64Signature}

{"requestId":"3488020278850353","appId":"683288259","appQrCodePage":"/pages/shop/index","appQrCodeParams":"shopId=1329","appQrCodeDesc":"Shop landing page"}

The Signature header is generated over the method, path, client ID, request time and the request body, as described in Signature Generation. For the request above, the sign content is:

POST /v1/miniapps/qrCode/generate
2021001234567890.2024-01-01T12:00:00-07:00.{"requestId":"3488020278850353","appId":"683288259","appQrCodePage":"/pages/shop/index","appQrCodeParams":"shopId=1329","appQrCodeDesc":"Shop landing page"}
The body must be transmitted byte-for-byte as it was signed. Re-serializing the JSON after signing — reordering keys, changing whitespace, or re-escaping characters — invalidates the signature and the gateway rejects the request.