The initial phase of e-Invoicing implementation in Malaysia is aimed at large enterprises with turnovers exceeding RM 100 million. These companies heavily rely on ERP systems and consistently require e-invoice generation. Consequently, the most feasible approach for them is the API-based e-invoicing model, necessitating deep integration between their business systems and the MyInvois system.
To aid in this transition, LHDN recently released the beta version of the Software Development Kit (SDK) complete with APIs and documentation, serving as a roadmap for seamless integration. The "Login as Taxpayer System" API is at the core of this integration, a critical component that streamlines authentication and access to protected APIs within the MyInvois ecosystem.
The Taxpayer System Login API is a crucial gateway for authenticating Enterprise Resource Planning (ERP) systems associated with specific taxpayers. This API plays a pivotal role in issuing access tokens, granting ERP systems the privilege to access protected APIs within the MyInvois system.
The Taxpayer System Login API is the first line of definition, ensuring the legitimacy of ERP systems accessing protected APIs. Without a robust authentication mechanism in place, the integrity and confidentiality of e-invoicing transactions would be compromised, leading to financial and reputational risks.
The login API for the Taxpayer System operates based on OAuth 2.0 client credentials flow, designed to authenticate ERP systems associated with specific taxpayers and issue access tokens.
Here's a short guide on how it works:
Here are the API parameters for defining the data needed for requested actions or data retrieval and responses provide clients with the outcome of the API call.
This is the data or information that a ERP systems sends to the MyInvois system when making a request. Inputs are categorized into two main parts:
Header Parameter: It contains metadata about the request or the client making the request.
Header parameter | Description | Type |
client_id | Identifier for the ERP system. | String |
client_secret | Secret key for the ERP system. | String |
Body Parameter: This contains the actual payload or content of the request.
Body Parameter | Description | Type | Value example |
grant_type | Should be ‘client_credentials’. | String | client_credentials |
scope | Optional, defines access scope. | String | InvoicingAPI |
This can be omitted for external access to e-Invoice APIs. |
Successful Response: This describes the response received from MyInvois system upon successful completion of the API request.
Output parameter | Description | Type | Value example |
access_token | Encoded token structure with token fields and protection attributes. | JWT token | Encoded token value |
token_type | Bearer authentication tokens are returned. | String | Bearer |
expires_in | Lifetime of access token in seconds. | Number | 3600 (valid for one hour) |
scope | Optional, specifies granted API access based on requested scope. | String | InvoicingAPI |
Error Responses: Provides the possible error responses and their descriptions in case of a bad request.
Output parameter | Description | Type | Value example |
error | Possible values: invalid_request, invalid_client, invalid_grant, unauthorized_client, unsupported_grant_type, invalid_scope | String | invalid_request |
error_description | Optional error message with additional details. | String | User blocked |
error_uri | Optional URI with more error information (not used in MyInvois System). | URI |
The integration strategy between ERP systems and the Login as Taxpayer System API adheres to contemporary principles, including:
The Taxpayer System login API ensures secure authentication for ERP systems accessing MyInvois system to automate the e-invoice generation process. It issues access tokens for authorized systems, enhancing security and promoting compliance. With error handling capabilities and considerations for token validity, it facilitates a seamless authentication process, contributing to data integrity and trust in digital invoicing.
ClearTax is Malaysia's premier e-invoicing solution provider, offering seamless integration of any ERP or business system with the MyInvois platform. Contact our e-invoicing consultants for smooth integration and e-invoicing compliance assurance.
Also Read
Login as Intermediary System API: Authentication and Access for Intermediaries