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.

Sales Invoice · INV-2025-00142 Draft
CustomerAcme Ltd
Total AmountMUR 48,500.00
VAT (15%)MUR 7,275.00
Invoice TypeSTD
Transmission→ MRA Portal
✓ Transmitted to MRA
MRA-IRN-3F9A…C2D
🔐
RSA Encrypted Payloads
📋
MRA API Compliant
🔍
QR Code Generation
📂
Full Audit Log

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.

Python JavaScript Frappe Framework ERPNext RSA Encryption
 

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.

1
Create a Sales Invoice

Create your Sales Invoice in ERPNext as usual. The app adds a Generate eInvoice button on the form toolbar.

2
Authenticate with MRA

The app authenticates using your company's MRA credentials (EBS ID, area code, username/password) stored securely in settings.

3
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.

4
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.

Sales Invoice · INV-2025-00142
Draft Generate eInvoice
CustomerAcme Trading Ltd
Posting Date15 May 2025
Grand TotalMUR 55,775.00
Invoice TypeSTD (Standard)
✓ MRA IRN Received MRA-IRN-2025-3F9AB1C2D4E56F78A9B0C1D2E3F4A5B6C7D8

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 Invoice

CRN

Credit Note / Return

DRN

Debit Note

PRF

Proforma Invoice

TRN

Training Invoice

Proforma 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
MRA eInvoice Log
InvoiceTypeTimestampStatus
INV-00142Transmit15 May 25 · 10:42Success
INV-00141Auth15 May 25 · 09:18Success
INV-00139Transmit14 May 25 · 16:05Error
INV-00138Transmit14 May 25 · 14:31Success

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.