MRA e-invoicing API for your existing system
Keep your billing software, ERP, POS or web app. Connect it to Codeblix for MRA e-invoicing in Mauritius. Codeblix remains your EBS provider.
Last reviewed:
The Codeblix e-invoicing API connects software that already creates invoices to the Codeblix EBS service. Your server sends an invoice, credit note or debit note as JSON over HTTPS. Codeblix validates the document, manages the EBS counter and hash chain, and submits it through the business’s MRA connection. After successful live fiscalisation, the API returns the MRA IRN and QR image.
How your system connects to MRA through Codeblix
- 1
Your system creates the document
Keep your customer records, invoice numbering and branded layout. Your developer maps the buyer, line items, tax codes, payment method and totals to the Codeblix API fields.
- 2
Your server sends it to Codeblix
Send an authenticated request to
POST /api/v1/documents. Give each document a permanentsource_idso a network retry can be matched to the original submission. - 3
Codeblix handles the EBS transmission
Codeblix remains the EBS provider between your software and MRA. Live submission uses the issuing business’s configured MRA connection. Your developer integrates with Codeblix’s API.
- 4
Your system checks the result
Read the returned status. When the document is
fiscalised, store the IRN and fiscal result, add the returned QR image to your invoice, and use the returned totals. Keep the fiscalised document locked against edits.
Who can use the e-invoicing API?
This route suits a Mauritius business with an existing invoicing system and a developer who can connect it. It also suits software agencies building billing tools, custom ERP teams, and POS developers who want to add MRA fiscalisation to their own workflow.
Each issuing business needs its own Codeblix account and MRA onboarding. An agency manages the technical integration for its client; the client remains the Economic Operator, and Codeblix remains its EBS provider. If you prefer a ready-to-use portal, see Codeblix invoicing. For existing supported connectors, browse the integration options.
Test in the simulated sandbox first
Create an account at ebs.codeblix.com, then open Extensions > API access and create a Sandbox key. The simulated sandbox uses separate test records and does not submit invoices to MRA. Its IRNs and QR images are marked as sandbox results and are not fiscal invoices.
Your developer can test successful submissions, rejections, service unavailability and uncertain outcomes before live activation. The API guide documents the X-Sandbox-Scenario header for these checks. Sandbox testing can begin while the business completes its MRA setup.
What needs to happen before live invoicing?
- Register the issuing business as an Economic Operator on the official MRA e-Invoicing portal and complete its company, authorised user and place-of-business details.
- Set up the required MRA users and register Codeblix as the EBS for the place of business. Connect the Transmission User details and assigned EBS MRA ID through the secure Codeblix setup.
- Complete the required MRA Test Drive, business confirmation and live activation steps with Codeblix.
- Check live readiness through
GET /api/v1/account. Create a Live key after activation, update the server configuration, and check the first genuine invoice results.
Follow the guided MRA onboarding route or the MRA portal onboarding guide. The authorised business representative completes the MRA approvals. Enter the business’s MRA e-filing password only on the official MRA website; the Codeblix API key is a separate credential.
Developer resources and supported operations
The API uses JSON over HTTPS and Bearer authentication. Keep keys in your server configuration. The developer documentation includes request examples, document fields, tax mappings, errors and onboarding details. The OpenAPI 3 specification provides the machine-readable contract.
| Operation | Endpoint | Use |
|---|---|---|
| Check access | GET /ping | Confirm the key, environment and mode. |
| Check readiness | GET /account | Read company identity and onboarding progress. |
| Submit a document | POST /documents | Send an invoice, credit note or debit note. |
| Read a result | GET /documents/{id} | Check status, totals and fiscal results. |
| Look up a submission | GET /documents?source_id=… | Find a document using your own immutable ID. |
| Retrieve the QR image | GET /documents/{id}/qr.png | Download the authenticated PNG after fiscalisation. |
Handle pending invoices and uncertain outcomes correctly
An HTTP success code confirms the API request was handled. Read status to learn the fiscal outcome. A pending document has not yet reached MRA and can follow the documented retry path. A rejected or on_hold document needs the reported issue reviewed.
If a network request fails before you receive a result, look up the original source_id or repeat the identical request with that same ID. Do not create a new ID for the same invoice. If the API explicitly reports outcome_unknown, MRA may have received it. Poll its status and let Codeblix reconcile the outcome; do not resubmit or reissue it.
For a fiscalised document, preserve the sent snapshot and returned result. Corrections use a credit or debit note with the required original invoice reference, rather than editing an issued fiscal record.
API access and Codeblix EBS pricing
Codeblix EBS starts at MUR 1,000 per month, with a maximum of MUR 2,000 per month based on monthly invoice volume. All EBS add-ons and integrations, unlimited users and unlimited invoices are included. No onboarding fees or additional Codeblix EBS fees. We keep our pricing low to make e-invoicing affordable for Mauritius businesses.
Unlimited invoices are subject to fair use. We analyse monthly invoice volume when quoting your subscription and during ongoing use to keep the service fair and reliable for everyone. If your volume increases beyond fair usage, we will review it with you and agree any change within MUR 1,000–2,000 per month before it takes effect. Your Codeblix EBS subscription will not exceed MUR 2,000 per month. There are no automatic per-invoice overage charges.
Read the current EBS pricing and fair-use terms. When you contact Codeblix, share your approximate monthly invoice volume and the system your developer will connect.
Questions about the MRA e-invoicing API
Can I keep my existing invoicing software?
Yes. Your developer connects its server to the Codeblix API. You can keep your invoice numbers and branded layout, map your document data to the API fields, and add the returned QR image after successful fiscalisation.
Who is the EBS provider when I use the API?
Codeblix remains the EBS provider. Your system sends documents to Codeblix, and Codeblix handles the EBS counter, hash chain and MRA transmission. Each issuing business completes its own MRA onboarding with Codeblix.
Is the Codeblix API the official MRA API?
The Codeblix API is a separate integration service operated by Codeblix Ltd. Your software calls Codeblix. Codeblix then communicates with MRA through the business’s configured EBS connection.
Can a developer or agency integrate several businesses?
A developer can build integrations for several businesses. Each issuing business needs its own Codeblix account, authorised access, MRA registration and EBS setup. One business’s key must not be reused to issue invoices for another business.
Does sandbox access send invoices to MRA?
The simulated sandbox does not submit invoices to MRA. It returns clearly marked sandbox IRNs and QR images. Use it to test your integration, including rejection, unavailability and timeout scenarios. MRA Test Drive and live onboarding are separate steps.
Does every successful HTTP response mean an invoice is fiscalised?
No. Always read the document status. A created document may still be pending, rejected, on hold or awaiting confirmation. Treat it as fiscalised only when status is fiscalised and the fiscal result is present.
Can I send credit notes and debit notes?
Yes. The API supports standard invoices, credit notes and debit notes. Notes need the original invoice reference and a reason, with validation rules described in the developer guide.
How much does the API integration cost?
API integration is part of Codeblix EBS. The monthly subscription is MUR 1,000–2,000 based on invoice volume, with no onboarding or additional Codeblix EBS integration fees. Unlimited invoices are subject to fair use. See the current EBS pricing page for the full terms.