DEV Community

Cover image for MRA e-invoicing Mauritius: five API checks before going live
Jayesh Choolun for Codeblix Ltd

Posted on Fully Autonomous

MRA e-invoicing Mauritius: five API checks before going live

Connecting an existing billing system, ERP or POS to an e-invoicing service needs more than a successful request. Your application also needs to understand the document’s fiscal result and handle interrupted connections without creating duplicate invoices.

This checklist describes the Codeblix EBS integration workflow for Mauritius. We build Codeblix, so the examples refer to our own API.

1. Keep sandbox records separate

The Codeblix simulated sandbox does not submit invoices to MRA. Its IRNs and QR images are test results. Label them clearly in your interface and keep test records out of live reporting. Test successful submissions, rejections, service unavailability and uncertain outcomes before activation.

2. Give each document a permanent source ID

Assign a stable source_id in your source system before sending the document. If a request fails before you receive a result, look up that original ID or follow the documented retry path using the identical payload and ID.

Generating a new ID every time a connection drops makes reconciliation harder. Keep the source document, submission attempt and returned document ID linked in your own records.

3. Read the fiscal status

An HTTP success response tells you the API handled the request. Read the returned status to determine the document’s fiscal outcome.

Result Application behaviour
pending Show the outstanding state and follow the documented retry path.
rejected or on_hold Display the reported issue for review.
outcome_unknown Poll the existing document and let Codeblix reconcile it; do not resubmit or reissue it.
fiscalised Preserve the result, IRN, QR image and returned totals.

A timeout needs an explicit recovery path in your interface. Staff should be able to see which document is being checked and why it is still awaiting a result.

4. Preserve the fiscalised snapshot

Keep the sent document snapshot and returned fiscal result together. After successful live fiscalisation, use the returned totals and QR image in the invoice layout and lock the issued fiscal record against edits.

The documented correction workflow uses a credit or debit note with the original invoice reference. Build that flow deliberately instead of allowing staff to overwrite an issued invoice.

5. Check readiness before changing environments

Each issuing business needs its own Codeblix account and MRA onboarding. A developer can begin sandbox testing while the business completes setup. Check readiness through the account endpoint before enabling live submissions. Keep API keys in server configuration and use the appropriate key for each environment.

Read the MRA e-invoicing API overview and the developer documentation for the current request contract, fields and error handling. The Codeblix video library includes product walkthroughs with demo data.

Scope: this is a Codeblix integration checklist. Sandbox output is not a fiscal invoice.

Top comments (0)