Flutter UPI Bolt UI SDK
PayU UPI Bolt UI SDK will provide a simpler and more efficient payment experience to the merchants. It will eliminate any third-party redirection and higher success rate. Profile management including accounts and balances for users. Enhancing the overall customer experience and decreasing customer drop-offs.
Advantages
- One-click payment journey and no hassle of redirection to a third-party UPI application.
- Quick completion of transactions because of direct integration with the bank.
- Seamless user experience to the customers with in-app payment.
- Easy to integrate and get the advantage of existing customer profiles created with banks.
- 5-6% higher success rate and better transaction conversion.
- Merchants can take advantage of a complete user funnel to understand user behavior.
User Journeys in PayU UPI Bolt UI SDK
Registration and Pay
- Merchant Application can do the User registration for customers who are coming first time for PayU UPI Bolt. The Registration can be done during the checkout process or it can be called in a separate user journey. In case of Merchant is using PayU Checkout Pro SDK, PayU will take care of customer registration.
- Once the registration process is initiated, the user will be asked to accept the SMS sending permissions required to verify the SIM card. If the phone has dual SIM, the SIM card selection screen will be shown to customers to select the specific SIM card.
- After the device verification, UPI ID creation and the Bank selection will be done. Add bank journey will be completed after adding a bank account connected to the same mobile number used for device verification.
- Finally, customers can do a transaction using the added bank account. In case the customer is using the bank account for the first time they will need to set the MPIN as well.
- Finally, customers can make a transaction using the added bank account. If the customer is using the bank account for the first time, he will also need to set the MPIN.

Pay
- Customers who are already registered with PayU UPI Bolt can make a One-click payment.
- The customer needs to select the already added bank account and enter the MPIN and the transaction will be completed.
- The customer can also check the balance before making a transaction to avoid low-balance transaction failure.

Profile Management Journey
- Customers can add new bank accounts, set MPIN, change MPIN, reset MPIN, delete accounts, and check the balance of already added bank accounts.
- Transaction history can be seen and queries can be raised and resolved within the PayU UI Bolt SDK.
- Customers can see all the raised disputes from the Dispute history screen.
- Customers can also deregister their all accounts with PayU UI Bolt SDK.

Steps to Integrate
Prerequisites
Supported iOS deployment target - iOS 17 and above.
Merchants who want to integrate only PayU UPI Bolt with their app. They can manage the checkout options on their checkout screen. Although they can use PayU UPI Bolt UI SDK for customer registration, payment, and profile management.
To include the PayU UPI Bolt UI SDK in your project, add the following dependency to your pubspec.yaml file:
payu_upi_bolt_ui_flutter: ^1.0.0Install the Flutter package:
flutter pub add payu_upi_bolt_ui_flutter:^1.0.0-alpha.1iOS Integration
To include the PayU UPI Bolt UI SDK in your project, add the following code snippet to your podfile.
Supported iOS deployment target - iOS 17 and above.
The following xcframework files will be provided by PayU during onboarding:
- NPCI - CommonLibrary.xcframework
- AXIS - OlivePayLibrary.xcframework
Add these framework in your project. The added framework is similar to the following screeshot:

In Build Settings > Framework Search Path, add $(PROJECT_DIR)/Frameworks if it is not added automatically by Xcode.

