Skip to main content
Razorpay is an Indian payments provider that supports UPI (Unified Payments Interface), cards, netbanking, and wallets. The Razorpay connector lets your Lovable app create orders in your own Razorpay account, take payment with Razorpay Checkout, and confirm each payment with Razorpay. It’s designed for apps whose owners sell in India and take payments with Razorpay. Razorpay is available as an app + chat connector: one shared connection that works in Chats, in the project chat while you build, and in your published apps. With Razorpay, your app can:
  • 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
If you don’t have a Razorpay account, Lovable payments can set up Stripe or Paddle for you instead. Built-in payments require the Pro plan or higher. When you ask Lovable to add payments without naming a provider, it recommends those built-in payments.

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 with rzp_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
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.
Your key secret functions like a password. Keep it secure and never share it publicly. You’ll need it in the next step.
See Razorpay documentation for more: API keys.

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:
  1. Key ID: paste your Razorpay key ID. It must start with rzp_test_ or rzp_live_.
  2. Key secret: paste the key secret generated with that key ID, in the same mode.
Open API keys next to each field opens the API keys page in the Razorpay Dashboard.
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.
When connected, anyone building in a project can ask Lovable in the project chat to link their project to Razorpay. Linking follows the connection’s access rules. Your Lovable apps can then create orders, take payments, and confirm them through Razorpay.

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.
Test mode and live mode each need their own webhook. Add it with the Razorpay Dashboard in the mode your connection uses, and again in live mode when you switch to live keys. To try a payment with test keys, pay with a test card or test netbanking from Razorpay’s test card details. Test netbanking opens a demo bank page where you choose whether the payment succeeds or fails.

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 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.
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.