The initial phase of e-invoicing implementation in Malaysia targets large businesses with turnovers exceeding RM 100 million. Given large businesses’ consistent need for generating e-invoices, integrating APIs with the MyInvois system can be the most practical solution for their e-invoicing needs.
To facilitate this integration, LHDN has introduced SDK (Software Development Kit), which contains details related to the document types, statuses, codes, validation rules, and thorough documentation for 9 e-invoicing & 6 Platform APIs. which are crucial for API integration.
Despite the availability of the SDK and its documentation, thorough API testing is crucial. Testing ensures that APIs operate as intended, accurately manage data transactions, and adhere to regulatory requirements.
Recognizing the importance of API testing, IRBM has outlined specific steps for testing these APIs using Postman. This blog will offer a step-by-step guide to testing e-Invoicing APIs via Postman.
Postman is a widely used API platform that offers a comprehensive suite of tools that helps in building, testing, documenting, and collaborating on APIs. From design to testing, documentation, and even mocking, Postman streamlines the API development process, enabling teams to create better APIs faster.
Postman can play a crucial role in testing the APIs built by LHDN for e-invoicing integration with enterprise source systems. It can offer a comprehensive set of features for testing and debugging the functionality of these APIs, allowing developers to identify and resolve discrepancies before the official rollout of e-Invoicing.
By utilizing Postman, developers can simulate e-invoicing API calls in sandbox and production environments, ensuring a smoother integration process and compliance with e-invoicing regulations.
e-invoicing APIs facilitate the transmission of invoice data, status updates, and other essential functionalities between the enterprise source systems and the government's e-invoicing platform. Any discrepancies or errors in the e-invoicing API functionality can lead to disruptions in the invoicing process, non-compliance and even penalty for non-compliance.
Testing the e-invoicing APIs through Postman enables developers to verify data exchange with ERP and MyInvois systems by simulating real-world scenarios and executing API requests. Postman's tools allow thorough e-invoicing API functionality, parameters, and authentication testing, ensuring expected behaviour under diverse conditions. Validating integrations against standards mitigates non-compliance risks, ensuring adherence to regulatory guidelines.
Testing e-Invoicing APIs through Postman involves utilizing a set of predefined requests and environments to simulate interactions with the actual API endpoints. Here's how the process works:
1. Postman Collection:
LHDN has provided "e-Invoice SDK.postman_collection.json" (right-click and save as JSON file), which serves as a collection of API requests specifically tailored for e-invoicing functionalities. This collection encapsulates various API endpoints and their corresponding parameters, headers, and payloads.
2. Environment Files:
For testing in different environments, such as sandbox or production, "PROD Env.postman_environment.json". and "Sandbox Env.postman_environment.json". are provided. These contain environment-specific variables like base URLs, authentication tokens, and other configurations necessary for API testing.
3. Mimicking Real-World Scenarios:
Developers can import the Postman collection and environment files into their Postman workspace to mimic real scenarios.
4. Verifying API Calls:
Developers can execute individual API requests or run entire collections, observing the responses from the e-Invoicing system. They can verify the correctness of API calls, assess response statuses, inspect response payloads, and debug any issues encountered during testing.
For users leveraging Postman to conduct quick tests and understand how APIs should be invoked, both on the identity service and actual document exchange, utilizing the Postman collection "e-Invoice SDK.postman_collection.json" simplifies the process.
Follow the steps below to set up Postman correctly for your environment.
Environment Setup
Handling SSL Error
If you encounter an SSL error message such as "SSL Error: Self-signed certificate in certificate chain" in Postman, follow these steps:
The availability of the SDK and its documentation provides a solid foundation, yet thorough testing of e-invoicing remains paramount to guarantee the accuracy, compliance, and reliability of e-invoice generation.
By leveraging Postman's capabilities to simulate real-world scenarios and validate API functionality, developers can mitigate risks, ensure compliance with regulatory guidelines, and optimize performance.
Integrating with the MyInvois system is a complex, resource-intensive, and time-consuming endeavour. However, ClearTax, as one of Malaysia's top e-invoicing solution providers, offers a streamlined alternative.
With ClearTax's robust integration services, businesses can efficiently connect their systems with the e-invoicing portal. ClearTax's dedicated support ensures smooth implementation, thorough testing, and iterative improvements, resulting in seamless e-invoice generation.