SaaS-Based Middleware For LHDN eInvoice Submission

Submitting eInvoices to LHDN requires companies to comply with stringent formatting standards, digital certificate validation, and buyer Tax Identification Number (TIN) requirements. For many businesses, integrating these capabilities into their existing accounting systems and ERPs involves significant effort, cost, and time.

To simplify this challenge, we developed a SaaS-based e-Invoice Middleware that allows multiple companies to seamlessly manage their LHDN submissions. With minimal integration effort, companies can offload the complexities of digital validations, TIN handling, and XML/JSON formatting while ensuring full compliance with LHDN requirements.


The Challenge

Compliance with LHDN’s eInvoice submission standards presents several hurdles:

  1. Complex XML/JSON Formatting: LHDN mandates specific formats for invoice data submissions. Most ERP and accounting systems require significant customization to meet these standards.

  2. Digital Certificate Validation: Submissions require validation through digital certificates, adding technical complexity for software vendors and businesses.

  3. Buyer TIN Management: If buyer Tax Identification Numbers (TINs) are missing, invoices cannot be properly tied to the buyer, delaying claims and submissions.

  4. Effort and Resource Demands: For individual companies or software vendors, building custom integrations to meet LHDN requirements can be time-consuming and resource-heavy.


The Solution

We created a SaaS-based e-Invoice Middleware that acts as a centralized bridge between company accounting/ERP systems and LHDN. This middleware provides an efficient, scalable, and secure way to submit eInvoices while significantly reducing integration overhead.

Key Features and Innovations

  1. Centralized SaaS Platform:

    • Multiple companies can onboard to the middleware and manage their own LHDN credentials and digital certificates.
    • Each company maintains control over its data while leveraging a shared, scalable platform.
  2. Seamless Integration:

    • Companies only need to push invoice data from their existing systems (ERP or accounting software) to the middleware.
    • The middleware automatically handles data validation, digital cert verification, and conversion to the required XML/JSON format.
  3. Buyer TIN Management:

    • When a buyer’s TIN is missing, the middleware generates a secure URL for the buyer to input their TIN information.
    • The system ties the invoice to the correct buyer, ensuring proper compliance and smooth claims submission.
  4. Digital Certificate Validation:

    • The middleware validates submissions using the company’s digital certificate, ensuring all data meets LHDN’s security and compliance requirements.
  5. Consolidated Submissions:

    • The system allows batch or consolidated submissions, further streamlining the process for businesses handling high volumes of invoices.
  6. Status Tracking and Notifications:

    • Companies receive real-time status updates on invoice submissions. Email notifications are triggered once submissions are successful or require further action.

 

How It Works: The Workflow

How It Works: The Workflow

The middleware simplifies the eInvoice submission process into a clear and manageable workflow:

  1. Transaction Creation:

    • A transaction is initiated within the company’s existing system.
    • Invoice data is sent to the middleware.
  2. Data Validation and Preparation:

    • The middleware drafts the invoice data and validates the required digital certificates.
    • Buyer TIN details are checked. If the TIN is missing, the system generates a URL for the buyer to input their information.
  3. XML/JSON Conversion:

    • The validated data is compiled into the required XML/JSON format compliant with LHDN specifications.
  4. Submission to LHDN:

    • The middleware submits the formatted invoice data directly to LHDN’s platform.
    • Successful submissions return a QR code or confirmation content.
  5. Notifications and Storage:

    • Companies receive notifications on successful submissions, and the middleware stores the processed data for reference.


The Technology Stack

  • Backend: PHP with Laravel Framework
  • Frontend: HTML, CSS, and Tailwind CSS
  • Web Server: Nginx
  • Database: MySQL
  • Cloud Infrastructure: Oracle Cloud

Download Source code

The source code for this project is not publicly available.
Please fill out the contact form below, and I’ll get back to you with the necessary details.