Malaysia e-Invoicing API: Everything You Need to Know

Updated on: Dec 26th, 2024

|

14 min read

social iconssocial iconssocial iconssocial icons

Malaysia is implementing e-invoicing in phases, beginning with businesses with an annual turnover exceeding RM 100 million. This initiative mandates that all businesses generate e-invoices by submitting transaction details in a specified format to the Inland Revenue Board of Malaysia (IRBM) for real-time validation. 

To facilitate this, there are two primary models for generating e-invoices: using the MyInvois portal and through API integration. While the MyInvois portal is suitable for small businesses with a limited volume of transactions, API integration would be widely adopted by large enterprises due to its ability to handle a higher volume of transactions efficiently. 

API integration connects the enterprise source systems directly with MyInvois for document submission, validation, retrieval, status tracking, and much more. This blog will discuss API integration, API’s role in e-invoicing, Software Development Kit (SDK), and the various types of e-invoicing APIs available. 

What is an API?

An API, or Application Programming Interface, is a tool that lets different software applications communicate with each other. For example, when you use a weather app on your phone, it uses an API to get weather data from a weather service. APIs work by sending requests and receiving responses, allowing one application to use the functions or data of another.

API and E-invoicing in Malaysia

Before understanding the need and use of API for e-invoicing in Malaysia, have a quick look at how the e-invoicing process works in Malaysia.

Here's a brief overview:

  1. Preparation: Taxpayers configure their systems to generate e-invoices in XML or JSON format, adhering to the defined data structure with all -required fields.
  2. Submission: Once a transaction is concluded, the supplier creates a digital invoice payload and submits it to the Inland Revenue Board of Malaysia (IRBM) for validation in real-time.
  3. Validation: The MyInvois System validates the document in near real-time. If errors are detected, the error response is provided. Upon successful validation, a notification is sent to both the supplier and the buyer on their registered email addresses on MyInvois portal.
  4. Sharing: The supplier is obliged to share the validated e-invoice with the buyer. The shared e-invoice must contain an embedded QR code.
  5. Rejection and Cancellation: If errors are detected, buyers can raise a rejection request for the e-invoice within 72 hours of validation. Likewise, suppliers can cancel an e-invoice within the same timeframe. 
  6. Storage of E-Invoice: After validation, all e-invoices are stored in IRBM's database for record-keeping.

API integration plays a crucial role in streamlining the e-invoicing process. By enabling direct communication between taxpayers' systems and the government's e-invoicing platform, API eliminates the need for manual data entry and facilitates real-time communication and seamless data exchange.

The Software Development Kit (SDK) released by IRBM includes a total of 15 APIs, categorized into platform and e-invoicing APIs. These APIs are designed to facilitate various functionalities crucial for e-invoicing processes, including submission, validation, retrieval of e-invoices, notification, and more.

Types of E-invoicing APIs

The SDK includes extensive documentation detailing the application programming interfaces (APIs) provided by LHDN for e-invoicing. Currently, there are 15 APIs divided into two categories: e-invoice API and Platform API.

E-Invoicing API

This set of APIs is specifically designed to support core e-invoicing workflows. These APIs facilitate crucial processes such as document submission, validation, retrieval, and status tracking, ensuring seamless integration with the e-invoicing system. There are nine core e-invoicing APIs:

  1. Validated Taxpayer's TIN API: This API verifies tax identification numbers (TINs) by comparing them against stored ID information. It accepts input parameters such as TIN number, ID type (e.g., passport), and ID value, and indicates whether the TIN is valid or not found.
  2. Submit Documents API: The Submit Documents API is the primary tool for sending and creating e-invoices. It allows bundling multiple documents into a single submission, each assigned a unique submission ID. LHDN conducts minimal structure validations on the submitted payload and returns a list of accepted documents with unique identifiers. Rejected documents are listed separately, accompanied by corresponding error codes in case of validation failure.
  3. Cancellation API: This API facilitates cancellation within 72 hours of document validation. To process the request effectively, a UUID* and a reason for cancellation must be submitted.

