A MyInvois API integration is the link that lets your ERP send e-invoices straight to LHDN and receive the validation result back, without anyone logging in to the portal. For companies issuing more than a handful of invoices a day, it is the only practical way to stay compliant. It is also where most of the e-invoice problems we are asked to fix come from: an integration that worked on day one but was never updated as LHDN changed its rules.
One of those changes lands this week. From 24 October 2026, the MyInvois production environment starts enforcing new length limits on amount fields and passport numbers. This article explains how the API flow works, what the change means for your ERP, the errors we see most often and how to test before LHDN starts rejecting documents.
Why the API Matters More Than the Portal
LHDN gives businesses three ways to issue e-invoices: keying them into the MyInvois portal, uploading them in batches from a spreadsheet, or sending them from your own system through the API. The portal is fine for a small business issuing a few invoices a week. Once you are issuing dozens or hundreds a day, typing each one twice is slow and error prone.
Adoption is already wide. LHDN's chief executive said on 1 October 2026 that about 268,000 taxpayers had joined the e-invoice programme and that nearly 1.9 billion e-invoices had been submitted for validation, as reported by The Star. Most of that volume comes through API connections from ERP and accounting systems. If your annual turnover is below RM3 million you may be exempt; our article on the RM3 million e-invoice exemption explains who qualifies.
| Method | How it works | Suits | Main risk |
|---|---|---|---|
| MyInvois portal | Staff key each e-invoice into LHDN's web portal | Very low volumes | Double entry and typing mistakes |
| Batch upload | A spreadsheet of invoices is uploaded to the portal | Moderate volumes, occasional use | Template errors and manual steps every cycle |
| Direct API from ERP | The ERP signs and submits documents and reads back the result | Regular volumes, one main system | Needs maintenance when LHDN changes rules |
| API through a middleware or intermediary | A connector sits between the ERP and MyInvois | Several source systems or a group of companies | One more party to manage and monitor |
How a MyInvois Submission Works
It helps to understand the flow, because most errors happen at a specific step. In plain terms, this is what happens each time your ERP posts an invoice.
- Authenticate. The ERP logs in to MyInvois with a client ID and secret issued to the taxpayer or to an intermediary acting on its behalf, and receives a short lived access token.
- Build the document. The invoice is converted into LHDN's UBL based format in JSON or XML, with supplier, buyer, line items, tax and totals mapped to the right fields.
- Sign it. The document is digitally signed with the company's certificate.
- Submit. The ERP sends the document, alone or in a batch, to the Submit Documents API.
- Check the result. LHDN does only basic checks at submission and returns a submission ID. Full validation runs afterwards, so the ERP must ask for the submission result and record whether each document is Valid or Invalid.
- Store the proof. For valid documents the ERP saves the unique identifier and validation link, and prints the QR code on the invoice sent to the buyer.
Limits your ERP has to respect
The Submit Documents API documentation sets out the size rules: up to 100 documents per submission, 5 MB per submission and 300 KB per document. LHDN recommends staying within 100 requests per minute per client ID, and identical payloads sent again within 10 minutes are rejected as duplicates. An integration that pushes month end billing in one large burst, or retries blindly after a timeout, will run into these limits.
The 24 October 2026 Validation Change
LHDN announced two rule changes in its SDK release notes on 6 August 2026, and confirmed further changes on 25 September 2026. All of them take effect in the production environment on 24 October 2026. The source is the MyInvois SDK release notes.
Amount fields capped at 26 digits
All amount fields will have a maximum length of 26 digits. That sounds generous, and for normal invoice values it is. The problem is how some systems write numbers. An ERP that sends unrounded values with long decimal tails, for example a unit price calculated from a currency conversion, can exceed the limit even on a small invoice. The fix belongs in the ERP mapping, where amounts should be rounded to the precision the business actually uses before the document is built.
Passport numbers limited to 12 characters
When the buyer is identified by passport, the ID must not exceed 12 characters. This was already in the specification, but it is now enforced. We often see passport numbers stored with spaces, dashes or a country prefix typed in by sales staff. Those records need cleaning in the customer master, and the ERP should check the length when the customer is created, not when the invoice is rejected.
Clearer error references
From the same date, validation error responses link to new reference pages for each validator, listing common error codes, causes and fixes. That is good news for whoever supports your integration, but only if your ERP actually stores and shows the error detail instead of a generic failure message.
LHDN's notes say documents that do not meet the criteria may be rejected. Documents already validated keep their status. If you key invoices into the portal by hand, there is nothing to change in a system, but batch upload users should check their spreadsheets follow the same limits.
Common Integration Errors We Fix
When a client calls us because e-invoices are failing, the cause is usually one of these. None of them is exotic, and most could have been caught in testing.
- Wrong or missing buyer TIN. Customer masters migrated years ago often hold old registration numbers or none at all. Our article on e-invoice setup mistakes covers TIN lookups and the general TIN rules.
- Tax totals that do not add up. Line level tax rounded differently from the invoice total leads to rejected documents.
- Wrong classification or tax codes. Each line needs a valid classification code and tax type from LHDN's code lists.
- Credit notes without a reference. Credit and debit notes must reference the original validated e-invoice. This breaks often after a system change.
- Expired certificates or credentials. Digital certificates and client secrets expire. When they do, every submission fails at once.
- No monitoring. The ERP submits, nobody checks the result, and Invalid documents sit unnoticed until a customer asks for the QR code.
The 72 hour window
After an e-invoice is validated, the supplier can cancel it and the buyer can request rejection within 72 hours. After that, corrections need a credit note, debit note or refund note. An integration that reports failures a week late turns a simple cancellation into extra documents and extra work for the finance team. The types of e-invoice article explains when each document is used.
Testing Before It Breaks
LHDN provides a preproduction environment that mirrors the live system. Use it properly. Here is the test routine we run for clients before any rule change or system upgrade.
- Pull real samples. Take last month's invoices, including the largest values, foreign currency documents, credit notes and walk in customers.
- Test the edges. Send amounts close to the 26 digit limit and passport IDs of 12 and 13 characters to confirm the system behaves as expected.
- Read every error. Check that the ERP records the full validation response so users can see what failed and why.
- Test volume. Simulate a busy billing day to confirm batching and retries respect the size and rate limits.
- Clean the masters. Fix TINs, passport numbers and addresses in the customer master rather than patching each invoice.
- Monitor after go live. Set up a daily report or alert that lists any Invalid documents so they are fixed inside the 72 hour window.
The release notes give only the production date for these changes, so do not assume a pass in preproduction means the live system will behave the same way. Watch the first few days of submissions closely after 24 October.
Choosing How to Integrate
There is no single right setup. It depends on how many systems issue invoices and who will maintain the connection.
If your ERP is SAP Business One
We connect SAP Business One directly to MyInvois so invoices, credit notes, debit notes and self billed documents are submitted from the normal posting screens, with the status, unique identifier and QR code stored against each document. Companies that are still on accounting software and weighing a move can read our SAP Business One vs AutoCount comparison, which covers keeping e-invoicing running during a switch, and our SAP Business One implementation guide.
If invoices come from several systems
Distributors with a separate POS, service firms with a billing tool and groups with several companies often do better with one connector that all systems feed into. It gives one place to monitor and one place to update when rules change. Our post on ERP for wholesale and distribution covers the wider system choice for trading companies.
If you do not have IT staff
Integrations need someone to watch certificates, credentials, error queues and LHDN announcements. If nobody in your team owns that, it will be missed. This is a common reason clients add e-invoice monitoring to an IT outsourcing arrangement, or ask us to look after it as part of our e-invoice integration service.
Service businesses that issue many small invoices from a billing tool, and are thinking of moving to an ERP, may also find our guide on moving from accounting software to ERP useful.
Frequently Asked Questions
What is MyInvois API integration?
It is a direct connection between your ERP or accounting system and LHDN's MyInvois system. The ERP builds each e-invoice in LHDN's format, signs it, submits it through the API and reads back the validation result, unique identifier and QR code. It removes double entry in the portal and is the practical choice for businesses issuing invoices every day.
What changes in MyInvois on 24 October 2026?
From 24 October 2026, the MyInvois production environment enforces a maximum length of 26 digits for all amount fields and a 12 character limit for passport IDs. Validation errors will also link to new reference pages with error codes and suggested fixes. Submissions that do not meet the rules may be rejected, while documents already validated keep their status.
Do I need the API if I use the MyInvois portal?
Not necessarily. The portal and batch upload are fine for low volumes and businesses that issue only a few invoices a week. Once you issue many invoices daily, keying each one into the portal takes time and invites mistakes. At that point an API connection from your ERP is usually cheaper than the staff time spent on manual entry.
How many documents can be sent in one MyInvois submission?
LHDN's Submit Documents API accepts up to 100 documents per submission, with a maximum of 5 MB per submission and 300 KB per document. LHDN recommends staying within 100 requests per minute per client ID, and an identical payload repeated within 10 minutes is rejected as a duplicate. Your ERP should batch and retry within these limits.
Can an e-invoice be cancelled after it is validated?
Yes, but only within 72 hours of validation. In that window the supplier can cancel the e-invoice and the buyer can request rejection. After 72 hours, any correction has to be made with a credit note, debit note or refund note that references the original validated document. Fast error monitoring in your ERP keeps fixes inside that window.
Does SAP Business One connect to MyInvois?
Yes. SAP Business One can be connected to MyInvois through the API so invoices, credit notes, debit notes and self billed documents are submitted from the system. The status, unique identifier and QR code are stored against each document. The connection is set up and maintained by the implementation partner, including updates when LHDN changes its validation rules.
Not sure your e-invoice integration is ready for 24 October? We can review your MyInvois connection, test it against the new rules and tell you what needs fixing. No commitment.
Get an Integration Check