Introducing the Chargebee CLI

Razorpay — Domestic & Export

Connect Razorpay for businesses legally registered in India (Domestic, and optionally Export). Use this page after you choose Domestic & export in Chargebee.

If you are still deciding between Domestic / Export and Import, start on Razorpay.

See also

On this path

  1. Complete Prerequisites
  2. Connect with Razorpay (OAuth) — recommended for new connections
  3. Return to Enable payment methods
  4. Configure Cards or UPI & Netbanking

Prerequisites

For Domestic / Export accounts

  • Configure your Chargebee test and live sites with Razorpay independently. Payment information and data on the test site are not available on the live site.
  • S2S (Server to Server) integration, Virtual Payment Address (VPA) validation, recurring CAW (Charge_At_Will), and recurring e-mandates must be enabled in your Razorpay account. Contact Chargebee Support for assistance. Razorpay may take 25 to 30 business days to connect with the bank and enable these permissions as per regulatory requirements.
  • Webhooks are mandatory for the legacy Key ID / Key Secret connection.
  • Enable Auto Capture with Custom timeout on Razorpay when you need time to void or refund authorized payments before capture. See Razorpay capture settings.
  • For Export (non-INR presentment), enable international payments on the Razorpay Domestic account first. See Razorpay: enable international debit and credit cards.

Webhooks with OAuth: For Razorpay connections using OAuth, you do not need to configure webhooks manually in Razorpay. Chargebee handles that for you.

Configure Razorpay Domestic and Export in Chargebee

First choose Domestic & export in How will you process payments? on Razorpay.

Connect with Razorpay (OAuth)

For new Razorpay gateway connections, Chargebee uses OAuth.

  1. After choosing Domestic & export, open Connect with Razorpay.

  2. If you already have a Razorpay account: click Connect to an existing account and authorize Chargebee.

  3. If you do not have a Razorpay account: click Create one, complete Razorpay signup / KYC, then authorize Chargebee.

  4. When authorization succeeds, the Razorpay account is linked in Chargebee.

What’s next after OAuth

  1. Enable payment methods on the Razorpay overview.
  2. Configure Razorpay Cards and/or Razorpay UPI & Netbanking.
  3. Optionally enable Gateway Access Error Notifications so admins are alerted if reconnect is needed.

Legacy: Key ID and Key Secret

Use this path only if you must maintain an existing Key ID / Key Secret connection. Prefer OAuth for new setups.

Retrieve Razorpay Key ID and Key Secret

  1. Log into your Razorpay account.

  2. If you already have the Key ID and Secret Key, note them and continue to Add Razorpay Gateway. If you do not, go to Settings > API Keys, and click Regenerate Key.

  3. In the Roll Key pop-up, select the option that keeps the previous key available until you finish updating every system that still uses it, then click OK to view the new details.

  • The new key details cannot be viewed later. Note them down or use Download Key Details.
  • Inventory every Chargebee site, Razorpay integration, and other consumer that uses the previous Key ID and Key Secret. Update each consumer to the new credentials before you disable the previous key. Keep the previous key active until migration is complete so payment processing is not interrupted.

Add Razorpay Gateway (Legacy Key ID / Key Secret only)

  1. Enter the Key ID and Key Secret from your Razorpay account in the applicable fields.

  2. Select the relevant account type from the Razorpay Account Type drop-down menu and click Connect.

Configure webhooks (Legacy Key ID / Key Secret only)

Webhooks are mandatory for legacy Key ID / Key Secret connections.

  1. Review the Notification URL and Secret in the Notification URL pop-up. Copy these values into Razorpay so Chargebee receives events for this account.

  2. Log in to your Razorpay account. Go to Settings > Webhooks > Add new Webhook.

  3. Paste the Notification URL in the Webhook URL field.

  4. Paste the Secret from the Notification URL pop-up and select all events under Active events.

  5. Enter the email you want to use for webhook alerts and notifications.

  6. Click Create Webhook.

  7. Return to the Chargebee configuration page, select I have added this URL in Razorpay, and click Continue.

After the legacy connection is complete, continue with Enable payment methods.

Reconnect and gateway access error notifications

Enable reconnect emails

Chargebee may email site admins when it detects repeated Razorpay failures that indicate a gateway or merchant configuration issue. These are sent through Gateway Reconnect Mails in Chargebee Notifications.

The email may ask you to reconnect Razorpay. The alert can be triggered by failed transactions on your site, an expired OAuth authorization, or when you manually revoke Chargebee access from your Razorpay account.

  1. Enable Gateway Access Error Notifications (Gateway Reconnect Mails) under Chargebee Notifications for Admin / Owner recipients as needed.
  2. If you receive a reconnect email after an access error, open the gateway in Chargebee and use Reconnect to re-authorize the same Razorpay account.

Reconnect

  • Use Reconnect when you see an access / authorization error, or after Chargebee access was revoked in Razorpay.

  • Sign in to the same Razorpay account that was originally connected. To use a different Razorpay account, add a new gateway instead.

Limitations

  • Legacy Key ID / Key Secret connections require manual webhook configuration and are scheduled for deprecation.
  • S2S, VPA validation, recurring CAW, and recurring e-mandates must be enabled on Razorpay before recurring collection works as expected; Razorpay enablement can take 25 to 30 business days.
  • Export (non-INR presentment) requires international payments to be enabled separately on the Razorpay Domestic account.

For gateway error handling in Chargebee, see Payment errors.