Offline ModeMyInvoisReliabilityE-Invoicing

What Happens When You Can't Connect to MyInvois? Offline E-Invoicing Explained

The MyInvois API won't always be available. Here's what happens when you can't connect, what LHDN expects you to do about it, and how to keep your business running when their system is down.

F
Finvo Team
7 min read

The reality of API availability

Any system that relies on an internet connection to a government server will experience downtime. This is not a criticism of LHDN — it is a fact of networked computing. The MyInvois API can become unavailable due to:

  • Scheduled maintenance — LHDN periodically takes the system offline for updates
  • Peak load — High submission volumes (especially around tax deadlines) can cause slowdowns or timeouts
  • Network issues — Your internet connection, your ISP, or any point between your device and LHDN's servers can fail
  • Unexpected outages — Server failures, infrastructure problems, or other unplanned incidents

For businesses that issue invoices throughout the day — restaurants, retail shops, service providers with on-site billing — even 30 minutes of downtime is a problem. You cannot tell a customer to wait while the tax system comes back online.

What LHDN expects during downtime

LHDN's guidelines acknowledge that connectivity issues will occur. The expectation is:

  1. Continue issuing invoices to customers — Do not stop business operations because MyInvois is unavailable
  2. Queue the e-invoices locally — Store them on your device or system
  3. Submit once connectivity is restored — E-invoices should be submitted as soon as the API becomes available again
  4. Maintain the correct timestamps — The invoice date and time should reflect when the transaction actually occurred, not when the e-invoice was submitted to LHDN

The key point: you are expected to keep doing business. E-invoicing is a reporting obligation, not a prerequisite for completing a sale.

The problem with the MyInvois portal approach

If you use the MyInvois portal (the web-based interface) for manual submission, you have zero offline capability. When the portal is down:

  • You cannot submit e-invoices
  • You cannot check the status of previous submissions
  • You cannot cancel or manage existing e-invoices
  • You have no queue — invoices that need to be submitted simply wait until you can access the portal again and enter them manually

This is one of the strongest arguments for using a third-party e-invoicing app with offline support, rather than relying solely on the portal.

How offline queuing works, in systems that do it

This section describes the general design. It is worth understanding because it is what people usually mean when they ask whether a tool "works offline", and because the shape of it explains why the answer matters less than it sounds — the failure that actually bites is LHDN being unreachable, not you being disconnected.

A system built for offline capture works like this:

Step 1: Create the invoice normally

When you create an invoice — whether you are online or offline — such a system generates a complete e-invoice document with all 55 mandatory fields, formatted in UBL 2.1. The document is stored locally on your device.

Step 2: Attempt submission

It tries to submit the e-invoice to the MyInvois API. Three outcomes are possible:

OutcomeWhat Happens
SuccessLHDN validates the e-invoice, returns a UUID, and the invoice is marked as submitted
Validation errorLHDN rejects the e-invoice due to data issues (wrong TIN format, missing fields, etc.). It shows the specific errors to fix
Connection failureThe API is unreachable. The e-invoice is placed in the offline queue

Step 3: Queue management

E-invoices in the offline queue are:

  • Stored securely on your device — Encrypted local storage ensures your business data is protected even if the device is compromised
  • Marked with a pending status — So you can see exactly which invoices have not yet been submitted to LHDN
  • Ordered chronologically — First in, first out. Earlier invoices are submitted first when connectivity resumes

Step 4: Automatic retry

When connectivity is restored, such a system automatically:

  1. Detects that the MyInvois API is reachable
  2. Processes the offline queue in order
  3. Submits each pending e-invoice
  4. Updates the status of each invoice (validated, rejected with errors, etc.)
  5. Notifies you of the results

No manual intervention required. You do not need to remember which invoices were not submitted — the system tracks everything.

The circuit breaker pattern

Sophisticated e-invoicing apps use a circuit breaker to handle API instability intelligently. Here is how it works:

Normal operation (circuit closed)

Every e-invoice submission goes directly to the MyInvois API. If it succeeds, great. If it fails, the failure is noted.

Detecting a problem (circuit opens)

If multiple consecutive submissions fail (for example, 3 failures in a row), the circuit breaker opens. This means:

  • The app stops trying to submit to the API immediately
  • New invoices go directly to the offline queue
  • The app periodically sends a small test request to check if the API is back

Recovery (circuit half-open)

When a test request succeeds, the circuit enters a half-open state:

  • The app tries submitting one real e-invoice
  • If it succeeds, the circuit closes (back to normal) and the queue starts processing
  • If it fails, the circuit stays open and waits before trying again

Why this matters

Without a circuit breaker, every invoice submission during an outage would:

  1. Try to connect to the API
  2. Wait for a timeout (could be 30+ seconds)
  3. Fail
  4. Make your app feel slow and unresponsive

A well-built client stops retrying for a while once it has seen the API fail, instead of making everything slower subsequent action wait for a timeout — so the screen stays responsive while LHDN is down. It does not queue anything locally; the invoice is already saved in your account, and submission is a separate step you or the status poller retry later.

What about the 72-hour window?

A common concern: if an e-invoice is queued offline for several hours before being submitted, does that eat into the 72-hour cancellation window?

No. The 72-hour window starts from the time of LHDN validation, not from the transaction time or the submission time. If you create an invoice at 10:00 AM, queue it offline, and it gets submitted and validated at 3:00 PM, the 72-hour window runs from 3:00 PM.

However, the invoice date and time on the document itself should still reflect 10:00 AM — when the transaction actually occurred. The submission timestamp and the transaction timestamp are separate concepts in MyInvois.

How long can invoices stay in the queue?

There is no hard technical limit, but practically:

  • A few hours is common during scheduled maintenance windows
  • A day or more could happen during major outages or if your device is offline (e.g., working in an area with no internet)
  • Extended periods (multiple days) should prompt you to investigate — is the issue on your end (internet connectivity) or LHDN's end (system outage)?

LHDN expects e-invoices to be submitted in a timely manner. A delay of hours due to technical issues is understood and acceptable. A delay of weeks suggests a compliance problem.

Practical tips for handling outages

1. Always have an offline-capable tool

Do not rely solely on the MyInvois portal. Use an app that can create, store, and queue e-invoices locally. This is your safety net.

2. Check your queue regularly

Most apps show a badge or counter for pending offline submissions. Glance at it periodically. If the number keeps growing and nothing is being submitted, investigate the connection.

3. Keep your device charged and connected

If your e-invoicing app is on a mobile device, ensure the device has enough battery and a stable internet connection (or at least periodic connectivity) to process the queue.

4. Do not duplicate submissions

If an e-invoice is in your offline queue, do not try to submit it again manually through the portal. This could create duplicate e-invoices in LHDN's system, which is a compliance issue.

5. Monitor LHDN announcements

LHDN typically announces scheduled maintenance windows in advance. If you know the system will be down during your business hours, plan accordingly — your offline queue will handle it, but it helps to set expectations.

Artikel Berkaitan