<link href="https://fonts.googleapis.com/css2?family=Caveat:wght@400..700&family=Google+Sans+Flex:opsz,wght@6..144,1..1000&display=swap" rel="stylesheet">
Razorpay / PayU / Stripe / PayPal

ERPNext payment gateway integration

Collections that reconcile themselves. Most businesses that take online payments have the same quiet problem: money lands in the bank, the invoice stays open, and someone matches the two by hand a week later. The gateway is not the issue. The gap between the payment and the ledger is.

ERPNext supports several gateways natively through the Payments app, and payment requests can be raised against any invoice or order.

Which payment gateways work with ERPNext?

ERPNext supports Razorpay, PayU, Stripe, PayPal and Braintree natively through the Payments app, with others connectable by API. A payment request against an invoice generates a link the customer can pay through, and the successful payment creates a payment entry against that invoice automatically.

Where online collections leak time

None of these are gateway failures. They are all failures of the join between the gateway and the ledger.

Payments arrive without an invoice reference

A customer pays through a generic link or a UPI handle with no reference, so the credit reaches the bank unattached. Someone then works backwards from the amount, which works until two customers pay the same figure on the same day.

Gateway charges disappear into revenue

The gateway deducts its fee before settling, so the amount received is less than the invoice. Booked as a short receipt or netted against sales, the true cost of collection is never visible and gateway pricing never gets renegotiated.

Settlement is batched, receipts are not

Several payments settle as one bank credit, days later. Matching that credit back to the individual invoices inside it is manual, and it is the reason the bank reconciliation always has a queue.

Failed and pending payments look identical

A customer who tried and failed, and one who never tried, both show as unpaid. Without status coming back from the gateway, collections chases the wrong people and misses the ones who need a fresh link.

What a properly wired gateway gives you

The test is whether an invoice closes itself when the customer pays, and whether you can say what collection cost this month.

Payment requests against documents

A payment request raised from an invoice, sales order or quotation generates a link carrying the reference, so every payment arrives already attached to something.

What that means in practice

The link can be emailed or sent over WhatsApp, and the reference travels with it, which is what removes the matching problem at source.

Automatic payment entry on success

A successful payment creates the payment entry against the correct invoice and closes it, without anyone opening the ledger.

What that means in practice

Status flows back from the gateway, so pending, failed and successful are distinguishable rather than all showing as unpaid.

Gateway charges posted separately

The fee deducted by the gateway posts to its own expense account rather than reducing the receipt, so the invoice settles in full and the cost of collection is visible.

What that means in practice

Over a year this single configuration decision is what makes gateway pricing a negotiable number instead of an invisible one.

Settlement matching

Where the gateway settles in batches, the payout is matched against the individual payments inside it, so the bank credit reconciles against many invoices in one action.

What that means in practice

This is the difference between a reconciliation queue that clears daily and one that grows all month.

Refunds and chargebacks

Refunds initiated at the gateway flow back as entries against the original payment, and chargebacks are recorded rather than appearing as an unexplained debit.

What that means in practice

Handled properly, a refunded order reverses cleanly in both revenue and receivables instead of needing a manual journal.

What moves between ERPNext and the gateway

Requests go out, status and settlement come back. Card and account details never touch ERPNext.

Trigger or eventERPNext recordDirectionNotes
Invoice or orderPayment Request + payment linkERPNext → GatewayReference embedded so the payment arrives attached
Successful paymentPayment Entry against the invoiceGateway → ERPNextWebhook driven; invoice closes automatically
Failed or pending paymentPayment Request statusGateway → ERPNextKeeps collections chasing the right customers
Gateway feeExpense accountGateway → ERPNextPosted separately, never netted against revenue
Settlement payoutBank entry matched to many paymentsGateway → ERPNextBatch matching clears the reconciliation queue
RefundEntry against the original paymentGateway → ERPNextReverses receivable and revenue cleanly
ChargebackRecorded adjustmentGateway → ERPNextVisible rather than an unexplained bank debit
Recurring mandateSubscription payment scheduleEitherWhere the gateway supports mandates and you use them
Card or account detailsNot storedNeverHandled entirely by the gateway; ERPNext holds only a token reference

How it goes in

Sandbox first, always. Payment integrations are the one place where testing in production is genuinely irresponsible.

  1. 1

    Choose the gateway on real criteria

    Settlement cycle, fee structure by instrument, refund handling and supported currencies matter more than the integration itself. Where you already have a gateway contracted, this stage confirms what it actually does.

  2. 2

    Configure in sandbox

    Your own gateway credentials are configured against the sandbox environment and a full cycle is run: request, success, failure, refund and settlement.

  3. 3

    Set the accounting treatment

    Which account receives the collection, which takes the gateway fee, and how settlement in transit is held between payment and bank credit. This is agreed with your finance team, not assumed.

  4. 4

    Wire the webhooks

    Status callbacks are configured with signature verification, so ERPNext trusts only genuine notifications from the gateway and a spoofed callback cannot close an invoice.

  5. 5

    Go live on a limited set

    Live with one customer segment or document type first, reconciled against the gateway dashboard for a full settlement cycle before it is opened up.

Timeline shown is indicative. Gateway onboarding and merchant approval sit with the provider and can take longer than the integration.

What this does not do

Payment integrations attract more assumptions than most, so these are worth reading properly.

  • It does not make you a merchant. The gateway account, its contract, its fees and its compliance obligations are yours and are entered into in your own name.
  • It does not store card or bank details in ERPNext. Sensitive data stays with the gateway and ERPNext holds only a reference — which is deliberate, and not something to work around.
  • It does not change settlement timing. When money reaches your bank is set by your gateway contract, not by the integration.
  • It does not reconcile the bank account on its own. Gateway settlement matching and bank reconciliation are related but separate, and both are needed.
  • It does not cover every gateway. Providers outside the natively supported set need API work, and some do not expose the callbacks required to do this properly.

Where a gateway cannot confirm payment status by webhook, automatic reconciliation is not achievable regardless of effort. Better to know that before choosing it.

ERPNext payment gateways —common questions

Razorpay, PayU, Stripe, PayPal and Braintree are supported through the Payments app. Others can be connected by API provided they expose payment status callbacks, which is the requirement that actually determines whether automatic reconciliation is possible.

Yes, where the payment came through a payment request carrying the invoice reference. The gateway's success webhook creates the payment entry against that invoice and settles it. Payments made outside that flow still need matching, which is why the link matters.

The fee posts to its own expense account and the invoice settles at full value, rather than the fee being netted into a short receipt. That keeps receivables clean and makes your total cost of collection a figure you can look at monthly.

No. Card and account data is handled entirely by the gateway; ERPNext holds only a transaction reference or token. This is intentional — keeping card data out of your ERP removes an entire category of obligation and risk.

Yes. The payment request generates a link that can be delivered by email or through a WhatsApp Business message, which is a common pattern for collections. The reference travels with the link either way.

Status is also polled as a fallback, so a missed callback delays reconciliation rather than losing it. Anything still unmatched sits in a queue for review — the same exception-queue pattern used for statutory integrations, and for the same reason.

Next step

Talk to us about online collections

A short call about how customers pay you today and how long an invoice stays open after the money has arrived.

Razorpay, PayU, Stripe, PayPal and Braintree are trademarks of their respective owners. ERPNext and Frappe are trademarks of Frappe Technologies Pvt. Ltd. These names are used here only to identify the services described. Finstein is not affiliated with or endorsed by any of these providers, and merchant accounts are contracted directly in your own name.

ERPNext CalculatorContact Us