← Back to Blog

Step-by-Step Guide: Integrating Razorpay with Your ERPNext System for Seamless Payments

By WovLab Team | April 07, 2026 | 11 min read

Why Integrating a Payment Gateway with ERPNext is a Game-Changer

For any modern business running on ERPNext, the manual process of tracking payments, updating invoices, and reconciling accounts is a significant operational bottleneck. The decision to integrate Razorpay with ERPNext is not just an upgrade; it's a fundamental transformation of your financial workflow. By directly connecting Razorpay, a leading Indian payment gateway, into your ERP system, you eliminate the chasm between sales and accounting. This automation bridges the gap, ensuring that every time a customer pays an invoice via a payment link, the transaction is instantly and accurately recorded in your general ledger. The result is a dramatic reduction in manual data entry, which minimizes human error and frees up your finance team to focus on strategic analysis rather than tedious administrative tasks. This seamless integration accelerates your order-to-cash cycle, providing a real-time, accurate view of your company's cash flow and financial health directly within your ERPNext dashboard. Customer satisfaction also sees a significant boost, as they are provided with a simple, secure, and instantaneous way to settle their accounts, moving your business towards greater operational efficiency and financial clarity.

Automating payment entries through integration can reduce accounts receivable processing time by up to 80%, directly impacting your bottom line by improving cash flow and reducing labor costs.

Furthermore, this integration provides a single source of truth. There's no longer a need to cross-reference spreadsheets with bank statements and Razorpay payout reports. Every payment, refund, and settlement is documented and reconciled within ERPNext automatically. This creates an auditable, transparent trail for every transaction, simplifying compliance and making financial reporting more robust and reliable. For businesses aiming to scale, this level of automation is not a luxury—it is an absolute necessity for maintaining control and visibility over financial operations.

Prerequisites: What You Need Before Starting the Integration

Before you dive into the technical steps, a successful integration requires some foundational setup. Proper preparation prevents common errors and ensures a smooth connection between your ERP and payment systems. Think of this as gathering your tools and ingredients before you start cooking; having everything ready makes the process predictable and efficient. First and foremost, you need an active, running instance of ERPNext, preferably version 13 or newer, as these versions have more stable and feature-rich integration APIs. You must also have Administrator-level access to your ERPNext account to configure system settings and access integration-specific DocTypes. On the payment gateway side, a fully activated Razorpay Merchant Account is essential. A test mode account will not work for live transactions. Once your Razorpay account is active, you will need to generate your API keys.

  1. Active ERPNext Instance (v13+): Ensure your system is up-to-date and you have cleared any outstanding system alerts.
  2. ERPNext Administrator Privileges: Your user account must have the "System Manager" role to access the necessary integration settings.
  3. Live Razorpay Merchant Account: Complete your KYC and business verification on the Razorpay platform to activate your account for live payment collection.
  4. Razorpay API Keys: From your Razorpay dashboard, navigate to the API Keys section under Settings. Generate a new set of keys and securely copy the Key ID and Key Secret. These are your primary credentials for the integration.

Security Tip: Always treat your Razorpay Key Secret like a password. Never share it publicly, commit it to a public code repository, or send it via unsecured email. Store it securely and only enter it into the designated field within ERPNext.

Finally, it's wise to have a basic understanding of your Chart of Accounts in ERPNext. You will need to specify a ledger account (e.g., a "Razorpay" account under current assets) where the funds from the gateway will be initially recorded before being reconciled with bank deposits. This ensures your accounting remains clean and accurate from the start.

The Complete Walkthrough: How to Integrate Razorpay with ERPNext