*UUID: It is a reference number assigned by IRBM, representing a unique identification of the e-Invoice.

  1. Rejection API: The Rejection API permits rejection within a 72-hour window after document validation. Only one rejection request per document is allowed, necessitating a UUID and a reason for rejection.
  2. Get Recent Documents API: This API retrieves documents issued or received within the past 30 days. It allows optional filtering based on date and document type, returning a maximum of 10,000 documents with high-level details.
  3. Get Submission API: This API returns information on documents submitted during a single submission. It requires a unique submission identifier and provides document and processing status details.
  4. Get Document API: Retrieving full document details using its unique identifier, this API returns the original submission, additional IDs, and status. Documents with invalid statuses are excluded, and only documents the receiver can retrieve are included in invalid or cancelled statuses.
  5. Get Document Details API: This API retrieves detailed information about a document, including validation results. It allows access to documents in an invalid state, requiring a UUID (unique identifier) as input and providing a high-level document summary with validation results as output.
  6. Search Documents API: This application program interface offers enhanced filters for precise queries, providing access to a large data set. Input parameters include UUID and optional filters, with output comprising a high-level summary of each retrieved document.

Platform APIs

In addition to e-invoicing APIs, the SDK also features six platform APIs that offer functionalities beyond the core invoicing workflows.  These platform APIs enable users to perform various tasks related to authentication, access control, and data retrieval, enhancing the overall user experience.

The platform APIs mentioned in the document include:

  • Login as Taxpayer System: This API verifies user systems' access to invoicing details by generating a token valid for one hour. This token ensures secure access to the invoicing system.
  • Login as Intermediary System API: This API allows intermediaries such as ClearTax to authenticate on behalf of users. It refreshes the token every 60 minutes, ensuring continuous security and access to invoicing functionalities.
  • Get All Document Types API: This API retrieves a comprehensive list of all supported document types, including their details. This information helps users understand the types of documents supported by the system and their associated identifiers.
  • Get Document Type API: Users can utilize this API to retrieve the schema and fields of a specific document type. It provides insight into the structure and required fields of each document type, facilitating accurate document generation and submission.
  • Get Document Type Version API: This API allows users to retrieve the JSON and XML structure of a given document version. It assists in understanding the format and specifications of different document versions, ensuring compatibility and compliance.
  • Get Notification API: This API allows users to retrieve their notification history from the Inland Revenue Board of Malaysia (IRBM). It provides insights into past notifications, their status, and relevant details.

Why use API for e-invoicing?

  1. Faster Integration, No Custom Coding: By utilizing APIs, businesses can seamlessly integrate e-invoicing functionalities into their systems without the need for custom coding. 
  2. Cross-System Compatibility: APIs released by LHDN are designed to work across different platforms, including various ERP, accounting, or billing software. 
  3. Real-time Efficiency: e-invoicing APIs enable near real-time transmission of invoices between suppliers and tax authorities. This leads to faster processing and validation, enhancing overall transaction efficiency.
  4. Expandable Features: The API model offers the flexibility to expand e-invoicing features without overhauling the entire system. Businesses can easily integrate new functionalities or services into their workflow, adapting to evolving e-invoicing needs.
  5. Scalable: The API-based e-invoicing model can handle transactions from multiple branches, stores, or billing terminals.

Conclusion

The first phase and second phases of e-invoicing implementation in Malaysia focus on large businesses with significant transaction volumes. For enterprises with continuous transaction needs, the API model emerges as the preferred choice. API integration offers a streamlined approach, enabling businesses to generate e-invoices seamlessly with a single click, eliminating the complexities associated with manual processes. 

ClearTax is a leading Peppol-compliant e-invoicing solution provider in Malaysia. With global expertise in e-invoicing technologies, ClearTax facilitates seamless integration between businesses' existing systems and the MyInvois platform. Acting as middleware, ClearTax simplifies the integration process, saving businesses valuable time and reducing development costs. 

Contact ClearTax today to explore how e-invoicing can benefit your business and to speak with an experienced e-invoicing consultant.

Index