Thought Leadership

Understanding the e-Invoicing API in Malaysia: A Comprehensive Guide

July 24, 2024

Understanding the e-Invoicing API in Malaysia: A Comprehensive Guide

The Malaysian government is pushing towards a more digitised invoicing system. Businesses are required to follow new e-invoicing API regulations that are being rolled out. 

This guide aims to provide a clear understanding of the API for e-Invoicing. We’ll cover, in non-technical language, how it works to drive e-invoicing in Malaysia.

Introduction to e-Invoicing API

The e-Invoice mandate is part of Malaysia’s initiative to streamline the invoicing process. The aim is to make it easier for businesses to manage and submit invoices electronically. 

The Inland Revenue Board of Malaysia (LHDN) runs the MyInvois platform. Which is the primary platform to facilitate e-Invoicing across the country. There are two ways for businesses to submit e-Invoices through the MyInvois platform:

  1. Enter invoice data into the MyInvois platform and create an invoice one by one.
  2. Create e-Invoices automatically through the e-Invoice API. The API facilitates the integration between business systems and the MyInvois platform.

Implementing the API offers several key benefits for businesses:

  • Efficiency. By automating the invoicing process, businesses can speed up processing times. This ensures that invoices are managed without the need for manual data entry. This frees up valuable time for staff to focus on more strategic tasks.
  • Compliance. The API helps businesses adhere to the latest regulatory requirements. It ensures that invoices are in the correct format with the necessary information. Resulting in businesses being able to avoid potential fines/penalties associated with non-compliance.
  • Transparency. The API provides clear, real-time visibility into the status of invoices and notifications. This allows businesses to track the progress of each invoice and address any issues. With this data, teams can better manage cash flow and maintain financial records.

How the e-Invoice API Works

The e-Invoice API is designed to connect your finance system with the MyInvois system. This enables businesses to automate the submission and management of invoices. Here is an overview of how the API works:

Authentication

The first step in using the e-Invoice API is authenticating your ERP system. This ensures secure communication with the MyInvois platform. There are two main methods for authentication as a Taxpayer or as an Intermediary. Taxpayer login is used by businesses submitting their own invoices. Taxpayer authentication involves a request to MyInvois with a client ID and secret. Upon successful validation, the system generates an access token that is saved securely.

Intermediary login is used by service providers submitting invoices on behalf of clients. A similar authentication process is used where an access token is assigned to a client. This is then used by the service providers to access the MyInvois platform.

Security Features:

The API prioritises data security with robust features:

  • Encryption. It utilises industry-standard encryption protocols to safeguard sensitive financial data during transmission. This protects information like invoice details and tax identification numbers.
  • Access Control. Granular access controls ensure only authorised users can access and manage e-invoices. This minimises the risk of unauthorised access and data breaches.
  • Regular Audits. The system undergoes regular audits to maintain integrity and security of the API infrastructure. This proactive approach helps identify and address any potential vulnerabilities.

Document Management

Once authenticated, the API facilitates various document management functions:

  • Retrieve Document Types. To fetch all available document types or details of a specific document type.
  • Submit and Manage Invoices. To submit invoices, check their status, and manage any necessary updates or cancellations. Key Invoice Statuses are:
    • Submitted. Invoice has been received by the MyInvois system.
    • Valid. Invoice has been validated successfully.
    • Invalid. Invoice contains errors that need to be corrected.
    • Cancelled. Invoice has been cancelled and will not be processed.

Notifications

To retrieve notifications about various actions and updates related to invoice processing. This includes alerts for errors, status changes, and other important events. The notifications are used to take actions, ensuring timely resolution of any issues.

Error Handling

While the API is designed to be user-friendly and robust, errors can occur. Typical errors include invalid access tokens, incorrectly formatted documents and missing mandatory fields. The API provides detailed error messages that pinpoint the issue within your submission. Additionally, comprehensive documentation is available to guide you through troubleshooting any errors effectively.

e-Invoice API Components

The table below outlines the key elements of the API. Detailing purposes, mandatory information required, and key features for each endpoint.

ComponentPurposeKey EndpointsMandatory InformationFeatures
Authentication EndpointsGenerating access tokens for secure communicationLogin as Taxpayer System
Login as Intermediary System
Client ID and Client Secret 
Tax Identification Number (TIN)
Business Registration Number
System Details
Ensures secure and authenticated communication
Provides flexibility for different business models
Document Type EndpointsRetrieving information about invoice typesGet All Document Types
Get Document Type
Get Document Type Version
Access Token
Document Type ID
Provides comprehensive data on document structures
Ensures use of up-to-date document formats
Invoice Submission EndpointsSubmitting invoices and checking their statusSubmit Document
Get Submission Status
Cancel Document
Reject Document
Access Token 
Invoice Data
Document ID
Allows real-time tracking of invoice status
Provides flexibility to manage and correct invoicing processes
Notification EndpointsRetrieving updates and alerts related to invoice processingGet NotificationsAccess TokenEnables proactive management through timely updates
Enhances communication with the MyInvois System

Setting Up the API

To set up the e-Invoice API, businesses need to follow these steps:

  1. Get API Credentials. Businesses must request a client ID and client secret from LHDN. You will need to provide some information about your business to get this. This includes things like tax identification number, business registration number and contact details.
  2. API Environment Configuration. Configure the API endpoints for either the production or sandbox environment. This includes setting up URLs for the different environments. This includes the registration portal, invoicing portal, system API and identity service.
  3. Integration with ERP System. Use the API documentation from LHDN to integrate with your existing system. This is a technically complex activity, involving implementing different processes for the API. This includes authentication, setting up document type retrieval and configuring invoice submission. Additionally this should include status checking functionalities.

Businesses have two options in setting up the API. They can build it themselves or partner with an e-invoicing partner to manage it for them. We have a range of e-invoicing solutions to get your business connected to e-invoicing.

The e-Invoice API is designed to automate the invoicing process. Ultimately, making it easier for businesses to follow regulatory requirements at high volume. There is a range of more technical documentation available. Please refer to the MyInvois SDK documentation​, Latest Release Notes and API Documentation.

Contact us today for a confidential discussion about your e-invoicing needs. We can help you develop an e-Invoicing implementation plan tailored to your business. Our experts can help you navigate the e-Invoicing process ensuring a smooth transition.

Banner Ornamnet Desktop.svg

Book In a Consultation with Our Experts

Speak To An Expert