Connecting Razorpay to ERPNext is a straightforward process handled directly within the ERPNext dashboard. The platform's built-in settings are designed to make this integration accessible without needing custom code for a basic setup. This walkthrough will guide you through every click and configuration needed. By following these steps precisely, you can establish a secure and reliable payment channel, enabling features like generating payment requests with embedded "Pay Now" buttons directly from sales invoices. This is a crucial step to integrate Razorpay with ERPNext effectively and begin automating your revenue collection.

  1. Navigate to ERPNext Integrations: Log in to your ERPNext desk with an administrator account. In the main search bar (press 'Alt+G'), type "Razorpay Settings" and press Enter. This will take you directly to the Razorpay configuration DocType.
  2. Enter Your API Credentials: In the Razorpay Settings page, you will see fields for Key ID and Key Secret. Carefully paste the API credentials you generated from your Razorpay Merchant Dashboard. Check the "Enabled" checkbox at the top of the page to activate the integration.
  3. Configure the Payment Gateway Account: In the "Gateway Account" table, you must define how ERPNext handles the accounting entries. Click "Add Row" and select your company. In the "Payment Gateway Account" field, choose a dedicated account from your Chart of Accounts (e.g., 'Razorpay - INR'). This ledger acts as a clearing account for funds received through the gateway. Save the settings.
  4. Set Up Payment Request: To start using the integration, navigate to a "Sales Invoice" that is in a "Submitted" but "Unpaid" state. Click the "Create" button in the top right, and select "Payment Request". ERPNext will automatically generate a request linked to your Razorpay gateway. You can then email this link to your customer.

This standard setup is incredibly powerful, but it's important to understand its context.

Parameter Built-in Integration (Standard) Custom Connector/Middleware
Setup Time Under 15 minutes Days or weeks of development
Cost Free (included in ERPNext) Significant development and maintenance costs
Core Functionality Payment links on invoices, automatic payment entry creation Can be extended for subscriptions, custom checkout flows, etc.
Maintenance Managed and updated by the Frappe/ERPNext team Requires ongoing developer support to handle API changes

For over 90% of businesses, the built-in integration is the most robust and cost-effective solution. It provides the core functionality needed to accelerate payment collection without the overhead of custom development.

Configuring Webhooks and Automating Payment Reconciliation

Simply entering API keys enables you to create payment links, but the real magic of automation happens via webhooks. A webhook is an automated message sent from an app (Razorpay) to another app (ERPNext) when a specific event occurs. In this context, it's how Razorpay tells your ERPNext instance—in real-time—that a payment has been successfully captured, has failed, or has been refunded. Without webhooks, you would still need to manually check for payments and update invoice statuses. Configuring them correctly is the key to achieving a truly "hands-free" payment reconciliation process. When a payment is made, the webhook triggers ERPNext to automatically create a Payment Entry document and link it to the corresponding Sales Invoice, changing its status from "Unpaid" to "Paid" instantly.

Proper webhook configuration is the difference between a simple payment link and a fully automated accounts receivable system. It ensures your financial data in ERPNext is always up-to-the-minute and accurate, without human intervention.

Here’s how to set it up:

  1. Get the Payload URL from ERPNext: In your ERPNext "Razorpay Settings" page, you will find a field named Webhook URL. This is the unique endpoint URL for your ERPNext instance. Copy this URL.
  2. Create a Webhook in Razorpay: Log in to your Razorpay Dashboard. Navigate to Settings -> Webhooks. Click "Add New Webhook".
  3. Configure the Webhook: Paste the URL you copied from ERPNext into the "Webhook URL" field. You will also need to create a Webhook Secret. This is a password that ERPNext uses to verify that the incoming data is genuinely from Razorpay. Enter a strong, unique secret and also copy this back into the "Webhook Secret" field in ERPNext's Razorpay Settings.
  4. Select Active Events: This is the most critical step. You must tell Razorpay which events should trigger a message. From the list of active events, you absolutely must enable `payment.captured`. This is the event that confirms a successful payment. It is also highly recommended to enable `refund.processed` to automate refund accounting.
  5. Save and Activate: Save the webhook in Razorpay and save your settings in ERPNext. The connection is now live. Razorpay will send a test payload, and your integration is now fully automated.

From this moment on, every successful customer payment will automatically create the corresponding accounting entries and close the invoice, providing you with a perfectly reconciled, real-time view of your revenue.

Troubleshooting Common Integration Issues and Errors

