Get 100% E-invoicing compliant with
Asia's largest e-invoicing provider
Get 100% E-invoicing compliant with Asia's largest e-invoicing provider
Seamless integration
with any ERP/ POS system
Seamless integration
with any ERP/ POS system
LHDN & MDEC Compliant
e-Invoicing solution
LHDN & MDEC Compliant
e-Invoicing solution
Auto upgrades for any
govt. changes
Auto upgrades for any
any govt. changes
Book a Demo

Software Development Kit (SDK) for Malaysia e-Invoicing: Everything You Should Know [Version 1.0]

Updated on: May 14th, 2024

|

18 min read

social iconssocial iconssocial iconssocial icons

e-Invoicing in Malaysia will be mandatory from 1st August 2024 onwards for all B2B, B2G, and B2C transactions. Implemented in phases, the rollout begins with larger enterprises with annual turnover exceeding RM 100 million in the previous financial year. 

For these Large entities, the transition to e-invoicing necessitates integration between their existing Enterprise Resource Planning (ERP) systems and the government's designated MyInvois System, a complex multi-level process.

Understanding the challenges involved in integrating systems, the Lembaga Hasil Dalam Negeri (LHDN) has introduced a Software Development Kit (SDK). This SDK serves as a crucial asset, providing enterprises with the essential tools, APIs, and frameworks needed to seamlessly integrate their systems with the required e-invoicing infrastructure.

The beta version of the SDK was initially launched on February 9, 2024, followed by the release of SDK Version 1.0 on April 6, 2024.

What is a Software Development Kit (SDK)?

In general terms, SDK (Software Development Kit) is a package of tools, libraries, and documentation developers provide to help others create applications for a specific platform or framework. It simplifies integrating complex functionalities into software, typically through APIs (Application Programming Interfaces).

Similarly, the Malaysian E-Invoicing SDK contains details related to the document types, statuses, codes, APIs, validation rules, etc, which are crucial for e-invoicing. This SDK would help developers to customise their business solutions to comply with Malaysian e-invoicing requirements, facilitating the generation, submission, and management of e-invoices.

Components of LHDN SDK (Version 1.0) for e-Invoicing

The SDK released by Lembaga Hasil Dalam Negeri (LHDN) for Malaysia's e-invoicing system comprises various components essential for developers to integrate with MyInvois system.

Below are the key components of the LHDN SDK for e-Invoicing:

  1. Release Notes
  2. API (Platform & e-Invoice)
  3. Document Types and Schemas.
  4. Code Tables
  5. Document Validations Rules
  6. Frequently Asked Questions (FAQ)
  7. LHDN Contact Information

Release Notes

The SDK comes with release notes documenting the changes and enhancements made in each version. These notes serve as a reference for developers, highlighting new features, bug fixes, and other modifications by LHDN.

Following the beta version's release, LHDN launched SDK Version 1.0 on April 6 2024, with additional updates published on April 19. For more details on these updates, you can refer to the SDK release notes.

API

The SDK includes comprehensive documentation detailing the application programming interfaces (APIs) provided by LHDN for e-invoicing. Currently, 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 API’s.

  1. Validated Taxpayer's TIN API:   This API validates tax identification numbers (TINs). It checks the TIN against stored ID information using input parameters such as TIN number, ID type (e.g., passport), and ID value. The output indicates whether the TIN is valid or not found.
  2. Submit Documents API: The Submit Documents API is the core tool for submitting and generating e-invoices. It allows grouping multiple documents into one submission, assigning a unique submission ID to each. Minimal structure validations are performed, and the API returns a list of accepted documents with unique identifiers. Rejected documents are listed separately, along with corresponding error codes if validation fails.
  3. Cancellation API: Cancellation API enables cancellation within a 72-hour of document validation. It requires the submission of a UUID and a reason for cancellation to process the request effectively.
  4. Rejection API: It allows rejection within a 72-hour window of document validation. Only one rejection request per document is permitted, requiring a UUID and a reason for rejection to be provided.
  5. Get Recent Documents API: The Get Recent Documents API retrieves documents issued or received within 30 days. It accepts input parameters for optional filtering based on date and document type, returning a maximum of 10,000 documents with high-level details.
  6. 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.
  7. Get Document API: It retrieves full details of a document using its unique identifier. It returns the original submission, additional IDs, and status. Documents with invalid status are not returned, and only documents the receiver can retrieve invalid or cancelled statuses.
  8. Get Document Details API: The Get Document Details API retrieves detailed information about a document, including validation results. It allows access to documents in an invalid state, with input requiring a UUID (unique identifier) and output providing a high-level document summary with validation results.
  9. 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.

  1. Login as Taxpayer System: This API authenticates user systems accessing invoicing details. It generates a token that remains valid for one hour, providing secure access to the invoicing system.
  2. Login as Intermediary System API: It enables intermediaries like ClearTax to authenticate on behalf of users. It refreshes the token every 60 minutes to ensure continuous security and access to invoicing functionalities.
  3. Get All Document Types API: The Get All Document Types API retrieves a comprehensive list of all supported document types along with their details. This information aids in understanding the types of documents supported by the system and their associated identifiers.
  4. Get Document Type API: It allows users to retrieve the schema and fields of a specific document type. This API provides insight into each document type's structure and required fields, facilitating accurate document generation and submission.
  5. Get Document Type Version API: With the Get Document Type Version API, users can retrieve a given document version's JSON and XML structure. This API assists in understanding the format and specifications of different document versions, ensuring compatibility and compliance.
  6. Get Notification API: The Get Notification API enables users to retrieve the notification history from IRBM (Inland Revenue Board of Malaysia). While optional, this API enhances the compliance experience by providing insights into past notifications, their status, and relevant details.

