UPI Intent - Non SDK Flow
The Non SDK implementation for finding the UPI supported application in the customer's device. The following steps will help you first find the application installed in the customer's device supporting smart intent.
You can use PayU APIs to initiate the transaction and get the Intent payment URI which includes payment details required for the PSP app customer will select for payment. After completion of payment by the customer, you can verify the transaction using the Verify Payment API. The following steps are required to enable Smart Intent-based UPI payment in your application.
Important UPI Integration Changes as per NPCI Mandate on UPI Collect Disablement
Recommended: For easier integration, merchants can use PayU SDKs for Android and iOS, which have the Smart Intent implementation built-in:
- Android UPI SDK - Supports Collect, Intent, and In-App flows with Smart Intent
- Android CheckoutPro SDK - Complete checkout solution with Smart Intent
- iOS UPI SDK - Supports Intent and Collect payments
- iOS CheckoutPro SDK - Complete checkout solution for iOS
Smart Intent Flow
Notes:
- Smart Intent flow works only on Android device.
- As per NPCI mandate, Pay by any UPI App option must be shown by all the merchants in their app on all Android devices (app/m-web/webview), Use the generic deeplink, without specific
packageNameto trigger the Pay by any UPI app.
Workflow
Steps to integrate
Update Manifest File [One-Time]
Add package ids in your apps manifest file to allow your application to access apps installed on the customer's device. This is required for Android 11 and above.
<queries>
<package android:name="in.amazon.mShop.android.shopping"/>
<package android:name="com.upi.axispay"/>
<package android:name="com.axis.mobile"/>
<package android:name="com.fisglobal.bandhanupi.app"/>
<package android:name="com.bankofbaroda.upi"/>
<package android:name="in.org.npci.upiapp"/>
<package android:name="com.canarabank.mobility"/>
<package android:name="com.citiuat"/>
<package android:name="com.dbs.in.digitalbank"/>
<package android:name="com.olive.dcb.upi"/>
<package android:name="com.finopaytech.bpayfino"/>
<package android:name="com.freecharge.android"/>
<package android:name="com.google.android.apps.nbu.paisa.user"/>
<package android:name="com.snapwork.hdfc"/>
<package android:name="com.mgs.hsbcupi"/>
<package android:name="com.csam.icici.bank.imobile"/>
<package android:name="com.icicibank.pockets"/>
<package android:name="com.euronet.iobupi"/>
<package android:name="com.mgs.induspsp"/>
<package android:name="com.fss.jnkpsp"/>
<package android:name="com.jio.myjio"/>
<package android:name="com.mycompany.kvb"/>
<package android:name="com.kvb.mobilebanking"/>
<package android:name="com.lcode.smartz"/>
<package android:name="com.msf.kbank.mobile"/>
<package android:name="com.upi.federalbank.org.lotza"/>
<package android:name="com.infrasofttech.mahaupi"/>
<package android:name="com.mipay.in.wallet"/>
<package android:name="com.myairtelapp"/>
<package android:name="com.mobikwik_new"/>
<package android:name="com.onymy.paybee.prod"/>
<package android:name="net.one97.paytm"/>
<package android:name="com.phonepe.app"/>
<package android:name="com.Version1"/>
<package android:name="com.samsung.android.spay"/>
<package android:name="com.sbi.upi"/>
<package android:name="com.SIBMobile"/>
<package android:name="com.truecaller"/>
<package android:name="com.infrasoft.uboi"/>
<package android:name="com.lcode.ucoupi"/>
<package android:name="com.YesBank"/>
<package android:name="com.dreamplug.androidapp"/>
<package android:name="money.bullet"/>
</queries>Step 1: Fetch the List of UPI and Smart Intent Supported Apps
You need to get the list of UPI and smart intent supported applications installed in the device.
private fun getSmartIntentUPIApps(context: Context?):ArrayList<HashMap<String,String>>?{
val upiApps = ArrayList<HashMap<String, String>>()
if (context == null)
return null
val intent = Intent()
intent.data = Uri.parse("upi://pay")
val activityList = context.packageManager.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY)
for (resolveInfo in activityList){
var packageInfo: PackageInfo? = null
try {
packageInfo = context.packageManager
.getPackageInfo(resolveInfo.activityInfo.packageName, 0)
val name =
context.packageManager.getApplicationLabel(packageInfo.applicationInfo) as String
val appInfo = HashMap<String, String?>()
appInfo["bankName"] = name ?: "NA"
appInfo["packageName"] = packageInfo.packageName
upiApps.add(appInfo)
} catch (e: PackageManager.NameNotFoundException) {
e.printStackTrace()
return upiApps
}
}
return UPI apps
}
/* to get icon of psp app*/
fun getUpiAppBitmap(context: Context?, packageName: String): Bitmap? {
var upiAppBitmap: Bitmap? = null
if (context == null)
return upiAppBitmap
upiAppBitmap = context.packageManager.getApplicationIcon(packageName).toBitmap()
return upiAppBitmap
}
Step 2: Get Intent URI
Use the _payment API to get Intent URI and transaction details for the UPI app selected by the customer. For more information, refer to UPI Intent with S2S Integration.
Request Parameters
| Parameter | Description | Example |
|---|---|---|
keymandatory | String Merchant key provided by PayU during onboarding. | JPg****f |
txnidmandatory | String The transaction ID is a reference number for a specific order that is generated by the merchant. | ypl938459435 |
amountmandatory | String The payment amount for the transaction. | 10.00 |
productinfomandatory | String A brief description of the product. | iPhone |
firstnamemandatory | String The first name of the customer. | Ashish |
lastnamemandatory | String The last name of the customer. | Kumar |
emailmandatory | String The email address of the customer. | [email protected] |
phonemandatory | String The phone number of the customer. | |
address1optional but recommended for higher approval rate | String The first line of the billing address. H.No- 17, Block C, Kalyan Bldg, Khardilkar Road, Mumbai Note: This information is helpful when it comes to issues related to fraud detection and chargebacks. Hence, it is must to provide the correct information. | 34 Saikripa-Estate, Tilak Nagar |
address2optional but recommended for higher approval rate | String The second line of the billing address. | |
cityoptional but recommended for higher approval rate | String The city where your customer resides as part of the billing address. | Mumbai |
stateoptional but recommended for higher approval rate | String The state where your customer resides as part of the billing address. | Maharashtra |
countryoptional but recommended for higher approval rate | String The country where your customer resides. | India |
zipcodemandatory | String Billing address zip code is mandatory for the cardless EMI option. Character Limit-20 | 400004 |
pgmandatory for seamless/s2s flow | String It defines the payment category and post UPI. | UPI |
bankcodemandatory for seamless/s2s flow | String Each payment option is identified with a unique bank code at PayU. For UPI Autopay, post UPI. | UPI |
surlmandatory | String The success URL, which is the page PayU will redirect to if the transaction is successful. | |
furlmandatory | String The Failure URL, which is the page PayU will redirect to if the transaction is failed. | |
vpa conditional | String Customer's VPA handle. Mandatory for UPI Collect flow. | customer@upi |
si mandatory | String Signifies successful consent taken from the user. Must be 1 for subscription setup. | 1 |
si_details mandatory | JSON String JSON object containing mandate details (billingAmount, billingCurrency, billingCycle, etc.). Refer to si_details JSON Object below. | See si_details accordion |
txn_s2s_flow conditional | Integer Parameter to enable S2S flow. Must be 4 for Legacy Decoupled flow (UPI Intent). | 4 |
s2s_client_ip conditional | String Source IP of the customer. Required for UPI Intent flow. | 10.200.12.12 |
s2s_device_info conditional | String Customer agent's device information. Required for UPI Intent flow. | Mozilla/5.0 (Windows NT 10.0; Win64; x64) |
udf1mandatory if AD bank request this detail | String This parameter must contain the Buyer's PAN and date of birth in the following format (separated by two pipe characters): Buyer's PAN\|\|Buyer'sDOB | AAAPZ1234C\|\|22/08/1972 |
udf3mandatory if AD bank request this detail | String This parameter must contain the invoice ID of the transaction (generated by the merchant) and merchant name in the following format (separated by two pipe characters): Invoice ID\|\|MerchantName | INV-123_1231\|\|MerchantName |
buyer_type_business optional in case of B2B transaction for cross-border payments | Binary To be sent as "1" in case the buyer is a business. In case of individual buyers, it can be skipped. Default is "0". Note: This will be included in hash if posted (covered in next section | 1 |
Sample Request
curl --location 'https://test.payu.in/_payment' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'key=PRiQvJ' \
--data-urlencode 'txnid=my_order_991' \
--data-urlencode 'amount=1' \
--data-urlencode 'productinfo=my_order_991' \
--data-urlencode 'email=' \
--data-urlencode 'phone=9368252248' \
--data-urlencode 'txn_s2s_flow=4' \
--data-urlencode 'hash=||||||ABCDE1234F||1990-01-01||INV123456||||||' \
--data-urlencode 'surl=https://test.payu.in/admin/test_response' \
--data-urlencode 'furl=https://test.payu.in/admin/test_response' \
--data-urlencode 'udf1=buyer'\''s DOB' \
--data-urlencode 'udf2=' \
--data-urlencode 'udf3=buyer'\''s PAN' \
--data-urlencode 'udf4=' \
--data-urlencode 'udf5=invoice number' \
--data-urlencode 's2s_client_ip=10.200.12.12' \
--data-urlencode 's2s_device_info=Mozilla/5.0 (Windows NT 10.0; Win64; x64) PayU-API-Test/1.0' \
--data-urlencode 'firstname=' \
--data-urlencode 'lastname=kr' \
--data-urlencode 'address1=308,third floor' \
--data-urlencode 'address2=testing' \
--data-urlencode 'city=Gurugram' \
--data-urlencode 'state=UP' \
--data-urlencode 'country=India' \
--data-urlencode 'zipcode=122018' \
--data-urlencode 'pg=UPI' \
--data-urlencode 'bankcode=INTENT' \
--data-urlencode 'upiAppName=gpay/phonepe/paytm/qr/amazonpay' \
--data-urlencode 'udf_params={"udf7":"asdf","udf8":"12"}' \
--data-urlencode 'buyer_type_business=1'Step 3: Retrieve Deeplink(uriIntentData) from the response,
If metaData.unmappedStatus = pending, then get the result.intentURIData and add the prefix upi://pay?to make it to create a fully qualified deeplink to trigger the UPI App.
{
"metaData": {
"message": null,
"referenceId": "c99a6455b3e0dc5cd7167ab8c8cc10d2fa153cb509e3f64c6cd0ed9c5b64a8c9",
"statusCode": null,
"txnId": "my_order_26075",
"txnStatus": "pending",
"unmappedStatus": "pending"
},
"result": {
"paymentId": "403993715535965242",
"merchantName": "Sudhanshu",
"merchantVpa": "payutest@hdfcbank",
"amount": "1.00",
"intentURIData": "pa=payutest@hdfcbank&pn=Kumar&tr=403993715535965242&tid=PPPL403993715535965242080126220900&am=1.00&cu=INR&tn=UPIIntent",
"acsTemplate": "PGh0bWw+PGJvZHk+PGZvcm0gbmFtZT0icGF5bWVudF9wb3N0IiBpZD0icGF5bWVudF9wb3N0IiBhY3Rpb249Imh0dHBzOi8vdGVzdC5wYXl1LmluL2M5OWE2NDU1YjNlMGRjNWNkNzE2N2FiOGM4Y2MxMGQyYzgzYTk5NmFhNDhiYTk4MmZjMGQ4MTI1MGY1ODgxZjMvaW50ZW50U2VhbWxlc3NIYW5kbGVyLnBocCIgbWV0aG9kPSJwb3N0Ij48aW5wdXQgdHlwZT0iaGlkZGVuIiBuYW1lPSJ0b2tlbiIgdmFsdWU9IjhERDNFRUFFLUI5NTktQzY1RS03MDczLTYzQTNGQUUxMjZGRiI+PGlucHV0IHR5cGU9ImhpZGRlbiIgbmFtZT0iYW1vdW50IiB2YWx1ZT0iMS4wMCI+PGlucHV0IHR5cGU9ImhpZGRlbiIgbmFtZT0ibWlocGF5aWQiIHZhbHVlPSJjOTlhNjQ1NWIzZTBkYzVjZDcxNjdhYjhjOGNjMTBkMmZhMTUzY2I1MDllM2Y2NGM2Y2QwZWQ5YzViNjRhOGM5Ij48aW5wdXQgdHlwZT0iaGlkZGVuIiBuYW1lPSJkaXNhYmxlSW50ZW50U2VhbWxlc3NGYWlsdXJlIiB2YWx1ZT0iMCI+PGlucHV0IHR5cGU9ImhpZGRlbiIgbmFtZT0icGF5ZWVWcGEiIHZhbHVlPSJwYXl1dGVzdEBoZGZjYmFuayI+PGlucHV0IHR5cGU9ImhpZGRlbiIgbmFtZT0icGF5ZWVOYW1lIiB2YWx1ZT0iU3VkaGFuc2h1Ij48aW5wdXQgdHlwZT0iaGlkZGVuIiBuYW1lPSJhZGRpdGlvbmFsQ2hhcmdlcyIgdmFsdWU9IjAiPjxpbnB1dCB0eXBlPSJoaWRkZW4iIG5hbWU9InRyYW5zYWN0aW9uRmVlIiB2YWx1ZT0iMS4wMCI+PC9mb3JtPjxzY3JpcHQgdHlwZT0ndGV4dC9qYXZhc2NyaXB0Jz4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvdy5vbmxvYWQ9ZnVuY3Rpb24oKXsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5mb3Jtc1sncGF5bWVudF9wb3N0J10uc3VibWl0KCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIDwvc2NyaXB0PjwvYm9keT48L2h0bWw+",
"otpPostUrl": "https://test.payu.in/ResponseHandler.php"
}
}Step 4: Set the Package Name
Set the packageName as per the app selected by the customer on your checkout page. and start the activity.
fun makePayment(packageName: String,mActivity: Activity,intentUri:String) {
val i = Intent()
i.setPackage(packageName)
i.action = Intent.ACTION_VIEW
i.data = Uri.parse("upi://pay" + intentUri)
if (null != mActivity && !mActivity.isFinishing() && !mActivity.isDestroyed()) {
mActivity.startActivityForResult(i, 101)
}
}Step 5: Handle the response
Once the user completes the payment the UPI app will be closed, and then handle the response onActivityResult.
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
if (requestCode == 101) {
data?.getStringExtra("Status")?.let { Log.d("result", it) }
data?.getStringExtra("response")?.let { Log.d("response", it) }
//get Status
//if Status == Success
// Call Verify Payemnt//
}
}Step 6: Verify the payment
Upon receiving the response, PayU recommends you performing a reconciliation step to validate all transaction details. You can verify your payments using either of the following methods:
Configure the webhooks to monitor the status of payments.
Webhooks enable a server to communicate with another server by sending an HTTP callback or message.
These callbacks are triggered by specific events or instances and operate at the server-to-server (S2S) level.
👉 For more details, refer to Webhooks for Payments.
Specific Intent Flow
Notes: Specific Intent flow works with m-web, Webview, Android or iOS apps. As per NPCI mandate, Pay by any UPI App option must be shown by all the merchants in their app on all Android devices (app/m-web/webview), Use the generic deeplink, without specific
packageNameto trigger the Pay by any UPI app.
Workflow
Steps to Integrate
Step 1: Fetch the List of UPI and Smart Intent Supported Apps
You need to get the list of UPI and smart intent supported applications installed in the device.
private fun getSmartIntentUPIApps(context: Context?):ArrayList<HashMap<String,String>>?{
val upiApps = ArrayList<HashMap<String, String>>()
if (context == null)
return null
val intent = Intent()
intent.data = Uri.parse("upi://pay")
val activityList = context.packageManager.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY)
for (resolveInfo in activityList){
var packageInfo: PackageInfo? = null
try {
packageInfo = context.packageManager
.getPackageInfo(resolveInfo.activityInfo.packageName, 0)
val name =
context.packageManager.getApplicationLabel(packageInfo.applicationInfo) as String
val appInfo = HashMap<String, String?>()
appInfo["bankName"] = name ?: "NA"
appInfo["packageName"] = packageInfo.packageName
upiApps.add(appInfo)
} catch (e: PackageManager.NameNotFoundException) {
e.printStackTrace()
return upiApps
}
}
return UPI apps
}
/* to get icon of psp app*/
fun getUpiAppBitmap(context: Context?, packageName: String): Bitmap? {
var upiAppBitmap: Bitmap? = null
if (context == null)
return upiAppBitmap
upiAppBitmap = context.packageManager.getApplicationIcon(packageName).toBitmap()
return upiAppBitmap
}
Step 2: Get Intent URI
Use the _payment API to get Intent URI and transaction details for the UPI app selected by the customer. For more information, refer to UPI Intent with S2S Integration.
Request Parameters
| Parameter | Description | Example |
|---|---|---|
keymandatory | String Merchant key provided by PayU during onboarding. | JPg****f |
txnidmandatory | String The transaction ID is a reference number for a specific order that is generated by the merchant. | ypl938459435 |
amountmandatory | String The payment amount for the transaction. | 10.00 |
productinfomandatory | String A brief description of the product. | iPhone |
firstnamemandatory | String The first name of the customer. | Ashish |
lastnamemandatory | String The last name of the customer. | Kumar |
emailmandatory | String The email address of the customer. | [email protected] |
phonemandatory | String The phone number of the customer. | |
address1optional but recommended for higher approval rate | String The first line of the billing address. H.No- 17, Block C, Kalyan Bldg, Khardilkar Road, Mumbai Note: This information is helpful when it comes to issues related to fraud detection and chargebacks. Hence, it is must to provide the correct information. | 34 Saikripa-Estate, Tilak Nagar |
address2optional but recommended for higher approval rate | String The second line of the billing address. | |
cityoptional but recommended for higher approval rate | String The city where your customer resides as part of the billing address. | Mumbai |
stateoptional but recommended for higher approval rate | String The state where your customer resides as part of the billing address. | Maharashtra |
countryoptional but recommended for higher approval rate | String The country where your customer resides. | India |
zipcodemandatory | String Billing address zip code is mandatory for the cardless EMI option. Character Limit-20 | 400004 |
pgmandatory for seamless/s2s flow | String It defines the payment category and post UPI. | UPI |
bankcodemandatory for seamless/s2s flow | String Each payment option is identified with a unique bank code at PayU. For UPI Autopay, post UPI. | UPI |
surlmandatory | String The success URL, which is the page PayU will redirect to if the transaction is successful. | |
furlmandatory | String The Failure URL, which is the page PayU will redirect to if the transaction is failed. | |
vpa conditional | String Customer's VPA handle. Mandatory for UPI Collect flow. | customer@upi |
si mandatory | String Signifies successful consent taken from the user. Must be 1 for subscription setup. | 1 |
si_details mandatory | JSON String JSON object containing mandate details (billingAmount, billingCurrency, billingCycle, etc.). Refer to si_details JSON Object below. | See si_details accordion |
txn_s2s_flow conditional | Integer Parameter to enable S2S flow. Must be 4 for Legacy Decoupled flow (UPI Intent). | 4 |
s2s_client_ip conditional | String Source IP of the customer. Required for UPI Intent flow. | 10.200.12.12 |
s2s_device_info conditional | String Customer agent's device information. Required for UPI Intent flow. | Mozilla/5.0 (Windows NT 10.0; Win64; x64) |
udf1mandatory if AD bank request this detail | String This parameter must contain the Buyer's PAN and date of birth in the following format (separated by two pipe characters): Buyer's PAN\|\|Buyer'sDOB | AAAPZ1234C\|\|22/08/1972 |
udf3mandatory if AD bank request this detail | String This parameter must contain the invoice ID of the transaction (generated by the merchant) and merchant name in the following format (separated by two pipe characters): Invoice ID\|\|MerchantName | INV-123_1231\|\|MerchantName |
buyer_type_business optional in case of B2B transaction for cross-border payments | Binary To be sent as "1" in case the buyer is a business. In case of individual buyers, it can be skipped. Default is "0". Note: This will be included in hash if posted (covered in next section | 1 |
Sample Request
curl --location 'https://test.payu.in/_payment' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'key=PRiQvJ' \
--data-urlencode 'txnid=my_order_991' \
--data-urlencode 'amount=1' \
--data-urlencode 'productinfo=my_order_991' \
--data-urlencode 'email=' \
--data-urlencode 'phone=9368252248' \
--data-urlencode 'txn_s2s_flow=4' \
--data-urlencode 'hash=||||||ABCDE1234F||1990-01-01||INV123456||||||' \
--data-urlencode 'surl=https://test.payu.in/admin/test_response' \
--data-urlencode 'furl=https://test.payu.in/admin/test_response' \
--data-urlencode 'udf1=buyer'\''s DOB' \
--data-urlencode 'udf2=' \
--data-urlencode 'udf3=buyer'\''s PAN' \
--data-urlencode 'udf4=' \
--data-urlencode 'udf5=invoice number' \
--data-urlencode 's2s_client_ip=10.200.12.12' \
--data-urlencode 's2s_device_info=Mozilla/5.0 (Windows NT 10.0; Win64; x64) PayU-API-Test/1.0' \
--data-urlencode 'firstname=' \
--data-urlencode 'lastname=kr' \
--data-urlencode 'address1=308,third floor' \
--data-urlencode 'address2=testing' \
--data-urlencode 'city=Gurugram' \
--data-urlencode 'state=UP' \
--data-urlencode 'country=India' \
--data-urlencode 'zipcode=122018' \
--data-urlencode 'pg=UPI' \
--data-urlencode 'bankcode=INTENT' \
--data-urlencode 'upiAppName=gpay/phonepe/paytm/qr/amazonpay' \
--data-urlencode 'udf_params={"udf7":"asdf","udf8":"12"}' \
--data-urlencode 'buyer_type_business=1'Step 3: Retrieve Deeplink(uriIntentData) from the response,
If metaData.unmappedStatus = pending, then get the result.intentURIData and add the prefix upi://pay?to make it to create a fully qualified deeplink to trigger the UPI App.
{
"metaData": {
"message": null,
"referenceId": "c99a6455b3e0dc5cd7167ab8c8cc10d2fa153cb509e3f64c6cd0ed9c5b64a8c9",
"statusCode": null,
"txnId": "my_order_26075",
"txnStatus": "pending",
"unmappedStatus": "pending"
},
"result": {
"paymentId": "403993715535965242",
"merchantName": "Sudhanshu",
"merchantVpa": "payutest@hdfcbank",
"amount": "1.00",
"intentURIData": "pa=payutest@hdfcbank&pn=Kumar&tr=403993715535965242&tid=PPPL403993715535965242080126220900&am=1.00&cu=INR&tn=UPIIntent",
"acsTemplate": "PGh0bWw+PGJvZHk+PGZvcm0gbmFtZT0icGF5bWVudF9wb3N0IiBpZD0icGF5bWVudF9wb3N0IiBhY3Rpb249Imh0dHBzOi8vdGVzdC5wYXl1LmluL2M5OWE2NDU1YjNlMGRjNWNkNzE2N2FiOGM4Y2MxMGQyYzgzYTk5NmFhNDhiYTk4MmZjMGQ4MTI1MGY1ODgxZjMvaW50ZW50U2VhbWxlc3NIYW5kbGVyLnBocCIgbWV0aG9kPSJwb3N0Ij48aW5wdXQgdHlwZT0iaGlkZGVuIiBuYW1lPSJ0b2tlbiIgdmFsdWU9IjhERDNFRUFFLUI5NTktQzY1RS03MDczLTYzQTNGQUUxMjZGRiI+PGlucHV0IHR5cGU9ImhpZGRlbiIgbmFtZT0iYW1vdW50IiB2YWx1ZT0iMS4wMCI+PGlucHV0IHR5cGU9ImhpZGRlbiIgbmFtZT0ibWlocGF5aWQiIHZhbHVlPSJjOTlhNjQ1NWIzZTBkYzVjZDcxNjdhYjhjOGNjMTBkMmZhMTUzY2I1MDllM2Y2NGM2Y2QwZWQ5YzViNjRhOGM5Ij48aW5wdXQgdHlwZT0iaGlkZGVuIiBuYW1lPSJkaXNhYmxlSW50ZW50U2VhbWxlc3NGYWlsdXJlIiB2YWx1ZT0iMCI+PGlucHV0IHR5cGU9ImhpZGRlbiIgbmFtZT0icGF5ZWVWcGEiIHZhbHVlPSJwYXl1dGVzdEBoZGZjYmFuayI+PGlucHV0IHR5cGU9ImhpZGRlbiIgbmFtZT0icGF5ZWVOYW1lIiB2YWx1ZT0iU3VkaGFuc2h1Ij48aW5wdXQgdHlwZT0iaGlkZGVuIiBuYW1lPSJhZGRpdGlvbmFsQ2hhcmdlcyIgdmFsdWU9IjAiPjxpbnB1dCB0eXBlPSJoaWRkZW4iIG5hbWU9InRyYW5zYWN0aW9uRmVlIiB2YWx1ZT0iMS4wMCI+PC9mb3JtPjxzY3JpcHQgdHlwZT0ndGV4dC9qYXZhc2NyaXB0Jz4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvdy5vbmxvYWQ9ZnVuY3Rpb24oKXsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5mb3Jtc1sncGF5bWVudF9wb3N0J10uc3VibWl0KCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIDwvc2NyaXB0PjwvYm9keT48L2h0bWw+",
"otpPostUrl": "https://test.payu.in/ResponseHandler.php"
}
}Step 4: Add the prefix
Add the prefix as per the Android/IOS to it to create a fully qualified deeplink to trigger the UPI App.
Android Specific Intent prefix
androidPrefix="intent://pay?"
intentUriData="pa=myntra.payu@axisbank&pn=NIMIT%20BHATIA&tr=26156866365&tid=PPPL2615686636525112512114769254fab&am=10.00&cu=INR&tn=UPIIntent"
suffix = "#Intent;scheme=upi;package=<package name>;"
suffixForFallback="S.browser_fallback_url=<base64decoded result.acsTemplate can be used to redirect to Payu for UPI fallback>;end"
//use androidPrefix+intentUriData+suffix+suffixForFallback to trigger the App in specific deeplink integrationIOS Specific Intent prefix (Limited availability)
phonepe = phonepe://upi/pay?
paytm = paytm://upi/pay?
googlepay = gpay://upi/pay?
bhim = bhim://upi/pay?
credpay = credpay://upi/pay?Step 5: Verify the payment
Upon receiving the response, PayU recommends you performing a reconciliation step to validate all transaction details. You can verify your payments using either of the following methods:
Configure the webhooks to monitor the status of payments.
Webhooks enable a server to communicate with another server by sending an HTTP callback or message.
These callbacks are triggered by specific events or instances and operate at the server-to-server (S2S) level.
👉 For more details, refer to Webhooks for Payments.
UPI Online QR
This section describes how to integrate UPI Online QR which will help you generate QR on your eCommerce website so that your customers can make payment from any UPI app.
Workflow
Steps to Integrate
Step 1: Initiate Payment
Use the _payment API to collect payment. For more information, refer to UPI Intent with S2S Integration.
Request Parameters
| Parameter | Description | Example |
|---|---|---|
keymandatory | String Merchant key provided by PayU during onboarding. | JPg****f |
txnidmandatory | String The transaction ID is a reference number for a specific order that is generated by the merchant. | ypl938459435 |
amountmandatory | String The payment amount for the transaction. | 10.00 |
productinfomandatory | String A brief description of the product. | iPhone |
firstnamemandatory | String The first name of the customer. | Ashish |
lastnamemandatory | String The last name of the customer. | Kumar |
emailmandatory | String The email address of the customer. | [email protected] |
phonemandatory | String The phone number of the customer. | |
address1optional but recommended for higher approval rate | String The first line of the billing address. H.No- 17, Block C, Kalyan Bldg, Khardilkar Road, Mumbai Note: This information is helpful when it comes to issues related to fraud detection and chargebacks. Hence, it is must to provide the correct information. | 34 Saikripa-Estate, Tilak Nagar |
address2optional but recommended for higher approval rate | String The second line of the billing address. | |
cityoptional but recommended for higher approval rate | String The city where your customer resides as part of the billing address. | Mumbai |
stateoptional but recommended for higher approval rate | String The state where your customer resides as part of the billing address. | Maharashtra |
countryoptional but recommended for higher approval rate | String The country where your customer resides. | India |
zipcodemandatory | String Billing address zip code is mandatory for the cardless EMI option. Character Limit-20 | 400004 |
pgmandatory for seamless/s2s flow | String It defines the payment category and post UPI. | UPI |
bankcodemandatory for seamless/s2s flow | String Each payment option is identified with a unique bank code at PayU. For UPI Autopay, post UPI. | UPI |
surlmandatory | String The success URL, which is the page PayU will redirect to if the transaction is successful. | |
furlmandatory | String The Failure URL, which is the page PayU will redirect to if the transaction is failed. | |
vpa conditional | String Customer's VPA handle. Mandatory for UPI Collect flow. | customer@upi |
si mandatory | String Signifies successful consent taken from the user. Must be 1 for subscription setup. | 1 |
si_details mandatory | JSON String JSON object containing mandate details (billingAmount, billingCurrency, billingCycle, etc.). Refer to si_details JSON Object below. | See si_details accordion |
txn_s2s_flow conditional | Integer Parameter to enable S2S flow. Must be 4 for Legacy Decoupled flow (UPI Intent). | 4 |
s2s_client_ip conditional | String Source IP of the customer. Required for UPI Intent flow. | 10.200.12.12 |
s2s_device_info conditional | String Customer agent's device information. Required for UPI Intent flow. | Mozilla/5.0 (Windows NT 10.0; Win64; x64) |
udf1mandatory if AD bank request this detail | String This parameter must contain the Buyer's PAN and date of birth in the following format (separated by two pipe characters): Buyer's PAN\|\|Buyer'sDOB | AAAPZ1234C\|\|22/08/1972 |
udf3mandatory if AD bank request this detail | String This parameter must contain the invoice ID of the transaction (generated by the merchant) and merchant name in the following format (separated by two pipe characters): Invoice ID\|\|MerchantName | INV-123_1231\|\|MerchantName |
buyer_type_business optional in case of B2B transaction for cross-border payments | Binary To be sent as "1" in case the buyer is a business. In case of individual buyers, it can be skipped. Default is "0". Note: This will be included in hash if posted (covered in next section | 1 |
Sample Request
curl --location 'https://test.payu.in/_payment' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'key=PRiQvJ' \
--data-urlencode 'txnid=my_order_991' \
--data-urlencode 'amount=1' \
--data-urlencode 'productinfo=my_order_991' \
--data-urlencode 'email=' \
--data-urlencode 'phone=9368252248' \
--data-urlencode 'txn_s2s_flow=4' \
--data-urlencode 'hash=||||||ABCDE1234F||1990-01-01||INV123456||||||' \
--data-urlencode 'surl=https://test.payu.in/admin/test_response' \
--data-urlencode 'furl=https://test.payu.in/admin/test_response' \
--data-urlencode 'udf1=buyer'\''s DOB' \
--data-urlencode 'udf2=' \
--data-urlencode 'udf3=buyer'\''s PAN' \
--data-urlencode 'udf4=' \
--data-urlencode 'udf5=invoice number' \
--data-urlencode 's2s_client_ip=10.200.12.12' \
--data-urlencode 's2s_device_info=Mozilla/5.0 (Windows NT 10.0; Win64; x64) PayU-API-Test/1.0' \
--data-urlencode 'firstname=' \
--data-urlencode 'lastname=kr' \
--data-urlencode 'address1=308,third floor' \
--data-urlencode 'address2=testing' \
--data-urlencode 'city=Gurugram' \
--data-urlencode 'state=UP' \
--data-urlencode 'country=India' \
--data-urlencode 'zipcode=122018' \
--data-urlencode 'pg=UPI' \
--data-urlencode 'bankcode=INTENT' \
--data-urlencode 'upiAppName=gpay/phonepe/paytm/qr/amazonpay' \
--data-urlencode 'udf_params={"udf7":"asdf","udf8":"12"}' \
--data-urlencode 'buyer_type_business=1'Step 2: Retrieve Deeplink(uriIntentData) from the response,
if 'metaData.unmappedStatus = pending', then get the 'result.intentURIData' and add the Generic Intent prefix 'upi://pay?' to it to create a fully qualified deeplink to trigger the UPI App.
{
"metaData": {
"message": null,
"referenceId": "c99a6455b3e0dc5cd7167ab8c8cc10d2fa153cb509e3f64c6cd0ed9c5b64a8c9",
"statusCode": null,
"txnId": "my_order_26075",
"txnStatus": "pending",
"unmappedStatus": "pending"
},
"result": {
"paymentId": "403993715535965242",
"merchantName": "Sudhanshu",
"merchantVpa": "payutest@hdfcbank",
"amount": "1.00",
"intentURIData": "pa=payutest@hdfcbank&pn=Kumar&tr=403993715535965242&tid=PPPL403993715535965242080126220900&am=1.00&cu=INR&tn=UPIIntent",
"acsTemplate": "PGh0bWw+PGJvZHk+PGZvcm0gbmFtZT0icGF5bWVudF9wb3N0IiBpZD0icGF5bWVudF9wb3N0IiBhY3Rpb249Imh0dHBzOi8vdGVzdC5wYXl1LmluL2M5OWE2NDU1YjNlMGRjNWNkNzE2N2FiOGM4Y2MxMGQyYzgzYTk5NmFhNDhiYTk4MmZjMGQ4MTI1MGY1ODgxZjMvaW50ZW50U2VhbWxlc3NIYW5kbGVyLnBocCIgbWV0aG9kPSJwb3N0Ij48aW5wdXQgdHlwZT0iaGlkZGVuIiBuYW1lPSJ0b2tlbiIgdmFsdWU9IjhERDNFRUFFLUI5NTktQzY1RS03MDczLTYzQTNGQUUxMjZGRiI+PGlucHV0IHR5cGU9ImhpZGRlbiIgbmFtZT0iYW1vdW50IiB2YWx1ZT0iMS4wMCI+PGlucHV0IHR5cGU9ImhpZGRlbiIgbmFtZT0ibWlocGF5aWQiIHZhbHVlPSJjOTlhNjQ1NWIzZTBkYzVjZDcxNjdhYjhjOGNjMTBkMmZhMTUzY2I1MDllM2Y2NGM2Y2QwZWQ5YzViNjRhOGM5Ij48aW5wdXQgdHlwZT0iaGlkZGVuIiBuYW1lPSJkaXNhYmxlSW50ZW50U2VhbWxlc3NGYWlsdXJlIiB2YWx1ZT0iMCI+PGlucHV0IHR5cGU9ImhpZGRlbiIgbmFtZT0icGF5ZWVWcGEiIHZhbHVlPSJwYXl1dGVzdEBoZGZjYmFuayI+PGlucHV0IHR5cGU9ImhpZGRlbiIgbmFtZT0icGF5ZWVOYW1lIiB2YWx1ZT0iU3VkaGFuc2h1Ij48aW5wdXQgdHlwZT0iaGlkZGVuIiBuYW1lPSJhZGRpdGlvbmFsQ2hhcmdlcyIgdmFsdWU9IjAiPjxpbnB1dCB0eXBlPSJoaWRkZW4iIG5hbWU9InRyYW5zYWN0aW9uRmVlIiB2YWx1ZT0iMS4wMCI+PC9mb3JtPjxzY3JpcHQgdHlwZT0ndGV4dC9qYXZhc2NyaXB0Jz4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvdy5vbmxvYWQ9ZnVuY3Rpb24oKXsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5mb3Jtc1sncGF5bWVudF9wb3N0J10uc3VibWl0KCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIDwvc2NyaXB0PjwvYm9keT48L2h0bWw+",
"otpPostUrl": "https://test.payu.in/ResponseHandler.php"
}
}Step 3: Generate the QR from the Retrieved Deeplink
Generate the QR from the Deeplink retrieved and show the QR to the customer.
After receiving the intentURIData from Step 2 of the UPI Online QR flow, you need to:
- Prepend
upi://pay?to create the full UPI deeplink - Generate a QR code image from that deeplink
- Display the QR code to the customer
Example Response from Step 2
{
"result": {
"intentURIData": "pa=payutest@hdfcbank&pn=Kumar&tr=403993715535965242&tid=PPPL403993715535965242080126220900&am=1.00&cu=INR&tn=UPIIntent"
}
}Step 4: Verify the payment
Upon receiving the response, PayU recommends you performing a reconciliation step to validate all transaction details. You can verify your payments using either of the following methods:
Configure the webhooks to monitor the status of payments.
Webhooks enable a server to communicate with another server by sending an HTTP callback or message.
These callbacks are triggered by specific events or instances and operate at the server-to-server (S2S) level.
👉 For more details, refer to Webhooks for Payments.
Updated 10 days ago
