← Back to Blog

How to Integrate Razorpay in WooCommerce: A Step-by-Step Guide for Indian Businesses

By WovLab Team | May 07, 2026 | 7 min read

Prerequisites: What You Need Before Integrating Razorpay

Successfully preparing to integrate Razorpay in WooCommerce is the foundation of a smooth and secure payment experience for your customers. Before diving into the technical steps, it's crucial to have a few key components in place. Neglecting these prerequisites can lead to configuration headaches, failed transactions, and a loss of customer trust. Think of this as gathering your ingredients before cooking; having everything ready ensures a seamless process. At a minimum, your business will need a live WordPress website with the WooCommerce plugin already installed and configured, full administrative access to your WordPress dashboard, an active and verified Razorpay account, and a valid SSL certificate installed on your hosting server.

Each of these elements plays a critical role. An active WooCommerce store is the obvious starting point. Administrator-level access is non-negotiable, as you'll need to install plugins and manage sensitive settings. Your Razorpay account must be fully activated, which involves submitting your business documentation and completing the KYC process. This ensures you can accept real payments. Finally, the SSL (Secure Sockets Layer) certificate is perhaps the most critical component for security. It encrypts the connection between your customer's browser and your server, protecting sensitive data like credit card numbers. Without SSL, browsers will flag your site as "not secure," and you will not be PCI DSS compliant, a mandatory requirement for handling card payments. Ensuring these four pillars are firmly in place will make the subsequent integration steps straightforward and secure.

A common mistake we see is businesses trying to integrate a payment gateway on a non-secure (HTTP) site. Modern browsers and payment processors like Razorpay strictly require HTTPS (enabled by an SSL certificate) to protect customer data. It's not just a recommendation; it's a requirement for trust and security.

Step-by-Step: Installing and Activating the Razorpay for WooCommerce Plugin

With your prerequisites sorted, the next phase is to install the official Razorpay plugin. This plugin acts as the bridge connecting your WooCommerce store's checkout process directly to your Razorpay payment gateway. The beauty of the WordPress ecosystem is its user-friendly plugin management system, which makes this process incredibly simple. You don't need to download, upload, and unzip files manually. The entire process can be handled directly from your WordPress admin dashboard in just a few clicks. This ease of installation is a primary reason why the WooCommerce-Razorpay combination is so popular among Indian e-commerce businesses.

Follow these exact steps to get the plugin up and running on your website:

  1. Log in to your WordPress Dashboard: Navigate to your website's login URL (e.g., `yourdomain.com/wp-admin`) and enter your administrator credentials.
  2. Navigate to the 'Add Plugins' Screen: From the left-hand menu, hover over Plugins and click on Add New.
  3. Search for the Razorpay Plugin: In the search bar on the top right, type "Razorpay for WooCommerce".
  4. Install the Official Plugin: You will see several results. Look for the official plugin named "Razorpay for WooCommerce" by Team Razorpay. This is crucial for ensuring security and compatibility. Click the Install Now button.
  5. Activate the Plugin: After the installation is complete, the button will change to Activate. Click it to enable the plugin on your site.

Once activated, the Razorpay payment option is technically available but not yet configured. The next crucial step is to link it to your specific Razorpay account using API keys, which will authorize your website to process payments through your merchant account.

Configuration: Finding and Entering Your Razorpay API Keys

After activating the plugin, you must establish a secure connection between your WooCommerce store and your Razorpay account. This connection is authenticated using a pair of unique credentials called API keys. These keys are a Key ID (a public identifier) and a Key Secret (a confidential password). Think of the Key ID as a username and the Key Secret as the password for your website to access the Razorpay system. Correctly configuring these keys is the most critical step to integrate Razorpay in WooCommerce and enable live transactions.

First, you need to generate these keys from your Razorpay Dashboard. Razorpay provides two modes: Test Mode for simulated transactions and Live Mode for processing real money. You'll need to generate keys for both modes.

  1. Log into your Razorpay Dashboard.
  2. Select the appropriate mode (Test Mode or Live Mode) from the top-left menu. It's best practice to start with Test Mode.
  3. Navigate to Settings in the left sidebar, then click on API Keys.
  4. Click the Generate Key button. A new Key ID and Key Secret will be generated.
  5. Immediately copy both the Key ID and Key Secret. The Key Secret is only displayed once, so be sure to save it in a secure location before closing the popup.

