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

# Razorpay

> Connect Razorpay to your Rocket.new app and accept payments, process refunds, manage subscriptions, and handle orders with a single prompt.

export const LlmsDirective = () => <blockquote className="llms-directive">
    For the complete documentation index, see <a href="/llms.txt">llms.txt</a>.
    For a lightweight markdown version of this page, append .md to the URL.
  </blockquote>;

<LlmsDirective />

Connect Razorpay via OAuth and describe the payment flow you want in chat. Rocket generates the complete checkout experience: order creation, payment forms, webhook handlers, and subscription management, all grounded in your real Razorpay configuration.

<Note>
  This connector is only available for **Next.js TypeScript** web build tasks.
</Note>

<Note>
  Razorpay is a **workspace-level** connector. Connect it once from Settings and it is available across all tasks.
</Note>

<Divider />

## What you can do

<CardGroup cols={2}>
  <Card title="One-time checkout" icon="cart-shopping">
    Accept single payments for products, services, or digital goods with a Razorpay-powered checkout page.
  </Card>

  <Card title="Subscription billing" icon="repeat">
    Monthly or yearly plans with automatic billing, upgrade and downgrade flows, and cancellation handling.
  </Card>

  <Card title="Order management" icon="box">
    Create and track orders programmatically. Pull order history into dashboards and admin panels.
  </Card>

  <Card title="Refund processing" icon="rotate-left">
    Trigger full or partial refunds from your app and sync refund status back to your UI.
  </Card>
</CardGroup>

<Divider />

## Before you connect

Razorpay uses OAuth, so no API key is required. You authorize Rocket through Razorpay's login flow and Rocket gets scoped access to your account.

<Warning>
  Rocket can only access the Razorpay account you authorize during the OAuth flow. To switch accounts, disconnect and reconnect with the new account.
</Warning>

<Note>
  Always test with Razorpay's **Test Mode** before switching to Live Mode. Test card: `4111 1111 1111 1111` with any future expiry and CVV.
</Note>

<Divider />

## Connect Razorpay

<Tabs>
  <Tab title="Web Browser">
    You can connect from three places. All do the same thing.

    **Option 1: From chat**

    Type a prompt that mentions Razorpay - for example, `Connect Razorpay and add a checkout for ₹499`. Rocket detects the intent and shows a **Connect** button inline. Click it and the authorization flow opens.

    <Frame caption="Razorpay connection prompt in chat">
      <img src="https://mintcdn.com/dhiwisepvtltd-5e04e6a4/-ShA47Mi9wOw84qL/images/build-docs/connectors/razorpay/web-browser/razorpay-chat-light.webp?fit=max&auto=format&n=-ShA47Mi9wOw84qL&q=85&s=1d0bccd31329ce1acfed933590a26143" alt="Razorpay connection prompt in the Rocket chat panel." className="theme-image light-image" width="2880" height="1800" data-path="images/build-docs/connectors/razorpay/web-browser/razorpay-chat-light.webp" />

      <img src="https://mintcdn.com/dhiwisepvtltd-5e04e6a4/-ShA47Mi9wOw84qL/images/build-docs/connectors/razorpay/web-browser/razorpay-chat-dark.webp?fit=max&auto=format&n=-ShA47Mi9wOw84qL&q=85&s=eadad953047579059fb9a8c88b6232bb" alt="Razorpay connection prompt in the Rocket chat panel." className="theme-image dark-image" width="2880" height="1800" data-path="images/build-docs/connectors/razorpay/web-browser/razorpay-chat-dark.webp" />
    </Frame>

    **Option 2: From the Connectors tab**

    Click the **`...`** button in the preview toolbar, then select **Connectors**.

    <Frame caption="Open Connectors from the toolbar">
      <img src="https://mintcdn.com/dhiwisepvtltd-5e04e6a4/Pv1xS2a1Y3tpMudK/images/build-docs/connectors/shared/connectors-tab-open-light.webp?fit=max&auto=format&n=Pv1xS2a1Y3tpMudK&q=85&s=70d644dfa794512e73aaf96a8bacd4d2" alt="Toolbar dropdown with Connectors option highlighted." className="theme-image light-image" width="2880" height="1624" data-path="images/build-docs/connectors/shared/connectors-tab-open-light.webp" />

      <img src="https://mintcdn.com/dhiwisepvtltd-5e04e6a4/Pv1xS2a1Y3tpMudK/images/build-docs/connectors/shared/connectors-tab-open-dark.webp?fit=max&auto=format&n=Pv1xS2a1Y3tpMudK&q=85&s=e52b6a00d3e5fac491555adefaa3fc74" alt="Toolbar dropdown with Connectors option highlighted." className="theme-image dark-image" width="2880" height="1624" data-path="images/build-docs/connectors/shared/connectors-tab-open-dark.webp" />
    </Frame>

    Click the **Razorpay** card, then click **Connect**.

    <Frame caption="Razorpay card in the Connectors panel">
      <img src="https://mintcdn.com/dhiwisepvtltd-5e04e6a4/-ShA47Mi9wOw84qL/images/build-docs/connectors/razorpay/web-browser/razorpay-connectors-tab-light.webp?fit=max&auto=format&n=-ShA47Mi9wOw84qL&q=85&s=746c90852a3885b03a1fc9cd53da8ceb" alt="Connectors tab showing the Razorpay card with a Connect button." className="theme-image light-image" width="1802" height="479" data-path="images/build-docs/connectors/razorpay/web-browser/razorpay-connectors-tab-light.webp" />

      <img src="https://mintcdn.com/dhiwisepvtltd-5e04e6a4/-ShA47Mi9wOw84qL/images/build-docs/connectors/razorpay/web-browser/razorpay-connectors-tab-dark.webp?fit=max&auto=format&n=-ShA47Mi9wOw84qL&q=85&s=71ce2add3482e91e5e38012d1a4263b1" alt="Connectors tab showing the Razorpay card with a Connect button." className="theme-image dark-image" width="1800" height="453" data-path="images/build-docs/connectors/razorpay/web-browser/razorpay-connectors-tab-dark.webp" />
    </Frame>

    **Option 3: From workspace Settings**

    <Card title="Connect from workspace Settings" icon="plug" href="/getting-started/workspace/connectors" horizontal arrow="true">
      Connect once from Settings and it is available across all tasks.
    </Card>

    **After clicking Connect**

    Razorpay's authorization screen opens. Review the permissions Rocket is requesting, check **I've read Terms & Conditions**, then click **Authorize**. A green dot appears next to Razorpay when the connection is active.

    <Frame caption="Razorpay OAuth authorization screen">
      <img src="https://mintcdn.com/dhiwisepvtltd-5e04e6a4/alXpBNm3tlaGXX_V/images/build-docs/connectors/shared/razorpay-oauth-screen.webp?fit=max&auto=format&n=alXpBNm3tlaGXX_V&q=85&s=381f380fd665faf88c038a102d58623f" alt="Razorpay OAuth authorization screen showing the permissions Rocket is requesting." className="theme-image" width="1052" height="1284" data-path="images/build-docs/connectors/shared/razorpay-oauth-screen.webp" />
    </Frame>

    **Disconnect**

    <Card title="Disconnect a service" icon="plug" href="/getting-started/workspace/connectors#disconnect-a-service" horizontal arrow="true">
      Disconnect or switch accounts from workspace Settings.
    </Card>
  </Tab>

  <Tab title="Mobile App">
    You can connect from two places. Both do the same thing.

    **Option 1: From chat**

    Type a prompt that mentions Razorpay. Rocket detects the intent, shows a **Connect** button, and the authorization flow opens when you tap it.

    **Option 2: From the Connectors tab**

    1. Tap the **More** button in the header.
    2. Tap **Integrations**.
    3. Tap the **Razorpay** card, then tap **Connect**.

    **After tapping Connect**

    Razorpay's authorization screen opens. Review the permissions, check **I've read Terms & Conditions**, then tap **Authorize**. A green dot appears next to Razorpay when the connection is active.

    **Disconnect**

    Go to **Integrations > Razorpay**. Tap **Disconnect** to remove the integration.
  </Tab>
