# Accept payments with Razorpay

> Connect Razorpay — find your Key ID and Key Secret, add the webhook, test with test keys, then go live.

Product: NijeesWeb online store builder · Source: https://www.nijeesweb.com/docs/ecommerce/payments/razorpay · Updated 2026-10-06

Razorpay is the most widely used payment gateway in India: cards, UPI, net banking and wallets in one checkout. It settles in INR and 16 other currencies, and refunds can be issued from your store's admin.

![Razorpay settings](https://www.nijeesweb.com/marketing/img/docs/ecommerce/admin/payment-razorpay-1200.webp "Razorpay: environment, Key ID, Key Secret and the optional Webhook Secret")

## What you need

- A **Razorpay account** at razorpay.com. You can use test keys straight away; live keys come once Razorpay has activated your account (they check your business details and your store's policy pages).
- Your store's **policy pages** — privacy, terms, shipping, returns and refunds, and contact. Razorpay asks for them during activation.

## 1. Get your keys

1. In the Razorpay Dashboard, switch to **Test Mode** (top of the screen).
2. Go to **Account & Settings → API Keys** and select **Generate Key**.
3. Copy the **Key ID** (it starts with `rzp_test_`) and the **Key Secret**. The secret is shown only once — keep it somewhere safe.

## 2. Add Razorpay to your store

1. In your admin, go to **Payments → Add gateway → Razorpay**. Its settings open.
2. Set **Environment** to **Test / sandbox**.
3. Paste the **Key ID** and **Key Secret**.
4. Select **Save changes**.

## 3. Add the webhook (recommended)

The webhook tells your store about payments even if the customer closes the window before returning — so no paid order is left *Pending*.

1. In your admin, on the Razorpay method, find **URLs for Razorpay's dashboard** and **Copy** the **Webhook / callback URL**.
2. In the Razorpay Dashboard, go to **Settings → Webhooks → Add New Webhook**.
3. Paste the URL, type a **secret** of your choice, and tick the events **payment.captured** and **payment.failed**.
4. Save. Back in your admin, paste the same secret into **Webhook Secret** and **Save changes**.

## 4. Test it

Set **Switch it on** to **Admins only**, sign in to your store as an admin, and pay for an order with one of Razorpay's test cards or test UPI IDs. Check that the order turns **Confirmed** and **Paid**. See [Test before going live](https://www.nijeesweb.com/docs/ecommerce/payments/test-before-going-live).

## 5. Go live

1. Once Razorpay has activated your account, switch the Dashboard to **Live Mode** and generate **live** keys (`rzp_live_…`).
2. Add a webhook in Live Mode too — test and live webhooks are separate.
3. In your admin, set **Environment** to **Live**, paste the live Key ID, Key Secret and webhook secret, and set **Switch it on** to **Live**.

## Refunds

Refunds on Razorpay orders can be sent back to the customer's original payment method from your admin when you process a cancellation or return. See [Refunds and store credit](https://www.nijeesweb.com/docs/ecommerce/orders/refunds-and-store-credit).

## Problems

- **Payments fail with an authentication error** — the Key ID and Key Secret do not match, or test keys are used with **Environment: Live** (or the other way round).
- **Paid orders stay Pending** — the customer closed the window before returning and no webhook is set. Add the webhook as above.

More in [Payment gateway errors](https://www.nijeesweb.com/docs/ecommerce/troubleshooting/payment-gateway-errors).