Next, return to your WordPress dashboard to enter these keys:

  1. Go to WooCommerce > Settings > Payments.
  2. Find Razorpay in the list of payment methods and click Manage.
  3. You will see fields for Key ID and Key Secret. Carefully paste the keys you copied from the Razorpay dashboard into the corresponding fields.
  4. Ensure the mode in your WooCommerce settings matches the mode from which you generated the keys. If you used Test keys, don't enable Live mode here.
  5. Click Save changes. Your store is now linked to your Razorpay account.

Security Alert: Never share your Key Secret. Treat it like a password. If you suspect it has been compromised, immediately deactivate the old key and generate a new one from your Razorpay Dashboard. Using separate, unique keys for different applications is a recommended security practice.

Testing: How to Run a Test Transaction to Ensure Everything Works

Before you start accepting real payments from your customers, conducting a test transaction is a non-negotiable step. This process validates that the API keys are correct, the plugin is configured properly, and the communication between your WooCommerce store and Razorpay is flawless. Running a test saves you from the potential nightmare of failed customer orders, lost sales, and a frantic scramble to debug a live system. Razorpay's sandbox environment, or Test Mode, is designed specifically for this purpose, allowing you to simulate the entire checkout flow without any real money changing hands.

To begin, ensure both your Razorpay dashboard and your WooCommerce Razorpay settings are in Test Mode. Use the API keys you generated specifically for testing. Once confirmed, follow this procedure:

  1. Go to your storefront and add any product to your cart.
  2. Proceed to the checkout page.
  3. Fill in the required customer details (name, address, etc.).
  4. At the payment selection step, choose Razorpay as your payment method.
  5. When the Razorpay checkout popup appears, you will need to use special test card details provided by Razorpay to simulate a transaction.

Here is a table of common test payment details you can use:

Scenario Card Number Expiry & CVV
Successful Transaction Use any of the test cards on the official Razorpay docs Any future date and any 3 digits (e.g., 12/29, 123)
Failed Transaction Use a specific failure card from Razorpay docs Any future date and any 3 digits (e.g., 11/28, 321)

After entering the test card details, complete the mock OTP verification. You should be redirected to your website's order confirmation page. To confirm success, check two places: first, in your WooCommerce admin under WooCommerce > Orders, you should see the new order with a "Processing" status. Second, in your Razorpay Test Mode dashboard, under Transactions, you should see the corresponding successful payment record. If both are visible, your integration is working correctly.

Troubleshooting Common Razorpay & WooCommerce Integration Errors

Even with a careful setup, you might encounter issues. The key is not to panic but to know where to look. Most problems that arise when you integrate Razorpay in WooCommerce stem from a few common misconfigurations. Having a systematic troubleshooting checklist can save you hours of frustration. The most frequent issues are related to incorrect API keys, mode mismatches (Test vs. Live), and plugin conflicts. Before diving deep, always perform a basic check: Is the Razorpay plugin installed and activated? Are your WooCommerce and WordPress versions up to date?

Here’s a table outlining common errors and their solutions:

Error Message / Symptom Likely Cause Solution
Razorpay option not showing on checkout. The gateway is disabled, or your store's currency is not set to Indian Rupees (INR). Go to WooCommerce > Settings > Payments and ensure the Razorpay gateway is enabled. Then, go to WooCommerce > Settings > General and set your store's currency to INR.
"Authentication failed" or "Bad request error." Incorrect API Key ID or Key Secret. A common mistake is a mismatch between Live keys and Test mode (or vice-versa). Carefully re-copy your API keys from the Razorpay dashboard and paste them into the WooCommerce settings. Ensure you're using Test keys for Test Mode and Live keys for Live Mode.
Payment is successful on Razorpay but order shows "Failed" or "Pending" in WooCommerce. This is often a "Webhook" issue. The webhook is how Razorpay sends a confirmation signal back to your site. It may be blocked by a security plugin or misconfigured. In your Razorpay settings in WooCommerce, copy the Webhook URL. In your Razorpay dashboard, go to Settings > Webhooks, create a new webhook, paste the URL,

Ready to Get Started?

Let WovLab handle it for you — zero hassle, expert execution.

💬 Chat on WhatsApp