</Tabs>

<Divider />

## Example prompts

| Use case               | Prompt                                                                                                                  |
| ---------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| Simple checkout        | `Add a Razorpay checkout for my ₹999 product with a success page.`                                                      |
| Subscription plans     | `Create a pricing page with Free, Pro (₹499/mo), and Enterprise (₹1999/mo) tiers using Razorpay.`                       |
| Order history          | `Add an Orders page that shows the user's past Razorpay payments with status and amounts.`                              |
| Refund flow            | `Add a Refund button on the order detail page that triggers a full Razorpay refund and updates the order status.`       |
| Webhook handler        | `Set up a Razorpay webhook handler for payment.captured and payment.failed events and update the database accordingly.` |
| International checkout | `Add a Razorpay checkout that supports INR and USD with automatic currency detection.`                                  |

<Divider />

## Tips

* **Always start in Test Mode.** Use Razorpay's test credentials during development. Switch to Live Mode only when you are ready to accept real payments. Test card: `4111 1111 1111 1111`.
* **Webhooks are handled automatically.** Rocket generates the webhook handler code for common events like `payment.captured`, `subscription.charged`, and `refund.processed`.
* **Connect Supabase first.** Rocket links Razorpay customers and orders to authenticated Supabase users. Connect Supabase before adding Razorpay for a complete payment flow.
* **Refunds and disputes live in Razorpay.** Manage financial reconciliation, settlements, and disputes directly from the Razorpay Dashboard.
* **INR is the default currency.** Razorpay supports multi-currency but defaults to INR. Mention your target currency explicitly in your prompt if needed.

<Divider />

## What's next?

<CardGroup cols={2}>
  <Card title="Supabase" icon="database" href="./supabase">
    Connect Supabase for user accounts and order storage to complete the payment flow.
  </Card>

  <Card title="Resend" icon="envelope" href="./resend">
    Send payment confirmation and receipt emails automatically after Razorpay payments.
  </Card>

  <Card title="Stripe" icon="credit-card" href="./stripe">
    Need global card payments? Stripe is an alternative for non-India markets.
  </Card>

  <Card title="Build a SaaS app" icon="book" href="/learn/recipes/saas">
    Full recipe: Supabase + payments + email to build a complete SaaS product.
  </Card>
</CardGroup>
