---
url: /relypay-whmcs/guides/razorpay.md
description: >-
  Set up Razorpay in RelyPay for WHMCS — enter your API keys and webhook secret,
  choose a payment action, register the webhook, and test the connection.
---

# Connect Razorpay

Razorpay gives you the widest method coverage of any RelyPay provider — UPI, Cards, Net
Banking, Wallets, Pay Later, EMI and PayPal. This guide walks through connecting it on the
**Addons → RelyPay → Providers** page.

![The Razorpay configuration card in RelyPay](/relypay-whmcs/img/relypay-razorpay-config.png)
*Addons → RelyPay → Providers → Razorpay*

## Credentials you will need

On the Razorpay card, fill in these fields exactly:

| Field | Where to find it |
| --- | --- |
| **Key ID** | From Razorpay Dashboard → Settings → API Keys |
| **Key Secret** | Generated with the Key ID |
| **Webhook Secret** | From Razorpay Dashboard → Settings → Webhooks |

Generate your API keys in the Razorpay Dashboard first, then copy the **Key ID** and
**Key Secret** into RelyPay. You will create the **Webhook Secret** in the next step, when
you register the webhook.

## Payment Action

* **Payment Action** — choose **Capture (Auto)** or **Authorize Only**.
  *Capture = auto-capture, Authorize = manual capture.*

Leave this on **Capture (Auto)** unless you specifically want to authorise a card at
checkout and capture the funds later yourself. Most stores want auto-capture so paid
invoices settle immediately.

## Register the webhook

1. On the Razorpay card in RelyPay, copy the **webhook URL** shown.
2. In **Razorpay Dashboard → Settings → Webhooks**, add a new webhook and paste that URL.
3. Set a **secret** on the webhook, then copy it back into the **Webhook Secret** field in
   RelyPay so callbacks can be verified.
4. Subscribe to these events:

| Event | Required? |
| --- | --- |
| `payment.captured` | Required |
| `order.paid` | Required |
| `payment.authorized` | Optional |
| `payment.failed` | Optional |

::: warning SSL required
The webhook URL must be HTTPS. Razorpay will not deliver events to an insecure endpoint,
and RelyPay verifies each callback's signature against your Webhook Secret.
:::

## Test mode

Razorpay issues separate **Test** and **Live** API keys in its dashboard. To trial the
integration, generate test-mode keys and enter those; switch to live keys when you are
ready to take real payments. Remember to update the Webhook Secret if you change key sets.

## Test it

1. Click **Test Connection** on the Razorpay card to confirm your keys reach Razorpay.
2. Enable Razorpay and save.
3. Place a test payment through a RelyPay [sub-gateway](/relypay-whmcs/features/sub-gateways)
   that Razorpay can serve, and confirm the result appears in the
   [transaction log](/relypay-whmcs/features/transactions) with **Razorpay** as the provider.

## Related

* [Configuration overview](/relypay-whmcs/configuration)
* [Routing](/relypay-whmcs/features/routing)
