The MyInvois API model mandates that all invoices and associated documents for e-invoicing be submitted to the portal in a specified manner and format, with comprehensive details included. Furthermore, every document submitted undergoes thorough validation on multiple points.
To ensure compliance and accuracy, LHDN has outlined seven key types of validation rules for documents submitted to the MyInvois Portal in the Software Development Kit (Version1.0).
Document validation rules are a set of criteria and checks applied to each submitted document to the MyInvois Portal . They ensure that documents adhere to required standards and regulations by verifying their structure, content, and compliance. These rules encompass various validators, including structure, core fields, signature, etc each performing specific checks to uphold data accuracy and system integrity.
The “Submit Documents” API serves as the primary interface for submitting one or more documents of various types to the system through API integration. These documents are grouped into a submission, with each document required to adhere to the data structure of its respective document type.
The API supports documents submitted in JSON and XML formats, with the responsibility of transforming data into the expected format lying with the taxpayer's ERP system or integration module.
Upon calling the API, validations around the structure of the documents are performed. i The structure validator checks for the adherence to the pre-defined document format and its corresponding schema. The document needs to pass this validation to receive a submission ID.
The caller receives a submission ID along with a list of accepted document IDs for further processing. These IDs can be used to retrieve documents, submission information, and full validation results and, if necessary, to cancel the document.
These rules are a set of criteria and checks applied to each document submitted to the system, verifying its structure, content, and compliance. Let's delve into the core components of document validation rules:
The structure validator verifies that the submitted document's structure aligns with the predefined format mandated by the document type version.
It supports validation for both XML and JSON-based documents, ensuring conformity to specified standards, such as UBL 2.1 for invoice documents. LDHN has released the UBL Mapping schema for all the document types. https://sdk.myinvois.hasil.gov.my/types/
The code validator ensures that the document contains essential fields, which are fundamental for the system's processing. It acts as a baseline check to guarantee that all required information is provided.
There are 55 fields in total, some optional and some mandatory only if applicable. Check the e-invoicing guidelines released by LHDN.
Responsible for authenticating the submitted document's signature, the signature validator ensures the integrity and authenticity of the document.
It mandates the use of valid digital certificates issued by recognized Certificate Authorities in Malaysia aligning with UBL 2.1 standards for XML and JSON formats.
Validating the taxpayers referenced within the document, this validator confirms their legitimacy at the document's issuance date. It verifies the details of taxpayers against TIN number and registered business name.
Additionally, it conducts checks on the issuer, including asynchronous processes that cannot be executed synchronously in the core fields validator.
Specifically applicable to credit notes, debit notes, and refund notes, this validator ensures that documents referenced within these submissions are valid e-invoices at the time of issuance. It maintains data integrity by verifying the authenticity of referenced documents.
With the task of validating various codes utilized within submitted documents, such as currency codes and tax types, the code validator ensures that these codes reference valid codes as defined in the SDK. By cross-referencing against predefined code tables, it confirms the accuracy of code usage. The code could be anything from currency, country, MICR, and so on.
Identifying potential duplicates, this validator searches for documents submitted recently (within a timespan of 10 mins) that bear similarity to the document being processed. Its aim is to prevent inadvertent or unintentional submission of duplicate documents, thereby maintaining system efficiency and integrity.
Document Validation Rules outlined in the SDK for e-invoicing Malaysia play a crucial role in ensuring the accuracy, integrity, and compliance of documents submitted through the MyInvois Portal.
These rules ensure that all prerequisite criteria are verified prior to submission, minimizing the likelihood of rejection upon submission. Additionally, validators prevent incomplete or incompatible documents from consuming MyInvois System processing resources by rejecting them in advance. This process also offers a quicker turnaround time for taxpayers generating invoices to rectify any issues promptly.