Skip to content

LHDN e-Invoice (MyInvois) integration for custom business systems in Malaysia

How Malaysian businesses connect custom ERPs, portals and POS systems to LHDN MyInvois: direct API vs third-party connector, data gaps, sandbox testing and failure handling.

Rosaan Ramasamy · 5 min read

In short

If you invoice out of a standard accounting package such as AutoCount, SQL Account, Xero or QuickBooks, use its built-in e-Invoice module rather than building your own connection. Build a custom MyInvois integration only when your own POS, billing platform, dealer portal or custom ERP generates invoices directly, and decide first whether to connect directly to LHDN’s MyInvois REST API or send approved invoices through your accounting software or a third-party e-Invoice connector (middleware). Most delays come from missing buyer tax data (TIN, MSIC and classification codes) and real-world exceptions like credit notes, self-billed invoices and timeouts, not the API calls themselves.

Most Malaysian accounting packages now come with LHDN e-Invoice support built in. The harder problem sits with companies whose real invoicing happens outside accounting: a multi-branch POS, a custom order portal, a B2B dealer platform or an in-house ERP that staff bill from every day.

When invoices are created in your own system, someone has to bridge the gap to LHDN’s MyInvois platform without creating double work for finance or leaving unvalidated invoices piling up at month-end.

First, check whether you actually need to integrate

Under LHDN’s updated e-Invoice guidelines, businesses with annual turnover below RM3 million are exempted from mandatory e-Invoicing, subject to corporate ownership and related-company rules (a subsidiary or related entity in a group above RM3 million does not automatically qualify for exemption), while Phase 4 MSMEs have an interim relaxation period running to 31 December 2027.⁠[1] Single transactions exceeding RM10,000 also require individual e-Invoices rather than consolidated submissions.⁠[1]

Confirm your exact compliance scope and deadlines with your tax agent or accountant before writing a single line of integration code. Software engineers should implement the rules your tax adviser confirms, not interpret tax law for you.

Three ways a custom system can reach MyInvois

Once you know your custom system must issue validated e-Invoices, there are three architectural paths:

ApproachBest fitMain trade-off
Route through your accounting softwareYour custom system already syncs invoices to AutoCount, SQL Account, Xero or QuickBooks.Simpler compliance upkeep, because the accounting vendor tracks LHDN format updates, though your custom system still needs to pass buyer TINs, classification codes and receive the validated QR/UUID back.
Direct MyInvois REST API integrationHigh-volume custom billing, POS or marketplace platforms where invoices must be validated at checkout or immediately on issue.Full control and no middleman per-invoice fees, but your team owns authentication tokens, LHDN’s UBL 2.1 invoice data format (JSON/XML), digital signing and future LHDN SDK updates.⁠[2]
Approved e-Invoice connector (middleware)Multi-entity groups running several legacy ERPs or custom systems that all need one compliance layer.Faster to connect several old systems, at the cost of a recurring platform fee and another vendor dependency.

For most Malaysian SMEs with one custom operational system and an existing accounting package, routing through accounting or a clean internal bridge layer avoids maintaining two separate compliance workflows. Direct API integration makes sense when checkout speed, custom PDF/QR generation or high transaction volume makes routing through another system impractical.

What actually breaks in MyInvois projects

Connecting to the MyInvois Sandbox and submitting a sample UBL 2.1 e-Invoice is straightforward.⁠[2] Real projects slow down on five operational realities:

  1. Incomplete master data. Legacy customer and product tables rarely store every mandatory field: buyer TIN, registration number (BRN/NRIC), SST registration, MSIC code and LHDN item classification codes. You need validation screens in your own system so bad data is caught before submission, not rejected in batches at 5pm.
  2. Consolidated vs individual e-Invoices. Retail, clinics and service businesses often issue consolidated monthly e-Invoices for walk-in customers, while still needing a self-service QR or web link so any buyer who asks for an individual e-Invoice within the month can enter their TIN and receive a validated one.
  3. Cancellations, rejections and credit notes. Real life includes returned goods, amended prices and rejected documents within the 72-hour window. Your system must track document status (Submitted, Valid, Invalid, Cancelled) rather than sending an invoice once without checking if LHDN accepted it.
  4. Self-billed e-Invoices. Commission payouts to agents, foreign supplier bills or marketplace seller settlements often trigger self-billed e-Invoice rules that live in a completely different workflow from sales.
  5. Timeouts and retries. When MyInvois or an intermediate network slows down, your POS or billing screen must not freeze, and retrying a timed-out submission must never create a duplicate invoice. Failed submissions need a visible list with clear rejection reasons so finance can fix the field and resubmit.

How to test without touching live tax records

LHDN provides a dedicated MyInvois Pre-Production (Sandbox) environment alongside its official SDK documentation and submission formats.⁠[2] Before going live, run a full set of real test cases through the sandbox covering:

  • a standard B2B invoice with SST and multiple line items;
  • a high-value invoice above RM10,000;
  • a consolidated e-Invoice batch;
  • a credit note and a debit note referencing an earlier validated UUID;
  • a cancelled invoice and a deliberately malformed TIN to confirm your staff see a plain-English error they can fix.

Common questions

Should we build a direct MyInvois connection or use our accounting software?

Use your accounting software’s e-Invoice module whenever it can handle your volume and timing. Build a direct connection only when your custom system must issue validated invoices and QR codes immediately, or when you do not want every transaction passing through a third-party per-document fee.

Can you add MyInvois support to an older Laravel, PHP or custom ERP system?

Usually yes, provided the database holds clean line-item, tax and customer records (or we can add the missing fields). We build the MyInvois connector as a separate, monitored integration layer so your core application stays clean and easier to update when LHDN revises its SDK.

What happens when LHDN updates its validation rules or data formats?

Any direct API integration needs an owner after go-live. That is why compliance connections should sit under an ongoing maintenance arrangement rather than a one-off script nobody watches.

How we can help

If your custom POS, portal or internal system needs a reliable bridge to MyInvois or your accounting software, see how we approach system and ERP integration and custom software development.

We usually deliver e-Invoice integrations through Managed Delivery at RM19,000 a month with full technical ownership and live monitoring, so the connection stays monitored and updated as LHDN rules evolve. When the scope and master-data fields are settled, it can run as a Custom Project from RM30,000 after a separate paid Scoping & Blueprint phase (from RM5,000) that your company owns.

Sources

  1. 1.

    Official

    e-Invoice Official Portal and Guidelines (opens in a new tab)

    Lembaga Hasil Dalam Negeri Malaysia (IRBM), 2026. Checked 21 November 2026.

  2. 2.

    Official

    MyInvois SDK and API Documentation (opens in a new tab)

    Lembaga Hasil Dalam Negeri Malaysia (IRBM), 2026. Checked 21 November 2026.

Rosaan Ramasamy

Founder and Managing Director, Antdragon

Rosaan started Antdragon in 2020 after over a decade building commercial software, giving Malaysian SMEs senior engineering leadership and full ownership of their code and accounts.

Filed under Connecting systems

ShareWhatsAppLinkedIn