myinvois lhdn e-invoicing compliance deep-dive

LHDN MyInvois Explained: A Deep Dive for Malaysian Businesses

Everything you need to know about LHDN MyInvois e-invoicing — the technical architecture, mandatory data fields, submission workflows, error handling, integration options, and real-world implementation tips.

By IntBooks Team

Reading time: ~25 minutes. Audience: business owners, finance managers, and developers responsible for LHDN MyInvois compliance. Skill level: intermediate.

LHDN’s MyInvois e-invoicing system is the most significant change to Malaysian tax administration in a generation. By 2026, every Malaysian business with annual turnover above RM 150,000 must submit every invoice to LHDN’s centralized platform within 72 hours of issue. This guide explains everything: the technical architecture, the data model, the submission workflows, the integration options, and the real-world traps that catch businesses off-guard.

Part 1: Why MyInvois exists

Malaysia’s tax system has historically suffered from significant under-reporting. Cash businesses, informal sector operators, and small B2B service providers routinely understated revenue. The 2018 SST replacement of GST made the problem worse by removing the input tax credit incentive for buyers to ask for receipts.

LHDN’s response, announced in 2022 and rolled out from 2024, was to create a centralized e-invoicing platform that captures every transaction in real-time. Goals:

  1. Real-time tax visibility — every B2B and B2C transaction above the SST threshold flows through one ledger.
  2. Reduced fraud — issuer and recipient TINs are validated against the LHDN database at issue time, eliminating fake invoices and shell-company schemes.
  3. Eliminated paper — invoices, credit notes, debit notes, and refund notes all live in a single digital trail accessible to LHDN auditors.
  4. Ease of compliance — once an invoice is in MyInvois, the corresponding entries on tax returns (SST-02, Form C, etc.) can be auto-populated.

Part 2: The technical architecture

MyInvois is built on three components:

1. The MyInvois portal (web UI)

A web interface where businesses can manually create, submit, and track invoices. Useful for businesses with low invoice volume (under 50 / month) or for fixing rejected submissions. URL: myinvois.hasil.gov.my (production) or preprod.myinvois.hasil.gov.my (sandbox).

2. The MyInvois API (machine interface)

A RESTful HTTP API that allows software to submit invoices programmatically. Authentication uses signed JWT tokens with RSA key pairs. Each business is provisioned a unique key pair during onboarding. The API supports:

  • POST /api/v1.0/documentsubmissions — submit one or more documents
  • GET /api/v1.0/documents/{uuid} — retrieve a document by UIN
  • GET /api/v1.0/documents/{uuid}/raw — retrieve the raw signed XML
  • GET /api/v1.0/documents/{uuid}/details — retrieve validation status

Documents must be UBL 2.1-compliant XML, signed with the issuer’s private key.

3. The validation engine

LHDN’s backend validates every submitted document against ~30 schema rules:

  • All mandatory fields are present
  • TIN exists in LHDN’s database (issuer and recipient)
  • MSIC code matches issuer’s registration
  • Classification codes are valid for the issuer’s industry
  • Tax calculations are arithmetically correct
  • Document type matches the referenced documents (e.g., a credit note must reference a valid invoice UIN)
  • Submission is within the 72-hour window

If all validations pass, LHDN assigns a UIN (Unique Identification Number) and returns a QR code. The UIN is the legal proof that the invoice has been recorded with LHDN.

Part 3: The data model — what’s actually on an invoice

A valid LHDN e-invoice has 55 mandatory fields organized into 5 sections:

Section 1: Issuer (the company sending the invoice)

  • TIN — 10-12 digit LHDN tax identification number
  • Name — legal name as registered with SSM
  • SSM number — 12-digit company registration number
  • MSIC code — 5-digit business activity code
  • Address — full postal address
  • Contact — phone and email
  • Currency — ISO 4217 code (typically MYR)

Section 2: Recipient (the customer)

  • TIN — for B2B; for B2C, use the generic consumer TIN EI00000000010
  • Name — required for B2B
  • Address — required for B2B
  • MSIC code — required for B2B if recipient is also a business
  • Document type code — invoice type the recipient expects

Section 3: Document metadata

  • Invoice number — your internal reference
  • Issue date — when the invoice was created
  • Issue time — to the second
  • Document type — invoice (01), credit note (02), debit note (03), refund note (04), self-billed (11)
  • Currency — ISO 4217 code
  • Exchange rate — required if currency is not MYR
  • Original UIN — required for credit/debit/refund notes (references the original invoice)

Section 4: Line items

