← Back to Blog

A Step-by-Step Guide to Integrating Razorpay with ERPNext

By WovLab Team | February 25, 2026 | 8 min read

Why Integrating Razorpay and ERPNext is a Game-Changer for Your Business

In today's fast-paced digital economy, streamlining your financial operations is not just an advantage; it's a necessity. For businesses running on the powerful, open-source ERPNext platform, the ability to efficiently manage payments is paramount. This is where you integrate Razorpay with ERPNext, a move that transforms your entire accounts receivable process. By connecting Razorpay, one of India's leading payment gateways, directly into your ERP system, you eliminate manual data entry, reduce payment reconciliation times from hours to seconds, and significantly improve your cash flow. Imagine your customers receiving an invoice and being able to pay it instantly online with a single click, with the payment automatically recorded and reconciled in your books. This seamless experience not only delights customers but also drastically cuts down on invoice aging. Businesses we've worked with have seen an average reduction in their collection period by up to 40% within the first quarter of implementation. This integration isn't just a technical tweak; it's a strategic upgrade that automates a critical part of your business, freeing up your team to focus on growth rather than chasing payments and correcting manual errors. It's about creating a robust, error-proof, and highly efficient financial backbone for your organization.

The true power of integrating Razorpay with ERPNext lies in its ability to create a single source of truth for your financial data. When a payment is made, it's not just in your payment gateway dashboard; it's instantly reflected in your ERP's ledgers, against the correct invoice and customer account.

Pre-Integration Checklist: What You Need Before You Start

A successful integration begins with proper preparation. Rushing into the setup without having all your ducks in a row can lead to configuration issues and unnecessary troubleshooting. Before you begin to configure the Razorpay payment gateway in ERPNext, go through this essential checklist to ensure a smooth and efficient process. Taking ten minutes to confirm these items can save you hours of work down the line.

  1. Active Razorpay Account: This is non-negotiable. You must have a fully approved Razorpay merchant account. Once active, locate your Key ID and Key Secret from the Razorpay dashboard under the 'API Keys' section. We recommend generating a separate set of API keys specifically for the ERPNext integration for better security and management.
  2. Administrator Access to ERPNext: You will need full administrator privileges for your ERPNext instance to access the integration settings, configure doctypes, and set up the necessary accounts in your Chart of Accounts.
  3. ERPNext Version 13 or Higher: While older versions may have some support, the out-of-the-box integration is most stable and feature-rich on ERPNext version 13 and newer. We highly recommend being on the latest stable version for security and compatibility.
  4. A Valid SSL Certificate: Your ERPNext site must be served over HTTPS. Payment gateways like Razorpay require a secure connection to transmit sensitive customer and payment data. An SSL certificate is mandatory for the integration to work and for maintaining PCI compliance.
  5. Complete Site Backup: Before installing any new app or configuring a major integration, always take a full backup of your ERPNext database and files. This is your safety net in case anything goes wrong during the setup process.

Ensuring these prerequisites are met will pave the way for a seamless integration, allowing you to quickly leverage the benefits of automated payment collection directly within your ERP.

Step-by-Step Walkthrough: How to Integrate Razorpay with ERPNext

With the preparatory checklist complete, you are now ready to configure the integration. The process is straightforward as ERPNext provides a built-in connector for Razorpay. Follow these steps carefully to link your Razorpay merchant account with your ERP system. This is the core technical part of the setup, where you'll be telling ERPNext how to communicate with Razorpay.

  1. Navigate to Razorpay Settings: Log in to your ERPNext instance as an Administrator. In the Awesome Bar (the main search bar), type "Razorpay Settings" and press Enter. This will take you directly to the integration's configuration page.
  2. Enter Your API Credentials: You will see fields for Razorpay Key ID and Razorpay Key Secret. Carefully copy these values from your Razorpay Dashboard (under Settings > API Keys) and paste them here. Be cautious about leading or trailing spaces.
  3. Enable the Integration: Check the "Enable Razorpay" checkbox. This activates the payment gateway across your ERPNext instance.
  4. Create a Payment Gateway Account: In the 'Payment Gateway Account' table, you need to define how Razorpay transactions are recorded in your books.
    • Click 'Add Row'.
    • In the 'Company' field, select the company for which you are configuring this gateway.
    • For 'Payment Gateway', you can give it a name like "Razorpay - INR".
    • In the 'Account' field, you must link to a ledger from your Chart of Accounts. It's a best practice to create a new cash account specifically for this, such as "Razorpay Clearing Account" under the "Bank Accounts" or "Cash in Hand" group. This isolates your gateway transactions for easy reconciliation.
  5. Save Your Configuration: Once all the details are entered, click the 'Save' button at the top of the page. ERPNext will save your settings and attempt to validate the API keys. If the save is successful, your integration is technically active.

