MyInvois API
The MyInvois API is LHDN's official REST API allowing businesses and software developers to programmatically submit and manage e-invoices.
What is MyInvois API?
The MyInvois API is the programmatic interface provided by LHDN that allows businesses, software developers, and integration middleware to submit, query, and manage e-invoices without using the MyInvois web portal. Built as a REST API, it accepts JSON or XML payloads formatted according to the UBL 2.1 schema and returns standardised responses including validation results, UUIDs for successful submissions, and error codes for failed submissions.
The primary endpoints of the MyInvois API include: the document submission endpoint (for submitting individual or batch invoices, credit notes, and debit notes), the document status endpoint (for checking the validation status of a submitted document), the document retrieval endpoint (for fetching the full details of a validated invoice), the rejection endpoint (for buyers to reject invoices within the 72-hour window), and notification webhooks (which allow LHDN to push real-time status updates to registered systems). The API also includes endpoints for taxpayer lookup (to verify TINs) and invoice search.
Authentication to the MyInvois API uses OAuth 2.0 with client credentials. Businesses must register their system on the MyTax portal to obtain a Client ID and Client Secret. These credentials are exchanged for a bearer token with a limited lifespan (typically one hour), which is then included in the Authorization header of all API calls. Businesses using the API must implement proper token refresh logic in their integrations. The production API operates under a rate-limiting policy that restricts the number of requests per minute to prevent abuse.
Who uses the MyInvois API directly? Primarily, mid-to-large businesses with in-house IT teams or developers who have built custom accounting or ERP systems, software vendors building certified e-invoicing solutions, Peppol Access Point providers that need to route invoices through MyInvois for tax validation, and businesses with high invoice volumes that need automated submission without human intervention. Small businesses typically do not use the API directly; instead, they use certified accounting software that handles the API integration behind the scenes.
LHDN provides a sandbox (pre-production) environment for developers to test their integrations before going live. The sandbox uses separate credentials and simulates all MyInvois API behaviours including validation, UUID generation, and error responses. Developers should complete thorough testing in the sandbox environment — including edge cases like missing fields, invalid TINs, and duplicate invoice numbers — before switching to the production environment. LHDN also publishes an API documentation portal with endpoint references, request/response schemas, and sample code.
Related Terms
Frequently Asked Questions
Do I need to use the MyInvois API?↓
How do I get API credentials?↓
Is there an SDK?↓
Ready to implement e-invoicing?
Find certified MyInvois-compliant software or check your readiness with our free calculator.
EInvoicingMalaysia.com is an independent directory. We are not affiliated with LHDN or the Malaysian government. Glossary definitions are for informational purposes and do not constitute legal or tax advice. Always refer to the official LHDN e-Invoice Guidelines at hasil.gov.my for authoritative requirements.