Home › iDempiere Payment Link Plugin
Send invoices with a payment link, and get paid in iDempiere
Customers often pay outside the ERP, and someone then matches the payment and keys it in. This project closes that loop. Staff run one process in iDempiere to email each customer a secure Razorpay payment link with the invoice PDF. When the customer pays, a Spring Boot service verifies the signed webhook, and iDempiere pulls the result on a schedule, then creates and completes the payment against the invoice. The service side is tested; the iDempiere receipt posting is still being verified end to end.
Request a quote or demoSee what it doesBefore and after
- Send the invoice
- The customer pays outside the ERP
- Someone matches the payment and keys it in
- Run one process: the invoice PDF and a secure link go out
- The customer pays on the hosted page
- iDempiere posts a completed receipt against the invoice
From open invoice to payment
- In iDempierePick and send
Run the process with a filter. Paid, credit-memo, nothing-open and no-email invoices are skipped and reported. The invoice PDF and link go out by standard iDempiere mail.
- Spring Boot serviceCreate the link
Creates a Razorpay link for the open amount, or reuses the active one.
- RazorpayCustomer pays
The customer pays on the hosted payment link page.
- Razorpay to serviceVerify the webhook
The signed webhook is verified and the link is marked paid, or flagged if the amount differs.
- In iDempierePost the payment
A scheduled sync pulls the paid link, completes the customer receipt against the invoice and confirms back.
The ERP plugin only talks to the service, and the service is the only part that talks to the gateway. iDempiere pulls results from the service, so the service never needs access to your ERP.
What you get
- Bulk send with safety filters
- Filter by invoice, invoice date range, business partner, document type, organization or due date. At least one filter is required, so the process can't email every open invoice by accident.
- Smart eligibility
- Skips paid invoices, credit memos, invoices with nothing open, invoices with no contact email and currencies without two decimals, and reports sent, skipped and failed counts.
- Resend or regenerate
- Resend emails the same link again. Regenerate cancels the old link at the gateway and issues a new one. Every link stays in the history, so nothing is overwritten.
- Standard iDempiere email
- The invoice PDF is attached and the link is available in mail templates as
@PaymentLinkURL@. The link is cleared from the invoice once it finishes, so old links never appear in later mails.
- Link reuse and regeneration
- The same invoice and amount reuses the active link. If the open amount changes, the old link is cancelled at the gateway and a new one is issued, so only one live link exists per invoice.
- Payment history on the invoice
- A read-only Payment Links tab shows status, expiry, gateway references, payment details and errors, and the current link shows on the invoice header.
- Per-organization setup
- A configuration window stores the service URL, API key (shown masked), gateway, bank account, mail template and expiry days. An organization row overrides the client-wide one, with role-based access.
- Automatic payment posting
- Paid links become completed customer receipts against the invoice, using the configured bank account, with amount and currency checks and guards against double posting.
- Scheduled sync
- A Sync Payment Links process runs on an iDempiere scheduler (every 5 minutes by default) or on demand. It pulls changed links, updates them and confirms each one back to the service.
- Mismatch and late payments
- A payment with a different amount is flagged for review instead of posted. A payment on an expired or cancelled link is accepted but flagged "review needed".
Built to be safe with money
- Only your systems can call the service
- API-key authentication on the service, the key stored encrypted in the ERP, HTTPS required for the service URL (except localhost), and no secrets in code (environment variables).
- Forged webhooks are rejected
- HMAC-SHA256 signature verification with constant-time comparison.
- Retries never apply twice
- Events are deduplicated atomically with
INSERT … ON CONFLICT DO NOTHINGinside the same transaction as the state change, so gateway retries are safe and never skipped. If processing fails, the record rolls back so the retry is handled. - One live link per invoice
- A partial unique index enforces it, and stale half-created links are failed automatically.
- Wrong amounts are caught
- A payment is flagged as a mismatch when the amount or currency differs, and is never posted automatically.
- No money left unmatched
- If money was received but not yet posted, the service refuses to create another link for that invoice. A mismatch also blocks new links until iDempiere has recorded it.
- The service never calls into your ERP
- iDempiere pulls unsynced links and confirms each one, so the service needs no ERP credentials. Confirmation is idempotent.
- One failure never sinks a batch
- Each invoice is sent in its own transaction, and each paid link is synced in its own transaction. If the mail fails after the link is saved, the link is kept and can be resent.
- Another gateway needs no ERP change
- Gateway and webhook-adapter interfaces plus a registry. A new gateway needs one implementation of each interface plus configuration.
- Installs like any ERP bundle
- Tables, columns, windows, menu, roles, processes and the scheduler come from re-runnable SQL scripts. The plugin is an OSGi bundle with annotation-based process registration and no generated model classes.
- Tested
- Unit tests cover link creation rules, webhook handling and signature failures. Scripted checks against the service cover create, reuse, changed amounts, auth failures and the full amount-mismatch and Regenerate scenario. The iDempiere-side posting is not yet covered.
What it's built with, what you need
Tech stack
- Service
- Java 17, Spring Boot 4.1, Spring Web MVC, Spring Data JPA (Hibernate), Bean Validation, Flyway, PostgreSQL, Actuator, Razorpay Java SDK, Maven
- ERP plugin
- iDempiere 13, OSGi (Declarative Services), Java
HttpClient, Jackson, PL/pgSQL dictionary scripts - Integrations
- Razorpay Payment Links API and webhooks, REST/JSON
You need
- iDempiere 13 on Java 17 with PostgreSQL
- A Razorpay account (test mode works for evaluation)
- A place to run the Spring Boot service with its own PostgreSQL database, which can be the same machine as iDempiere
- A public HTTPS URL for the gateway to send webhooks to
- A contact email on each customer's business partner record
- A bank account and a mail template with the link placeholder, set in the configuration window
Not yet run with live payments, and the iDempiere receipt posting has not yet been verified end to end. Only currencies with two decimals are supported. Confirm production requirements before relying on it.
Common questions
Does it work with iDempiere 13?
Yes. The ERP side is an OSGi plugin for iDempiere 13 on Java 17 and PostgreSQL. A separate Spring Boot service talks to the payment gateway.
Which payment gateway does it use?
Razorpay Payment Links. The service is gateway-neutral, so another provider can be added with one gateway implementation and one webhook adapter, without changing the ERP plugin.
Can it email every open invoice at once?
No, by design. The process needs at least one filter (invoice, date range, business partner, document type, organization or due date), so a bulk send can never go to every open invoice by accident.
What is the difference between Resend and Regenerate?
Resend emails the existing link again. Regenerate cancels the old link at the gateway and issues a new one. The old row stays in the history as Cancelled.
What happens if the invoice amount changes after a link was sent?
The old link is cancelled at the gateway and a new one is issued for the new open amount, so only one live link exists per invoice.
Are gateway retries and duplicate webhooks safe?
Yes. Webhook signatures are verified with HMAC-SHA256, and each event is deduplicated atomically in the same transaction as the state change, so retries are never skipped or applied twice.
Does it record the payment in iDempiere automatically?
That is how it is built: iDempiere pulls paid links from the service on a schedule (every 5 minutes by default) or on demand, creates and completes a customer receipt against the invoice, and confirms back to the service. Amount and currency are checked first. This iDempiere-side posting has not yet been verified end to end; the service and webhook side has been tested in Razorpay test mode.
What if the customer pays a different amount?
The link is flagged as an amount mismatch for review, no payment is posted automatically, and no new link is issued until iDempiere has recorded it. After review, only Regenerate issues a new link.
Has it been used with live payments?
Not yet. It has been developed and tested in Razorpay test mode, including a real payment arriving through a webhook tunnel. The iDempiere receipt posting is still to be verified end to end. Confirm production requirements before going live.
Want it for your iDempiere?
Tell me your iDempiere version, invoice volume and payment gateway, and I'll reply with pricing and next steps.
India GST E-Invoice (IRP) Plugin
Generate and cancel IRNs straight from iDempiere invoices, with schema validation and a full audit trail.
View project →