Each line has:

  • Description — free text
  • Classification code — LHDN’s product/service code (~5,000 valid codes)
  • Quantity
  • Unit of measure — e.g., “EA” (each), “HUR” (hour), “KGM” (kilogram)
  • Unit price
  • Subtotal — quantity × unit price
  • Discount (optional)
  • Tax type — e.g., “S” (standard), “Z” (zero-rated), “E” (exempted)
  • Tax rate — e.g., 6%, 8%
  • Tax amount — calculated automatically
  • Line total — subtotal − discount + tax

Section 5: Document totals

  • Subtotal — sum of all line subtotals
  • Total discount
  • Total tax
  • Total payable — final amount the customer owes

The total payable must equal Σ(line totals) and must equal subtotal − discount + tax. If any of these don’t reconcile, the validation engine rejects the submission with error MV-014.

Part 4: The 72-hour submission window

This is the most operationally challenging aspect of MyInvois. Once you issue an invoice, you have 72 hours to submit it to LHDN. Backdating is allowed within the window; backdating outside the window is not.

What this means in practice:

  • Issue an invoice on Friday at 5pm → must be submitted by Monday at 5pm
  • Issue an invoice on the 1st of the month → must be submitted by the 4th
  • Issue an invoice on the last day of the month → must be submitted by the 3rd of the following month

The window is enforced server-side. Submissions older than 72 hours are rejected with error MV-029. There is no override.

For businesses with lumpy invoicing (issuing 100 invoices on the 1st of each month and forgetting about them), this is a real risk. For businesses that issue invoices continuously through the day and submit immediately, it’s not an issue.

The safest approach: automate submission at the moment of invoice creation. IntBooks does this by default — when you click “Issue Invoice”, the submission happens in the background.

Part 5: Rejection scenarios and how to handle them

Even when you’ve configured everything correctly, submissions can be rejected. The most common scenarios:

Scenario 1: Recipient TIN is invalid (MV-001)

The customer gave you a TIN that doesn’t exist in LHDN’s database, or you mistyped it.

Fix: Validate the TIN at the LHDN MyTax portal before saving the customer record. IntBooks validates TINs in real-time when you create or edit a customer.

Scenario 2: Issuer MSIC code mismatch (MV-007)

Your invoice declares an MSIC code that doesn’t match your SSM registration.

Fix: Confirm your MSIC at SSM. If you’ve expanded into a new business activity, update your SSM registration first, then update IntBooks Settings → Compliance with the new code.

Scenario 3: Total mismatch (MV-014)

The line item totals don’t add up to the document total. Usually caused by manual rounding errors in legacy systems or edge cases with mixed-rate SST line items.

Fix: Re-save the invoice (the system recalculates) and resubmit. If it persists, check for line items with zero quantity or zero price.

Scenario 4: Referenced UIN does not exist (MV-021)

You’re issuing a credit note that references an original invoice UIN, but LHDN can’t find that UIN.

Fix: Confirm the original invoice was successfully submitted and validated (check its status in your accounting system). If the original is still in Draft or Rejected state, you can’t issue a credit note against it.

Scenario 5: Outside submission window (MV-029)

More than 72 hours have passed since the invoice issue date.

Fix: There is no fix from the API side. You have three options:

  1. Cancel the original invoice and reissue with the current date — only works if the customer hasn’t already paid against it.
  2. Issue a self-billed invoice if the supplier-buyer relationship allows.
  3. Contact LHDN directly and explain the circumstances. They can manually accept the submission in extraordinary cases (system outage, force majeure).

Part 6: Integration approaches

There are 4 ways to submit to MyInvois:

Approach 1: Manual portal entry

Log in to myinvois.hasil.gov.my and create each invoice in the web form. Practical for under 50 invoices/month. Tedious for higher volume.

Approach 2: CSV bulk upload via portal

The portal supports CSV upload of pre-formatted invoice data. Faster than manual but you still need to prepare the CSV carefully.

Approach 3: ERP integration

Use accounting software with built-in MyInvois support. The software handles all the API communication, signing, retries, and UIN storage. IntBooks, SQL Account (with the E-Invoicing add-on), AutoCount (with the E-Invoicing add-on) all work this way.

Approach 4: Custom API integration

If you have an in-house ERP or a unique workflow, you can integrate directly with the MyInvois API. You’ll need:

  • An LHDN-issued client ID and client secret
  • An RSA key pair for signing (you generate; LHDN registers)
  • Code to serialize invoices to UBL 2.1 XML
  • Code to sign the XML with your private key
  • Code to handle the API responses, retries, and error states
  • Storage for the returned UINs