Android Integration
Add the following permissions in your AndroidManifest file.
<uses-permission android:name="android.permission.SEND_SMS"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_NUMBERS" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />Add the following dependency in the build.gradle file of your android app module:
implementation(files('libs/SecureComponent-release-prod_05062024_9d3904ab.aar'))Add the given aar file in the libs folder of your android app module:
<your_project>/android/app/libs/SecureComponent-release-prod_05062024_9d3904ab.aarStep 1: Initialization
It is used to initialize the SDK. This method returns an object that will be used to access other methods available in PayUUPIBoltUI.
Add the following imports:
import 'package:payu_upi_bolt_ui_flutter/PayUUPIConstantKeys.dart';
import 'package:payu_upi_bolt_ui_flutter/payu_upi_bolt_ui_flutter.dart';Initialize the SDK with configuration:
var config = {
"merchantName": "<merchantName>", // String
"merchantKey": "<merchantKey>", // String
"phone": "<phone>", // String
"email": "<email>", // String
"refId": "<refId>", // String
"pluginTypes": ["<pluginType>"], // Array \<String>
"clientId": "<clientId>", // String
"issuingBanks": ["<issuingBanks>"], // Array \<String>
"excludedBanksIINs": ["<excludedBanksIIN>"], // Array \<String>
"isProduction": <isProduction> // Boolean
};
// To initialize the SDK
var payUUpiFlutter = PayUUPIBoltUIFlutter(this);
payUUpiFlutter.initSDK(params: config);
// To clear the SDK Instance
payUUpiFlutter.reset();The following fields are needed as a request for this API:
| Parameter | Description | Example |
|---|---|---|
configmandatory |
Map PayUUPIBoltBaseConfig includes the below fields. |
{...} |
merchantNamemandatory |
String Merchant Name |
"MyStore Inc" |
merchantKeymandatory |
String PayU Merchant Key |
"gtKFFx" |
phonemandatory |
String Phone number for registration |
"+919876543210" |
emailmandatory |
String Customer Email Id |
"[email protected]" |
pluginTypesmandatory |
Array<String> List of Supported Plugin (Values - AXIS or HDFC or BHIM) |
["AXIS", "HDFC", "BHIM"] |
isProductionmandatory |
Boolean Prod - true, staging - false |
true |
excludedBanksIINsoptional |
Array<String> List of Bank's IIN to exclude |
["123456", "789012"] |
clientIdoptional |
String Unique client ID |
"CLIENT_001" |
refIdmandatory |
String Unique reference ID |
"REF_12345678" |
issuingBanksoptional |
Array<String> List of Issuing Bank's (Values - AXIS or HDFC) |
["AXIS", "HDFC"] |
Clear SDK Cache of PayUBolt SDK
The clearCache method is used to clear the cache corresponding to the passed PG value.
payUUpiFlutter.clearCache(params: Map);The following fields are needed as a request for this API:
Field | Definition |
|---|---|
pg
|
|
Response: `Refer to SDK Response JSON Format
Check Plugin Registration Status of PayUBolt SDK
The isRegistered method is used to check pg registration status.
payUUpiFlutter.isRegistered(params: Map);Field | Definition |
|---|---|
pg
|
|
Response: `Refer to SDK Response JSON Format
Callback: The callback will have the below response format.
Step 2. Check if UPI Bolt is Enabled
This method is used to check whether the upi bolt is enabled for the merchant or not.
payUUpiFlutter.isUPIBoltEnabled();Response: `Refer to SDK Response JSON Format
| Field | Definition |
|---|---|
| code | Integer Status code (Success = 0, Failure = 1) |
| message | String Message |
Step 3. Register and Pay
This API allows you to initialize registration and payment flow. It will internally authenticate and register the customer. After successful authentication and registration, the user will follow the payment journey. Once payment is completed, based on the payment status the merchant will get a callback through the listener.
Payment Parameters
| Parameter | Description |
|---|---|
amountmandatory
|
StringTransaction amount. |
productInfomandatory
|
StringInformation about the product or service. |
firstNamemandatory
|
StringCustomer's first name. |
surlmandatory
|
StringAndroid success URL. |
furlmandatory
|
StringAndroid failure URL. |
ios_surlmandatory
|
StringiOS success URL. |
ios_furlmandatory
|
StringiOS failure URL. |
initiationModemandatory
|
StringMode of initiation (e.g., "10"). |
purposemandatory
|
StringPurpose code (e.g., "00"). |
txnIdmandatory
|
StringUnique transaction ID. |
udf1 - udf6optional
|
AnyUser-defined fields for additional transaction metadata. |
isCCTxnEnabledoptional
|
BooleanEnables card fallback if supported – true or false. |
Sample Code
var params = {
"amount": <amount>, // String
"productInfo": <productInfo>, // String
"firstName": <firstName>, // String
"surl": <success_url>, // String (Android success URL)
"furl": <failure_url>, // String (Android failure URL)
"udf1": <udf1>, // String (Optional)
"udf2": <udf2>, // String (Optional)
"udf3": <udf3>, // String (Optional)
"udf4": <udf4>, // String (Optional)
"udf5": <udf5>, // String (Optional)
"txnId": <txnId>, // String (Unique transaction ID)
"isCCTxnEnabled": <isCCTxnEnabled>, // Boolean (Enable card fallback if supported)
"ios_surl": <ios_success_url>, // String (iOS success URL)
"ios_furl": <ios_failure_url>, // String (iOS failure URL)
"initiationMode": <initiationMode>,
"purpose": <purpose>,
// Optional for TPV txns
"beneficiaryDetails": [
{
"accountNumber": <beneficiary1_accountNumber>,
"ifsc": <beneficiary1_ifsc>
},
{
"accountNumber": <beneficiary2_accountNumber>,
"ifsc": <beneficiary2_ifsc>
}
]
}
payUUpiFlutter.registerAndPay(params: Map);Response: Map Refer to SDK Response JSON Format.
| Field | Definition |
|---|---|
| result | Payment Response |
Step 4. Open UPI Management
This API allows you to manage UPI accounts and transaction history.
// Screen Types
var params = {
screenType: <String>
}
payUUpiFlutter.openUPIManagement(params: Map);Request Parameters
| Parameter | Description |
|---|---|
screenTypemandatory
|
StringSpecifies the type of management screen. Valid values: • ALL • TRANSACTIONHISTORY • MANAGEUPIACCOUNTS • DISPUTE • DEREGISTERUPI |
Response: Map Refer to SDK Response JSON Format
Step 5. Listener/Callback logic
The listener/callback contains following methods where the merchant app will get the API response and hash-related callbacks.
@override
void onPayUSuccess(Map response) {
// Contains the success response after a completed payment
}
@override
void onPayUFailure(Map response) {
// Contains the failure response if the payment fails
}
@override
void onPayUCancel(Map response) {
// Called when the user cancels the payment
}
@override
void onErrorReceived(Map response) {
// Called when any SDK or transaction error occurs
}
@override
void onUPIBoltEnabled(Map response) {
// Indicates whether UPI Bolt is enabled for the merchant
}
@override
void onReset(Map response) {
// Called when the SDK instance is reset successfully
}
@override
void onIsRegistered(Map response) {
// Returns the registration status with the selected plugin
}
@override
void onInitSDK(Map response) {
// Called after SDK initialization (success or failure)
}
@override
void generateHash(Map response) {
// Triggered when the SDK requests hash generation
// Refer to the Hash Generation section for implementation details
}
Step 6. Hash Generation Logic
The PayU SDKs use hashes to ensure the security of the transaction and prevent any unauthorized intrusion or modification.
For generating and passing dynamic hashes, the merchant will receive a call from the generateHash method of PayUUPIBoltUiListener. The generateHash() method is called by the SDK each time it needs an individual hash.
@override
void generateHash(Map response) {
// Merchant will get Map with type of hash and hash string as value of dictionary.
/*
They have to sign that string using salt to create hash value and pass that to onCompletion
In the map you have to check for three keys to generate hash.
1. hashString
2. hashName
3. postSalt
At the end of that hashString append your salt and use SHA-512 algo on that final string to generate hash.
Note: If you got postSalt also in the map, first use hash string append salt and then append postSalt value to that string and use SHA-512 algo on that final string to generate hash.
Once the hash is generated use hashGenerationListener parameter to pass the hash to SDK. Example code:
*/
let commandName = (param[PayUUPIBoltHashConstants.hashName] ?? "");
let hashStringWithoutSalt = (param[PayUUPIBoltHashConstants.hashString] ?? "");
let postSalt = param[PayUUPIBoltHashConstants.postSalt];
// get hash for "commandName" from server
// get hash for "hashStringWithoutSalt" from server
// After fetching hash set its value in below variable "hashValue"
var hashValue = "";
if let postSalt = postSalt {
let hashString = hashStringWithoutSalt + salt + postSalt;
hashValue = "<SHA-512 hash of hashString>";
} else {
hashValue = "<SHA-512 hash of hashString>";
}
var hashResponse = {commandName: hashValue};
payUUpiFlutter.hashGenerated(params: hashResponse);
}SDK Response JSON Format
| Field | Definition |
|---|---|
| result | Contains response model if received success callback |
| code | Ref. Response Codes and Messages section |
| message | Ref. Response Codes and Messages section |
Error Codes and Error Message List
| Response Code | Message |
|---|---|
| 0 | Success |
| 1 | Fail/ Invalid Response/ Missing params |
| 2 | User cancelled the transaction |
| 100 | Transaction timeout |
| 103 | Handshake failed |
| 104 | UPI bolt not supported |
| 105 | Device not supported for UPI Bolt |
| 500 | Something went wrong |
| 501 | No internet connection |
| 502 | SDK not found |
Updated about 2 hours ago
