- Take one-off payments with Razorpay Checkout, using the payment methods enabled on your Razorpay account
- Mark an order as paid only after Razorpay confirms the full amount
- Send customers a payment link instead of a checkout page
- Refund a payment in full or in part
- Charge customers every week, month, or year with Razorpay Subscriptions, including a free trial before the first charge
- List recent payments and their status
Common use cases and example apps
These examples show what you can build with Razorpay, each with a prompt to start from.How to connect Razorpay
Who can create Razorpay connections depends on your plan and workspace settings. App + chat connectors are available by default. On Business and Enterprise plans, Who can create connections and clients starts at Admins. Some Enterprise workspaces start at No one, which disables the connector. An admin or owner changes it in Connectors → Admin settings → App + chat connectors. You can create multiple Razorpay connections using different key pairs, which is useful for keeping a test connection next to a live one or for connecting different Razorpay accounts. When the connection is created, you can link it to the projects where you want to use it. Anyone building in a project can ask Lovable in the project chat to link their project to it. Linking follows the connection’s access rules. When you’re ready to take real payments, unlink the test connection from the project and link the live one. Your app uses one Razorpay connection, so linking a second one does not switch it.Prerequisites
Before connecting Razorpay, make sure you have:- A Razorpay account. Test mode is available as soon as you sign up. Live mode is available after Razorpay activates your account, which includes a review of your website.
- A Razorpay key ID and key secret, generated in the mode you want to connect
- For recurring payments, Razorpay Subscriptions set up on your account, as described in Razorpay’s Subscriptions documentation
- Permission to create connections in your Lovable workspace (see Who can create connections and clients)
Payments made through this connector go to your Razorpay account. Razorpay charges its transaction fees directly, and billing is handled by Razorpay, not Lovable.
Step 1: Get your Razorpay API keys
A Razorpay key pair, a key ID and its key secret, lets your Lovable app create and read payments in your Razorpay account. Test mode and live mode each have their own key pair. A test key ID starts withrzp_test_ and moves no real money. A live key ID starts with rzp_live_.
Only Owner and Admin users in your Razorpay account can generate API keys.
To generate a Razorpay key pair:
1
Open your Razorpay Dashboard
Sign in to the Razorpay Dashboard and switch it to test mode or live mode.
2
Open API keys
3
Generate a key
Click Generate Key.
4
Copy the key ID and key secret
Copy both values and store them securely. Razorpay shows the key secret only once. If you lose it, generate a new key.
Step 2: Connect Razorpay to Lovable
Use your test keys for the first connection, so you can try payments without moving real money.1
Open Razorpay in Connectors
Open Connectors and select Razorpay. For the other places to open the catalog from, see Where to find connectors.
2
Add a connection
Click Connect on the connector page. The form is split into collapsible sections, Details, Configure connection, and Sharing.
3
Name the connection
Under Details, Lovable fills in a name for the connection, which you can change. The name is only used inside Lovable to identify the connection, for example
Razorpay Test or Razorpay Live.4
Configure the connection
Under Configure connection, enter:
- Key ID: paste your Razorpay key ID. It must start with
rzp_test_orrzp_live_. - Key secret: paste the key secret generated with that key ID, in the same mode.
5
Choose who can use this connection
Under Sharing, the connection is private to you by default and shows a Private label. To share it, click Share with others. Then add workspace members by email, or click Invite entire workspace to make the connection available to everyone in your Lovable workspace.See Who can use connections and clients for more information.
6
Connect
Click Connect at the bottom of the form. Lovable verifies the key pair against the Razorpay API before saving the connection.
How payments are confirmed
Your app marks an order as paid only after it reads the order back from Razorpay and Razorpay reports the full amount as paid. Returning from Razorpay Checkout doesn’t mean the customer has paid. Razorpay reports payment events by calling a webhook, a public address in your app. Lovable builds the webhook with the checkout and gives you its address. To connect Razorpay’s events to your app:1
Get the webhook address
Ask Lovable in the project chat for the Razorpay webhook address.
2
Add the webhook in Razorpay
In the Razorpay Dashboard, go to Accounts & Settings → Webhooks and click + Add New Webhook. Paste the address as the URL, and under Active Events, select
payment.captured, payment.authorized, and order.paid. Leave Secret empty, because your app confirms each event by reading the order from Razorpay. Click Create Webhook.Limitations
The Razorpay connector cannot:- Add the webhook in Razorpay for you. You add it in the Razorpay Dashboard.
- Support marketplace payments where each seller connects their own Razorpay account. Each connection represents a single Razorpay account shared across all projects linked to it.
Troubleshooting
Use these checks when connecting fails or a payment does not go through.Razorpay did not validate your credentials.
Razorpay did not validate your credentials.
Razorpay rejected the key pair you submitted. Check that you copied the whole key ID and key secret, and that both come from the same key in the same mode. If you no longer have the key secret, generate a new key. Click Show error to see Razorpay’s own response.
A UPI app cannot pay the QR code in Razorpay Checkout
A UPI app cannot pay the QR code in Razorpay Checkout
The connection uses test keys. A test-mode QR code cannot be paid with real money. Pay with a test card or test netbanking instead, or switch the project to a live connection.
Manage your Razorpay connection
Connections are managed from Connectors: select Razorpay, then open the connection.- Unlink projects to remove Razorpay access from specific projects while keeping the connection available for others. See Unlink projects from a connection for the steps.
- Delete the connection to remove it from the workspace entirely. Deleting is permanent. It removes the credentials from all linked projects, and app features that use Razorpay stop working until a new connection is added. See Delete a connection for the steps and who can delete.