This is significant engineering effort — typically 4-8 weeks for an experienced developer. Not recommended unless you have very specific requirements that off-the-shelf software can’t meet.

Part 7: Sandbox vs production

LHDN provides two environments:

EnvironmentURLUse case
Sandboxpreprod.myinvois.hasil.gov.myTesting, training, integration development
Productionmyinvois.hasil.gov.myReal submissions

Sandbox UINs are not legally valid. They look real but they’re explicitly marked as test data in LHDN’s system. Sandbox is free and unlimited.

Best practice: run at least 20 test invoices through sandbox covering your most common scenarios before going live in production:

  • Standard B2B invoice with multiple line items
  • B2C invoice with the generic consumer TIN
  • Multi-currency invoice (e.g., USD with exchange rate)
  • Mixed SST rate invoice (some lines at 6%, some at 8%, some zero-rated)
  • Credit note against a previously submitted invoice
  • Refund note for a returned product
  • Self-billed invoice (if your industry allows it)
  • Invoice with the maximum allowed line count

If all 8 scenarios pass, you’re ready for production.

Part 8: Real-world implementation tips

After helping dozens of businesses go live with MyInvois, here are the lessons I keep relearning:

Tip 1: Validate TINs at customer-creation time, not invoice-creation time

If you discover a customer’s TIN is wrong when you try to submit an invoice, you’ve already done the work of creating the invoice. Validate at the point you create the customer record so you catch the issue early.

Tip 2: Set up a daily MyInvois submission monitor

Even with automatic submission, things go wrong — the LHDN API may be down, your network may have an issue, your software may have a bug. Schedule a daily check (or use a tool that alerts you) for any invoice in Submitted but not Validated state.

Tip 3: Don’t issue invoices for the previous month

If you forgot to issue an invoice for work completed last month and it’s now beyond the 72-hour window, don’t backdate it. Issue it with the current date and reference the work period in the description. Backdating creates audit risk that’s worse than the timing inaccuracy.

Tip 4: Train your AR team on credit note workflow

Credit notes are the most error-prone document type because they reference an original invoice UIN. Train whoever handles refunds and returns on the correct workflow:

  1. Find the original invoice
  2. Confirm its UIN and status
  3. Issue a credit note from within that original invoice (do not create a new standalone credit note)
  4. Submit immediately

Tip 5: Keep a paper trail of all rejection events

If LHDN audits you and asks “why did you submit this invoice 3 days late?”, having a documented rejection log with timestamps and resolution actions is your defense. Most accounting tools log this automatically.

Tip 6: Plan for the API rate limit

LHDN enforces a rate limit of approximately 60 submissions per minute per organization. For most businesses this is irrelevant — but if you’re running an end-of-month batch of 5,000 invoices, you’ll hit it. Use software that respects the rate limit and queues submissions appropriately.

Part 9: What about industry-specific rules?

LHDN has issued additional guidance for several industries with unique billing patterns:

  • Consolidated invoices for retail — POS systems can submit a daily summary invoice instead of one per transaction
  • Self-billed invoices for agriculture — buyers can issue invoices on behalf of farmer/supplier
  • Tour operators and travel agents — special handling for net-of-commission invoicing
  • Telecommunications — bulk billing rules for service plans
  • Insurance — premium invoicing has specific document type codes
  • Banking and financial services — interest charges have special rules

If you’re in any of these industries, check the latest LHDN industry guide for your sector before going live.

Part 10: Looking ahead — what’s next for MyInvois?

LHDN has signaled several future enhancements:

  • E-receipts for cash transactions (currently only invoices are mandatory)
  • Cross-border integration with the Singapore InvoiceNow network and other ASEAN platforms
  • Real-time tax assessment — moving from periodic returns to continuous tax calculation
  • AI-powered audit selection — using MyInvois data to flag anomalous taxpayers for audit

These are still in the proposal stage but indicate the direction. If you’re building or buying accounting software, prefer vendors with a clear roadmap for adapting to these changes.

Ready to implement?

If you’ve read this far and you’re ready to actually do MyInvois, the easiest path is:

  1. Request closed-beta access to IntBooks — MyInvois is built-in on every plan, including free
  2. Run the onboarding wizard
  3. Validate your first 5 customer TINs
  4. Issue and submit your first test invoice in sandbox
  5. Switch to production and start submitting real invoices

If you need help, contact our team — we have a Kuala Lumpur-based MyInvois implementation team that has migrated dozens of Malaysian businesses.

See also


This guide reflects LHDN guidance current as of April 2026. The MyInvois specification and rules have been revised multiple times since the 2024 launch — always check the official LHDN MyInvois portal for the latest schema and field requirements.