> For the complete documentation index, see [llms.txt](https://help.botpenguin.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.botpenguin.com/settings/third-party-apps/razorpay.md).

# Razorpay

This section contains essential information and usage guidelines for integrating Razorpay with your BotPenguin WhatsApp Agent.

### What is Razorpay?

Razorpay is a secure payment gateway that enables businesses to collect online payments through multiple payment methods, including UPI, credit cards, debit cards, net banking, wallets, and more.

***

### When should you use this?

Use this integration when:

* You want to collect payments through using WhatsApp
* You need customers to complete payments without leaving the conversation.
* You want to automate payment collection using Razorpay.

***

### Benefits of Razorpay Integration

* 💳 Collect payments directly through WhatsApp.
* ⚡ Support multiple payment methods through Razorpay.
* 🔄 Receive payment status updates automatically.
* 🤖 Automate payment collection within conversations.
* 📈 Provide a seamless payment experience for your customers.

***

### Expected Outcome

After completing this setup:

* Razorpay will be connected to your BotPenguin account.
* Your WhatsApp Agent will be able to generate payment requests.
* Payment status will automatically sync with BotPenguin.
* Razorpay can be selected as the payment gateway inside the Payment Component.

{% hint style="info" icon="lightbulb" %}
**Tip:** Perform a test payment after completing the setup to verify everything is working correctly.
{% endhint %}

***

## 🔐 Prerequisites

Before setting up this integration, ensure you have:

* A BotPenguin account.
* An active Razorpay account.
* A WhatsApp Agent.
* Access to your Razorpay API Keys.
* Permission to create Webhooks in Razorpay.

{% hint style="warning" icon="triangle-exclamation" %}
Missing any of the above prerequisites may prevent successful integration.
{% endhint %}

***

## How to Use Razorpay

### 1. Open Razorpay Integration

1. Log in to your BotPenguin account.
2. Select the WhatsApp Bot you want to configure.
3. Navigate to **Third Party Apps**.
4. Search for Razorpay and click on it.

![](https://content.gitbook.com/content/APDb8cKQtGlIAfgHjcsQ/blobs/2UdYig8k8PWloHrSRrKd/images/razorpay-step-1.png)

***

### 2. Generate Razorpay API Keys

1. Log in to your Razorpay Dashboard.
2. Search for **API Keys**.

![](https://content.gitbook.com/content/APDb8cKQtGlIAfgHjcsQ/blobs/K6JNg30qrCKMATNlTMhE/images/razorpay-step-2.png)

3. Open the **API Keys** page.
4. If you do not already have credentials, click **Generate New API Key**.

![](https://content.gitbook.com/content/APDb8cKQtGlIAfgHjcsQ/blobs/7AqvSjCf7TDHQ1VknvGt/images/razorpay-step-3.png)

5. Copy the following credentials:
   1. Key ID
   2. Key Secret

{% hint style="info" %}
Store the Key Secret securely. It may not be visible again after creation.
{% endhint %}

![](https://content.gitbook.com/content/APDb8cKQtGlIAfgHjcsQ/blobs/G6gn9C3uqvFOsanffugs/images/razorpay-step-4.png)

***

### 3. Connect Razorpay

1. Return to BotPenguin.
2. Enter your:
   * Razorpay Key ID
   * Razorpay Key Secret
3. Click **Save Configuration**.

![](https://content.gitbook.com/content/APDb8cKQtGlIAfgHjcsQ/blobs/mwSfaTn8UYS5Vck5bJ3J/images/razorpay-step-5.png)

***

### 4. Configure Razorpay Webhook

To allow BotPenguin to receive payment status updates, configure a webhook in Razorpay.

1. In Razorpay, navigate to **Account Settings → Webhooks**.
2. Click **Add Webhook**.

![](https://content.gitbook.com/content/APDb8cKQtGlIAfgHjcsQ/blobs/orjuC0cnSjmwfNbUAGIp/images/razorpay-step-6.png)

3. Return to BotPenguin and copy the **Webhook URL** displayed in the Razorpay integration.
4. Paste this URL into Razorpay.
5. Select the following events:
   1. payment.failed
   2. payment\_link.paid
   3. payment\_link.partially\_paid
   4. payment\_link.expired
   5. payment\_link.cancelled
6. Click **Create Webhook**.

![](https://content.gitbook.com/content/APDb8cKQtGlIAfgHjcsQ/blobs/nyr1XrEaR8gJZ1sTMMlR/images/razorpay-step-7.png)

{% hint style="success" %}
Congratulations :confetti\_ball:! You have successfully integrated Razorpay into your Agent!
{% endhint %}

***

### 🔄 How Data Flows

* A customer initiates payment through your WhatsApps.
* BotPenguin creates a payment request using Razorpay.
* The customer completes the payment.
* Razorpay sends payment updates to BotPenguin through the configured webhook.
* BotPenguin updates the payment status and continues the flow based on the payment result.

***

### 🚫 Limitations

* Razorpay Integration is supported only for WhatsApp.
* Webhook configuration is mandatory for automatic payment status updates.
* Invalid API credentials will prevent the integration from connecting.
* Removing the webhook may stop payment status synchronization.

***

### Best Practices

> 💡 Configure the webhook before using Razorpay in production.

> ⚠️ Perform a test payment after completing the setup.

> 🚀 Keep your API credentials secure.

> 🎯 Regularly verify webhook delivery from your Razorpay Dashboard.

***

### Troubleshooting

<details>

<summary>Unable to connect Razorpay</summary>

**Likely Cause:** The Razorpay Key ID or Key Secret was entered incorrectly.

**Resolution:** Verify that the **Razorpay Key ID** and **Key Secret** have been entered correctly, then reconnect the integration.

</details>

<details>

<summary>Payment status is not updating</summary>

**Likely Cause:** The Razorpay webhook is not configured correctly or required events are not enabled.

**Resolution:** Verify that the Razorpay webhook has been configured correctly and that all required webhook events are enabled.

</details>

<details>

<summary>Webhook events are not reaching BotPenguin</summary>

**Likely Cause:** The webhook URL is incorrect, inactive, or not configured properly in Razorpay.

**Resolution:** Ensure the webhook URL has been copied correctly and is active in your **Razorpay Dashboard**.

</details>

<details>

<summary>Razorpay is not available in the Payment Component</summary>

**Likely Cause:** The Razorpay integration has not been connected successfully.

**Resolution:** Verify that the integration has been connected successfully from **Third Party Apps Integration**. Refresh the chatbot editor if necessary.

</details>

***

### FAQs

<details>

<summary>Which bots support Razorpay Integration?</summary>

Razorpay Integration is currently supported only for **WhatsApp Bots**.

</details>

<details>

<summary>Why do I need to configure a webhook?</summary>

The webhook allows Razorpay to notify BotPenguin about payment events, enabling automatic payment status updates.

</details>

<details>

<summary>Where can I find my Razorpay API Keys?</summary>

Log in to your **Razorpay Dashboard** and navigate to the **API Keys** section to generate or view your credentials.

</details>

<details>

<summary>Can I regenerate my API Keys?</summary>

Yes. If you generate new API Keys, update them in BotPenguin and reconnect the integration.

</details>

<details>

<summary>Can I use Razorpay without configuring the webhook?</summary>

No. The webhook is required for BotPenguin to receive payment status updates from Razorpay.

</details>

<details>

<summary>How can I verify that the integration is working?</summary>

Configure the **Payment Component** with **Razorpay** as the payment gateway and perform a test payment through your WhatsApp chatbot.

</details>

***

### 🎉 Completion

🎉 Congratulations! Your Razorpay account has been successfully connected to BotPenguin. You can now securely collect payments through your WhatsApp .

***

### Support

If you still have questions for our team, write to us at [**support@botpenguin.com**](mailto:support@botpenguin.com). We'll get back to you within 48 hours.