Even with a careful setup, you might encounter issues during the integration process or in day-to-day operations. Most problems stem from simple configuration mismatches or environmental factors. Panicking is not necessary; a systematic approach to troubleshooting can resolve nearly any issue. The key is to understand the data flow: Customer -> Razorpay -> Webhook -> ERPNext. A problem at any stage in this chain can break the automation. For instance, if payments are marked as "Paid" in Razorpay but invoices remain "Unpaid" in ERPNext, the issue almost always lies with the webhook communication. This section provides a practical guide to identifying and resolving the most frequent integration hurdles you may face when you integrate Razorpay with ERPNext.

Here is a troubleshooting table to guide you through common problems:

Common Problem Likely Cause Actionable Solution
"Payment failed" error on the Razorpay checkout page. Incorrect Key ID or Key Secret in ERPNext settings. Or, trying to process international payments without it being enabled on Razorpay. Double-check that the API Keys in ERPNext's Razorpay Settings exactly match the ones from the Razorpay dashboard. Ensure there are no extra spaces. Verify your Razorpay account is activated for live payments.
Payments are successful in Razorpay, but invoices in ERPNext are not updated to "Paid". This is a classic webhook failure. The cause could be an incorrect Webhook URL, a mismatched Webhook Secret, or a firewall on your ERPNext server blocking incoming requests from Razorpay. In ERPNext, verify the Webhook Secret matches the one in Razorpay. In the Razorpay dashboard, check the Webhooks section for failure logs. Ask your server administrator if your firewall is blocking POST requests from Razorpay's IP addresses.
"Bad request: Invalid signature" error appears in system logs. The Webhook Secret in ERPNext does not match the secret configured for that webhook in the Razorpay dashboard. Generate a new Webhook Secret in Razorpay. Copy it, then paste it into the "Webhook Secret" field in ERPNext's Razorpay Settings and save both. This ensures they are perfectly synced.
Payment is recorded, but the wrong General Ledger account is hit. The "Payment Gateway Account" in the Razorpay Settings is incorrectly configured. Navigate to Razorpay Settings in ERPNext. In the "Gateway Account" table, ensure the "Payment Gateway Account" field points to the correct ledger (e.g., your 'Razorpay Clearing Account') for your company.

When troubleshooting, always check the logs first. Both the ERPNext Error Log (found by searching "Error Log" in the awesome bar) and the Razorpay Dashboard's Webhook logs provide detailed clues that can pinpoint the exact source of failure.

Supercharge Your ERP: Get Expert Help from WovLab

Successfully integrating Razorpay with ERPNext is a powerful first step toward true financial automation. It streamlines payments, enhances accuracy, and provides a real-time view of your cash flow. However, this standard integration is just the beginning of what's possible. What about custom subscription models with automated recurring invoicing? Or tiered pricing logic that adjusts based on customer groups? How about AI-powered analytics that forecast cash flow based on payment behaviors, or intelligent dunning workflows that automatically chase late payments? These advanced capabilities move beyond basic configuration and require deep expertise in both the Frappe framework and modern financial technology. This is where a specialist partner can transform your ERP from a simple accounting tool into the central nervous system of your business.

At WovLab, an India-based digital transformation agency, we specialize in pushing the boundaries of what ERPNext can do. Our team of expert developers, cloud architects, and AI engineers doesn't just follow the manual—we write new chapters. We help businesses harness the full potential of their ERP systems by building custom, scalable, and intelligent solutions on top of the powerful ERPNext platform. We understand the unique challenges of the Indian market and have extensive experience deploying complex payment, logistics, and operational workflows.

A standard integration solves today's problems. A custom-developed, AI-enhanced ERP solution from WovLab prepares your business for tomorrow's opportunities.

Whether you need to troubleshoot a complex webhook issue, design a custom payment module, or build an entire AI-driven operational dashboard, our team is ready to assist. Our services extend far beyond basic ERP implementation and include:

Don't let your ERP just be a system of record. Turn it into your most powerful business asset. Contact WovLab today to explore how we can help you supercharge your ERPNext system.

Ready to Get Started?

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

💬 Chat on WhatsApp