Code Type

The SDK includes predefined code tables that define standardized codes for various attributes used in e-invoicing, such as currency, country, invoice type, etc. These code tables ensure consistency and uniformity in data representation across different e-invoices.

Code Type

Description

Example

Classification codes

Categorizes products or services transacted in invoices.

003 - Computer, smartphone, or tablet

Country codes

Provides precise country information for supplier and buyer addresses.

IND - INDIA, IRL - IRELAND

Currency codes

Specifies currency information.

USD - US Dollar, SAR - Saudi Riyal

E-Invoice type codes

Differentiates between document types, which are mandatory in the invoice schema.

03: Debit note, 13: Self-built debit notes

MSIC codes

Five-digit numeric codes representing taxpayer business nature and activity are mandatory in the invoice.

07296 - Mining of silver, 79110 - Travel agency activities

Payment Mode Codes

Define how payments were made or funds transferred.

01: Cash, 07: Digital bank transfer

State Codes

Provide precise state information.

00: All states, 08: Perak

Tax Type Codes

Enter tax information.

01: Sales tax

Document Validation Rules

The SDK provides seven validation rules that govern the content and structure of e-invoices submitted to LHDN's system. These rules define criteria for validating core fields, document structure, digital signatures, etc. By enforcing these validation rules, developers can ensure the accuracy, integrity, and compliance of e-invoices, minimizing errors and rejections.

  1. Structure Validator: Checks document structure compliance like the format, hierarchy etc. Validator supports validating both XML and JSON-based documents.
  2. Core Fields Validator: Validates the presence of mandatory fields.
  3. Signature Validator: Verifies the validity of the submitted signature.
  4. Taxpayer Validator: Ensures validity of referenced taxpayers at the document's issuance date.
  5. Reference Document Validator: Validates the validity of referenced original documents.
  6. Code Validator: Checks the validity of various codes, such as currency or tax type codes.
  7. Duplicate Document Validator: Prevents multiple submissions of similar documents within a short time frame.

FAQs

SDK includes a section addressing common queries and concerns related to e-invoicing integration. This section would get updated over time, solving the most common queries related to SDK Malaysia e-invoicing.

Click here to read the FAQ’s related to SDK.

Contact Information

The SDK also provides contact details for different departments or support channels that users can contact for assistance with various aspects of e-Invoicing and SDK-related queries.

Topic

Email

SDK related questions

sdkmyinvois@hasil.gov.my

General e-Invoice information

myinvois@hasil.gov.my

Conclusion

SDK (Software Development Kit) will will play a crucial role in the pilot phase of Malaysia's e-invoicing implementation. While minor updates are expected, major changes are unlikely. It is anticipated that LHDN will soon release the final SDK along with updated guidelines.

Integrating a business system with MyInvois is complex and technically challenging for many companies. However, ClearTax, as a leading e-invoicing software provider, offers solutions to help large enterprises seamlessly integrate their systems with the e-invoicing system, ensuring maximum compliance.

For further assistance or to book a consultation call with our e-invoicing team, please contact us.

Index