> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xpressbot.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Razorpay

> Send WhatsApp messages when a Razorpay payment succeeds, fails, or is refunded.

## What is this?

The **Razorpay** integration turns payment events into WhatsApp messages. When a payment is captured, fails, or is refunded, Razorpay tells the platform and an automation sends the template you chose — for example *Payment received, thank you!* or *Your payment failed, tap to retry*.

Razorpay doesn't let apps create webhooks for you. So instead of connecting with a login, the platform gives you a **Webhook URL** and a **Webhook secret** that you paste into your Razorpay dashboard once.

\[SCREENSHOT: razorpay-provider-page — The Razorpay page showing the Connect button and connected accounts]

## What can I do here?

* Send a WhatsApp template for each payment event
* Get a ready-made automation that routes each Razorpay event to the right template
* See every request Razorpay sent, including duplicates and failures
* Have every delivery checked against Razorpay's signature

## How to use it

<Steps>
  <Step title="Open the Razorpay page">
    Go to **Integrations**, click **Razorpay**, then **Connect**. Razorpay needs no credentials here.
  </Step>

  <Step title="Choose your messages">
    Pick a WhatsApp template for each event you want to message about:

    | Event                  | When it happens                 |
    | ---------------------- | ------------------------------- |
    | **Payment authorized** | The bank authorized the payment |
    | **Payment captured**   | The payment was collected       |
    | **Payment failed**     | The payment didn't go through   |
    | **Order paid**         | A Razorpay order is fully paid  |
    | **Refund processed**   | A refund was completed          |

    Leave an event empty to send nothing for it.
  </Step>

  <Step title="Set up and activate">
    Click **Set up and activate**. The automation is created and you're shown your **Webhook URL** and **Webhook secret**.
  </Step>

  <Step title="Add the webhook in Razorpay">
    In your Razorpay dashboard, open **Settings → Webhooks**, add a webhook using the URL and secret, and enable the events you chose. Use the copy buttons to avoid typos.
  </Step>
</Steps>

\[SCREENSHOT: razorpay-webhook-details — The webhook URL and secret shown after setup, with copy buttons]

<Warning>
  Treat the webhook secret like a password. You can view it again from the connection's details if you need it.
</Warning>

## Things to know

* **The customer's phone number** comes from the payment details Razorpay sends. Payments without a phone number can't be messaged.
* **Nothing arrives until you add the webhook in Razorpay.** The automation is created straight away, but Razorpay only sends events once its dashboard has the URL and secret.
* **Repeats are ignored.** If Razorpay retries the same event, the customer isn't messaged twice.

## Troubleshooting / Technical Notes

* **No messages are sent.** Check the webhook is added in Razorpay with the exact URL and secret, that the events are ticked, and that a template is chosen for each event.
* **Requests appear as failed.** Open the connection's **Activity** tab and select the request to see the error and its raw body. A wrong secret is a common cause.
* **A customer wasn't messaged.** The payment needs a phone number, and the template must be approved.
* **You changed the automation.** You can edit the flow in the builder any time, including which template each event uses.

## Related docs

* [Integrations Overview](/workspace/integrations/overview)
* [Webhooks](/workspace/integrations/webhooks)
* [Templates](/workspace/whatsapp/templates)
* [Automation Overview](/workspace/automation/overview)
