Android QR scanner with UPI support
Stay organized with collections
Save and categorize content based on your preferences.
Android 13 (with backwards compatibility for Android 12) supports UPI
payment flows by adding a dedicated QR Code scanner that users can access
directly from the corresponding Quick Settings tile. Users can launch
a UPI payment flow by scanning a QR Code either from the live camera or from
a static image.

When multiple UPI apps are installed on a device, the user is presented
with a disambiguation dialog. The payment flow then continues in the app
selected by the user.
Note that the order of apps is not modified in any manner. Users' most
frequently used apps are prioritized by the OS and displayed first, similar to
the existing UPI intent dialog.
Support UPI intents from Android QR scanner
When a payment app is launched via this flow, the calling package ID is set
as com.google.android.gms. This value cannot be altered.
Payment apps need to verify this source and handle all the payment
flows initiated from this package ID to be treated as initiated by QR and
set the initiation mode to QR when sending data to the payee's PSP.
To distinguish between payments initiated from scanning a live QR Code (using
the camera) and scanning a QR Code image (photo on device), the QR scanner
passes an intent extra which helps identify the source of the QR Code.
Payment apps need to fetch the value of "intent extra" with the key
com.google.android.gms.UPI_QR_SOURCE
, and then compare with the following:
STATIC_IMAGE
string indicates that the source is a static image.
LIVE_CAMERA
string indicates that the source is the camera.
Key |
Value |
Explanation |
com.google.android.gms.UPI_QR_SOURCE |
STATIC_IMAGE
|
QR code image stored on the device. |
|
LIVE_CAMERA
|
QR code image captured live using the camera |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2023-05-31 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2023-05-31 UTC."],[],[],null,["# Android QR scanner with UPI support\n\nAndroid 13 (with backwards compatibility for Android 12) supports UPI\npayment flows by adding a dedicated QR Code scanner that users can access\ndirectly from the corresponding Quick Settings tile. Users can launch\na UPI payment flow by scanning a QR Code either from the live camera or from\na static image.\n\n\nWhen multiple UPI apps are installed on a device, the user is presented\nwith a disambiguation dialog. The payment flow then continues in the app\nselected by the user.\n\nNote that the order of apps is not modified in any manner. Users' most\nfrequently used apps are prioritized by the OS and displayed first, similar to\nthe existing UPI intent dialog.\n\nSupport UPI intents from Android QR scanner\n-------------------------------------------\n\nWhen a payment app is launched via this flow, the calling package ID is set\nas **com.google.android.gms**. This value cannot be altered.\n\nPayment apps need to **verify this source** and handle all the payment\nflows initiated from this package ID to be **treated as initiated by QR** and\n**set the initiation mode to QR when sending data to the payee's PSP**.\n\nTo distinguish between payments initiated from scanning a live QR Code (using\nthe camera) and scanning a QR Code image (photo on device), the QR scanner\npasses an intent **extra** which helps identify the source of the QR Code.\n\nPayment apps need to fetch the value of \"intent **extra** \" with the key\n`com.google.android.gms.UPI_QR_SOURCE`, and then compare with the following:\n\n- `STATIC_IMAGE` string indicates that the source is a static image.\n- `LIVE_CAMERA` string indicates that the source is the camera.\n\n|--------------------------------------|----------------|----------------------------------------------|\n| **Key** | **Value** | **Explanation** |\n| com.google.android.gms.UPI_QR_SOURCE | `STATIC_IMAGE` | QR code image stored on the device. |\n| | `LIVE_CAMERA` | QR code image captured live using the camera |"]]