A crucial best practice is to use Razorpay's 'Test Mode' keys first on a staging or development instance of ERPNext. This allows you to run through the entire payment workflow without processing real money, ensuring everything works as expected before going live.

Automating Payments on Invoices and Sales Orders

Once you integrate Razorpay with ERPNext, the next step is to enable it on your sales documents to start collecting payments. This is where the automation truly comes to life. You can allow customers to pay directly against Sales Invoices or even pay an advance for a Sales Order.

To enable the payment option on your Sales Invoices, you need to ensure the invoice print format includes the payment gateway link. When you email a Sales Invoice to a customer from ERPNext, the system can now include a "Pay Now" button. When the customer clicks this button, they are taken to a secure Razorpay checkout page, pre-populated with the invoice amount. They can pay using their preferred method (credit card, UPI, net banking, etc.). Upon successful payment, two critical actions happen automatically:

  1. A Payment Entry is created in ERPNext for the exact amount paid.
  2. This Payment Entry is automatically applied against the corresponding Sales Invoice, marking it as 'Paid' or 'Partially Paid'.

The same logic applies to Sales Orders. You can configure your system to request a percentage of the total order value as an advance payment. The customer receives the Sales Order with a payment link, and upon successful payment, a Payment Entry is created and linked to that Sales Order. This is incredibly effective for securing commitment for custom jobs or large orders before you begin work.

This automated reconciliation is the integration's most significant efficiency gain. It completely removes the need for your accounts team to manually check a bank statement, find a payment, and then hunt for the corresponding invoice in the ERP to mark it as paid.

Troubleshooting Common Issues and Best Practices

Even with a smooth setup, you might occasionally run into issues. Understanding the common pitfalls and best practices can help you resolve them quickly and maintain a robust payment system. Here’s a table of common problems and their solutions, followed by a list of best practices for long-term success.

Common Issue Likely Cause & Solution
'Pay Now' button is missing from the emailed or web view of the invoice. Check three things: 1) The invoice must have an outstanding balance greater than zero. 2) In 'Razorpay Settings', ensure the gateway is enabled. 3) The 'Print Format' used for the invoice must be configured to show the payment link. Check your default print format settings.
Payment is successful in Razorpay, but no Payment Entry is created in ERPNext. This is almost always a webhook issue. Log in to your Razorpay dashboard, go to Settings > Webhooks. Ensure you have an active webhook pointing to `https://[your-erpnext-domain]/api/method/erpnext.integrations.doctype.razorpay_settings.razorpay_settings.webhook`. The webhook is how Razorpay tells ERPNext that a payment was successful.
Users report an authentication error on the payment page. The Key ID or Key Secret is incorrect. Go back to 'Razorpay Settings' in ERPNext and carefully re-enter the keys. Also, ensure you have not mixed up your Test and Live keys. Use Live keys on your live site and Test keys on your staging site.
Transactions are failing with a currency error. Ensure the currency of the invoice in ERPNext matches the currency configured in your 'Payment Gateway Account' settings within ERPNext. For Razorpay in India, this should typically be INR.

Best Practices:

Need Expert Help? WovLab's ERPNext Integration Services

While the standard Razorpay integration with ERPNext is powerful, your business may have unique workflows that require a more tailored solution. You might need custom logic for handling commissions, specific reconciliation processes, or integration with other third-party systems. This is where expert guidance becomes invaluable. At WovLab, we are more than just a digital agency; we are architects of operational efficiency. Based in India, we have deep expertise in the Frappe and ERPNext ecosystem.

Our team of developers and consultants specializes in creating seamless, robust, and scalable integrations. We don't just connect two systems; we analyze your end-to-end business process to ensure the technology serves your strategic goals. Whether you need to integrate Razorpay with ERPNext in a complex multi-company setup, implement custom payment-related validation rules, or automate financial reporting based on gateway data, we have the experience to deliver.

Our services extend beyond ERPNext and payments. We help businesses leverage technology for growth through:

If you want to ensure your ERPNext and payment gateway integration is done right, or if you're ready to take your business operations to the next level, reach out to our team. Visit us at wovlab.com to schedule a no-obligation consultation and let's build a more efficient future for your business together.

Ready to Get Started?

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

💬 Chat on WhatsApp