Available in🇮🇳 India
You can collect payments using the UPI intent flow that will be handled by UPI apps installed on your customers’ mobile devices.
Customers need not enter VPA or phone numbers as these details are prefilled and submitted along with the other payment details. While making the payment, customers select the UPI PSP app on your UI. The app is launched automatically on their mobile devices where the payment is completed.
Best Practices
If you have a significant amount of payment traffic coming from the Mobile Site, then it is advisable to use the Google Pay Intent flow available for the mSite:- Do not change Intent URL
Do not make changes to the intent URL shared by Razorpay as part of the API response. Making changes to the intent URL can lead to payment failure. - Host UPI apps
It is recommended to host the UPI apps on your page/app instead of just hosting the Intent URI where the apps are shown by the native Android drawer. This improves conversion. - Rank UPI Apps by Success Rate
Show the UPI PSP apps in the order of their success rate. - Mobile site
If you have higher traffic via mobile site, then make sure you provide the option of UPI intent payment to your users using our m-site integration. This will help you achieve better success rates. - Gpay SDK
If your UPI transaction volumes are high, you can also explore integrating Gpay SDK. This provides a better user experience and about a 3-5% improvement in success rate.
Prerequisites
- Reach out to our Support Team to get this feature enabled for your account.
- Keep the API keys (
Key_IdandKey_Secret) handy for integration. - Generate API Keys from the Dashboard if you have not done already.
Integration Steps
Step 1: Create an Order
You should create an order before initiating a payment at your end.POST /orders
Request Parameters
The amount for which the Order was created, in currency subunits. For example, for an amount of ₹295, enter
29500.Receipt number that corresponds to this order, set for your internal reference. Maximum length of 40 characters supported.
Key-value pair that can be used to store additional information about the entity. Maximum 15 key-value pairs, 256 characters (maximum) each. For example,
"note_key": "Beam me up Scotty”.Step 2: Initiate a Payment
After creating an order, initiate a payment withintent flow.
POST /payments/create/upi
Request Parameters
The parameters needed for constructing the API request are described below:The amount associated with the payment in smallest unit of the supported currency. For example,
2000 means ₹20.Value of the
user_agent header passed by client’s browser. For example, Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36.A key-value pair that can hold additional information about the payment.
Refer the Notes section of the API Reference Guide.
Refer the Notes section of the API Reference Guide.
Pass data to UPI app
Handy TipsFor the package name, you can check the list of supported UPI apps.
Step 3: Verify the Payment Status
You can verify the status of the payments using any of the following methods:- Poll Razorpay servers periodically for the payments made for the order using our Fetch Payment APIs.
- Subscribe to the Webhook events created in our system for each of the following entities:
Test the Integration
Once you’ve completed the integration, test it using our test cases for UPI Intent.Payment failure and re-initiating payment
If the Order is not markedpaid within 2-3 minutes, then you can re-initiate payment for the same.