Connect your app to Razorpay
Connect your Razorpay account to accept UPI, card, and netbanking payments in India. Lovable connects with your Razorpay API keys and confirms orders automatically using webhooks.
Anyone selling goods, subscriptions, or services in India who wants to accept payments in rupees.
Do this, in order
- 1
Log in to your Razorpay Dashboard, switch to test or live mode, go to Account & Settings > API Keys, and click 'Generate Key'.
You need a Key ID and Key Secret to authorize Lovable to create orders on your behalf.
- 2
Copy both the Key ID and Key Secret immediately and save them safely.
Razorpay displays the Key Secret only once, and you cannot view it again later.
- 3
In Lovable, navigate to Connectors, select Razorpay, and click 'Connect'.
This opens the configuration screen to link your Razorpay credentials.
- 4
Give the connection a name, paste your Key ID and Key Secret, choose sharing settings, and click 'Connect'.
Lovable verifies your credentials with Razorpay before saving the connection.
- 5
Ask Lovable in your project chat for your app's Razorpay webhook address.
Your app needs Razorpay to alert it whenever a customer finishes paying.
- 6
In Razorpay Dashboard, go to Accounts & Settings > Webhooks, add a new webhook with that URL, select events 'payment.captured', 'payment.authorized', and 'order.paid', leave Secret blank, and save.
Without this webhook, your app will not know when an order is paid and cannot confirm the customer's purchase.
Paste this into your project
Connect this project to my Razorpay connection, build a checkout page that takes payments using Razorpay Checkout, and provide me with the webhook URL I need to set up in my Razorpay Dashboard to confirm paid orders.
Words decoded
- Webhook
- An automated notification that Razorpay sends straight to your app the exact moment a customer pays.
- API Keys
- A pair of private codes (Key ID and Key Secret) that work like a username and password for apps to talk to each other safely.
Where people get stuck
- Trying to scan a test-mode UPI QR code with a real UPI phone app will fail; test mode requires demo card or netbanking details instead.
- Simply linking a second connection does not automatically switch your app from test to live mode; you must unlink the test connection first.
- Assuming a user paid just because they returned from the checkout page; orders are only paid when confirmed via the webhook.
The short version, steps, decoder and prompt on this page are written automatically from Lovable's own documentation and can lag or misread it. The official page is always the authority.