MRA eInvoicing Integration for ERPNext
Seamlessly generate, encrypt, and transmit legally compliant eInvoices to the Mauritius Revenue Authority — directly from your ERPNext Sales Invoice workflow.
| Customer | Acme Ltd |
| Total Amount | MUR 48,500.00 |
| VAT (15%) | MUR 7,275.00 |
| Invoice Type | STD |
| Transmission | → MRA Portal |
MRA-IRN-3F9A…C2D
About the Solution
Tax Compliance Built into Your ERPNext Workflow
The MRA eInvoice Frappe app bridges your ERPNext instance with the Mauritius Revenue Authority's eInvoicing portal. No manual exports, no third-party middleware — just a single button click that authenticates, encrypts, and transmits your invoice payload directly from the Sales Invoice form.
It handles the full compliance lifecycle: from payload construction and certificate-based encryption, to IRN stamping, QR code embedding, and automatic invoice submission.
Core Capabilities
Everything You Need for MRA Compliance
Secure Authentication
Authenticates with the MRA API using company-level credentials stored securely in the settings DocType. Handles token management automatically per transmission.
Intelligent Payload Builder
Automatically derives invoice type (STD, CRN, DRN, TRN, PRF), maps item lines to MRA product codes, and constructs buyer/seller payloads from ERPNext records.
Certificate-Based Encryption
Uses the MRA-issued certificate to encrypt invoice payloads via RSA before transmission — ensuring tamper-proof, legally valid submissions.
IRN & QR Code Stamping
On successful transmission, the Sales Invoice is automatically updated with the MRA Invoice Reference Number (IRN) and a scannable QR code for consumer verification.
Bulk Submission
A list-view action button lets your team select multiple draft invoices and transmit them to MRA in one go — ideal for end-of-day batch processing.
Complete Audit Trail
Every request and response is logged to the MRA eInvoice Log DocType — including headers, payloads, timestamps, and error details for full traceability.
Workflow
How It Works
From a draft Sales Invoice to a fully stamped, MRA-compliant eInvoice in seconds.
Create a Sales Invoice
Create your Sales Invoice in ERPNext as usual. The app adds a Generate eInvoice button on the form toolbar.
Authenticate with MRA
The app authenticates using your company's MRA credentials (EBS ID, area code, username/password) stored securely in settings.
Build & Encrypt Payload
Invoice data is mapped to MRA's schema, the payload is encrypted with the MRA certificate, then transmitted to the MRA endpoint.
Stamp IRN & QR Code
On success, the invoice is stamped with the MRA IRN and QR code, then automatically submitted in ERPNext if it is not a proforma.
| Customer | Acme Trading Ltd |
| Posting Date | 15 May 2025 |
| Grand Total | MUR 55,775.00 |
| Invoice Type | STD (Standard) |
Invoice Types
All MRA Invoice Types Covered
The payload builder intelligently derives the invoice type from ERPNext document flags — no manual selection needed.
STD
Standard InvoiceCRN
Credit Note / ReturnDRN
Debit NotePRF
Proforma InvoiceTRN
Training InvoiceProforma invoices are sent to MRA but are not submitted in ERPNext, maintaining a clean financial ledger.
Audit & Troubleshooting
Full Visibility with eInvoice Logs
Every API call — successful or failed — is recorded in the MRA eInvoice Log DocType. Diagnose any issue in seconds.
- ✓ Authentication request/response logs
- ✓ Full encrypted payload records
- ✓ Linked to source Sales Invoice
- ✓ Error messages with actionable detail
| Invoice | Type | Timestamp | Status |
|---|---|---|---|
| INV-00142 | Transmit | 15 May 25 · 10:42 | Success |
| INV-00141 | Auth | 15 May 25 · 09:18 | Success |
| INV-00139 | Transmit | 14 May 25 · 16:05 | Error |
| INV-00138 | Transmit | 14 May 25 · 14:31 | Success |
Built-in Safeguards
Validations That Protect Your Data
✓ No Duplicate Submissions
Checks for existing IRN before re-transmitting to avoid duplicate eInvoices.
✓ Applicable From Date
Enforces eInvoice requirement only for invoices on or after your configured go-live date.
✓ Proforma Protection
Proforma invoices cannot be submitted in ERPNext, preventing premature ledger entries.
✓ BRN & Tax ID Validation
Validates company BRN and tax identification before any transmission attempt.