Skip to content

Show QR

METHOD NAME showQR

This method is Cancelable.

Requires state IDLE and during process moves to PROMPT

Description

Display a QR code on the screen. This request responds immediately once the QR code on the custom screen is displayed. On a cancel event or when the specified timeout expires, the screen returns to the IDLE state.

Parameters

object

  • commandId string REQUIRED
    Id that is used as a reference to cancel the command

  • qrData string REQUIRED
    The data to show inside the QR code.

  • title string
    The title at the top of the screen is displayed to the user

  • body string
    The message body on the screen displayed to the user

  • timeout int
    Time in seconds until a response with a TIMEOUT result is returned.
    Default: 60 seconds. The value must be greater than zero

  • cancelable boolean
    A flag indicates if the user can cancel the operation from the selection screen. Default true

Result

null when a request is valid, and the QR is displayed

Errors

  • MissingParams
  • InvalidParams on incorrect OTP
  • IllegalState

Example

example

Request

{
  "jsonrpc": "2.0",
  "id": "1234567890",
  "method": "showQR",
    "params": {
        "commandId": "7d516d9c",
        "title": "Scan QR Code",
        "body": "Scan the QR code to get rewarded",
        "timeout": 30,
        "qrData": "https://docs.synqpay.com"
    }
}

Response

1
2
3
4
5
{
  "jsonrpc": "2.0",
  "id": "1234567890",
  "result": null
}