MyInvois API integration · Malaysia

MyInvois LHDN API Integration Guide

This guide explains how to integrate the LHDN MyInvois API with ERP, POS, accounting and business software in Malaysia. Learn how to register an ERP in MyInvois, obtain your LHDN Client ID and Client Secrets, configure MySyncTax, and connect your application using PHP, Laravel, C# or VB.NET.

What this page covers: MyTax and MyInvois preparation, intermediary checks, ERP registration, LHDN Client ID and client secrets, MySyncTax developer credentials, and the next step for application-level API integration.

This page is the general setup and integration guide. Use the language-specific documentation when you are ready to implement API requests in your application.

7 setup steps MyInvois + MySyncTax PHP / Laravel / C# / VB.NET Malaysia e-Invoice integration
Written by: MySyncTax Technical Team Reviewed by: MySyncTax Integration Team Last updated: Based on official LHDN MyInvois API documentation and current integration practices.
Integration overview

How MyInvois LHDN API Integration Works

MyInvois provides APIs that taxpayer ERP systems can use to integrate with Malaysia's e-Invoice platform. At a high level, the integration starts with taxpayer and ERP setup, continues with authentication, and then moves into invoice submission and response handling.

01

Prepare the taxpayer account

Select the correct business in MyTax and confirm that the taxpayer profile, intermediary arrangement and MyInvois access are ready for the integration.

02

Register the ERP

Register an ERP system in MyInvois to obtain the Client ID and client secrets used for the LHDN-side system identity.

03

Configure MySyncTax

Add the business to MySyncTax, enter the LHDN client keys and retrieve the MySyncTax API Key and API Secret for your application integration.

04

Authenticate

The official MyInvois API uses an OAuth 2.0 client-credentials flow for system authentication. The resulting access token is used for protected MyInvois API operations.

05

Submit e-Invoice documents

Applications can submit supported documents through the MyInvois e-Invoice API after preparing data in the required document structure and format.

06

Handle the response

Your application should store relevant submission references, check processing results, handle validation outcomes and follow the official integration practices for retries and rate limits.

LHDN / MyInvois credentials

Client ID, Client Secret 1 and Client Secret 2 come from ERP registration in MyInvois. These identify the ERP on the LHDN side.

MySyncTax credentials

API Key and API Secret are generated in the MySyncTax Developer Portal for your MySyncTax integration. Do not confuse them with the LHDN client keys.

YouTube link coming soon

MyInvois Setup Video Walkthrough

The video walkthrough follows the same setup sequence as the written guide below, from MyTax selection through MySyncTax API credentials.

Video coming soon

Follow the MyInvois LHDN API setup process: select a business, check the intermediary, register an ERP, save the LHDN client keys and locate the MySyncTax developer credentials.

Video length: 2 minutes 48 seconds. The written walkthrough below follows the same order.

Before You Start the MyInvois API Integration

Have the required portal access, taxpayer information and account details ready before you begin.

Portal access

You will need your MyTax login and a MySyncTax Developer Portal account. Confirm that you can also access the correct business in MyInvois.

Business information

Keep your registered business name, TIN, identification details, contact information and business address available. You will also need the intermediary details provided for your MySyncTax setup.

The recorded walkthrough uses the MyInvois pre-production environment. Always confirm that you are working in the intended environment for your integration.

The screenshots below show the setup screens with sensitive details obscured. Select any screenshot to view it at full size.

Sign In to MyTax and Select Your Business

MyTax · Recording ~00:00–00:30

  1. Go to the official MyTax portal. Select your identification type, enter your identification number and follow the prompts to sign in.
  2. On the dashboard, open the dropdown showing Individu. Expand Pemilik Perniagaan (business owner), then choose the business you want to integrate.
  3. After selecting the business, open MyInvois from the available menu.
MyTax dashboard with the Individu role selector and MyInvois menu; the taxpayer's name, TIN and tax details are obscured.
1a. Open the role selector under Pilihan Peranan on the MyTax dashboard. Personal and tax details are obscured.
Pilihan Peranan dialog showing Individu and the expandable Pemilik Perniagaan business-owner option.
1b. Expand Pemilik Perniagaan, then select the business you want to use.
MyInvois portal home with the profile menu at the top right; the taxpayer's account name is obscured.
1c. After opening MyInvois, use the profile menu at the top right to access the taxpayer profile. The account name is obscured.

Check the MyInvois Intermediary Details

MyInvois · Recording ~00:31–01:01

  1. In MyInvois, click the profile icon at the top right and select View Taxpayer Profile.
  2. Stay on the Profile tab, scroll to Representatives, and select Intermediaries.
  3. Look for the intermediary using the details provided for your MySyncTax setup. If it is already listed, continue to the next step. Otherwise, click Add Intermediary.
  4. Enter the TIN, BRN and Taxpayer Name provided for the intermediary. Complete the CAPTCHA, then use the search button.
Representatives section with the Intermediaries tab selected and Add Intermediary action; existing intermediary details obscured.
2a. Check the Intermediaries tab under Representatives for an existing appointment.
Add Intermediary dialog with empty TIN, BRN and Taxpayer Name fields, an obscured CAPTCHA and a search button.
2b. Enter the intermediary details supplied for your setup and search before completing the appointment. The CAPTCHA is obscured.
Adding an intermediary for the first time? The recording only shows where the intermediary details are entered because an active intermediary is already present. Complete the appointment process shown by MyInvois after the intermediary is found.

Add Your Business to MySyncTax

MySyncTax Developer Portal · Recording ~01:02–01:42

  1. Open the MySyncTax Developer Portal. On the dashboard, click + Add Account above the Manage LHDN Accounts table.
  2. Choose Business on the Add New Account page to open the LHDN Account Information section.
  3. Complete the taxpayer and business information required by the form.
Manage LHDN Accounts table with Add Account, Edit and Pay buttons; taxpayer names and account identifiers are obscured.
3a. Click + Add Account above the Manage LHDN Accounts table.
Business account type selected above empty LHDN account fields for registration, identification, contact and address details.
3b. Select Business and complete the LHDN Account Information fields for your taxpayer.
Business details used in the walkthrough
Details Fields to complete
Taxpayer Registration Name and TIN No.
Identification Identification Type and Identification Number. The recording uses BRN.
Contact Phone and Email
Address City, Postal Zone, State Code, Address Line 1 and Address Line 2. Address Line 3 is optional in the form shown.

Keep this form open. Before saving the MySyncTax account, obtain the LHDN Client Keys from the MyInvois ERP registration.

Register an ERP System in MyInvois

MyInvois · Recording ~01:43–02:07

  1. Return to the MyInvois Taxpayer Profile and scroll to Representatives.
  2. Select the ERP tab and click Register ERP to open Add ERP System.
  3. Give the ERP system a clear name and choose the required value under Client Secret expiration. The screenshot below shows 1 Year; the recording uses 2 Year. Choose the value appropriate to your setup. Primary ERP System is left unchecked in the example.
  4. Click Register. MyInvois displays the new Client ID, Client Secret 1 and Client Secret 2.
  5. Copy and securely store the secrets before closing the window.
Add ERP System dialog with ERP Name, Client Secret expiration set to 1 Year, an unchecked Primary ERP System option and Register button.
4a. Name the ERP system, choose the secret expiration period and click Register.
MyInvois Client ID, Client Secret 1 and Client Secret 2 fields with values obscured, copy buttons and a confirmation checkbox.
4b. Securely copy the Client ID and both client secrets. The credential values are obscured in this screenshot.
Why this matters for API integration: the ERP Client ID and client secret are used by the official MyInvois system-authentication flow. Keep the credentials private and never place production secrets in public source code or screenshots.

Enter the LHDN Client Keys in MySyncTax

MyInvois & MySyncTax · Recording ~02:08–02:21

  1. Copy the Client ID from MyInvois, return to the Add New Account form in MySyncTax and paste it into Client ID under LHDN Client Keys.
  2. Repeat the process for Client Secret 1 and Client Secret 2, using the matching fields.
  3. After securely saving the secrets, return to MyInvois, confirm that you have copied and saved the Client Secrets, then complete the ERP-registration dialog.
MySyncTax LHDN Client Keys section with empty Client ID, Client Secret 1 and Client Secret 2 fields.
5. Paste the three values from MyInvois into the matching LHDN Client Keys fields in MySyncTax.
Which API keys go where? The Client ID and client secrets created in MyInvois belong in the LHDN Client Keys section. MySyncTax generates a separate API Key and API Secret for your MySyncTax application integration.

Save and Check the MySyncTax LHDN Account

MySyncTax Developer Portal · Recording ~02:22–02:29

  1. Review the business details and the three LHDN client-key fields, then click Save.
  2. When the success confirmation appears, click OK.
  3. The new business account should now appear under Manage LHDN Accounts on the dashboard.
Example Manage LHDN Accounts dashboard showing the account table and an Edit button for each row; taxpayer names and account identifiers are obscured.
6. Return to this account list after saving, find your business and use its Edit button to continue.

Creating the account does not necessarily mean the complete e-Invoice integration is ready for production. Continue with the developer integration guide and complete the required activation, testing and application-level implementation for your setup.

Find Your MySyncTax API Credentials

MySyncTax Developer Portal · Recording ~02:30–02:42

  1. Find the new account under Manage LHDN Accounts and click Edit.
  2. Scroll to MySyncTax Developer Credentials.
  3. Locate the MySyncTax API Key and MySyncTax API Secret. Use these values when following the appropriate MySyncTax application-integration documentation.
MySyncTax Developer Credentials section showing API Key and API Secret fields with credential values obscured and copy buttons.
7. Copy your MySyncTax API Key and API Secret into secure server-side configuration for your application. The credential values in this screenshot are obscured.
Keep all credentials private. Store API keys and secrets in secure server-side configuration or environment variables. Do not commit credentials to a public repository, expose them in frontend JavaScript or include real production values in tutorials.
After account setup

Next Step: Integrate Your Application with MyInvois

Once the taxpayer account, ERP registration and MySyncTax credentials are ready, move to the implementation guide for your application's technology stack. This keeps the general MyInvois LHDN API Integration Guide focused on setup while the developer pages cover framework-specific code and request handling.

Primary technical reference

Official LHDN MyInvois API Documentation

MySyncTax documentation should be used together with the latest official LHDN MyInvois SDK. The official SDK defines the API endpoints, document structures, authentication behaviour, supported e-Invoice operations and integration practices used by taxpayer ERP systems.

API Authentication

For direct LHDN integration, Login as Taxpayer System exchanges the ERP Client ID and a client secret for an OAuth 2.0 access token. For the MySyncTax examples, send your MySyncTax API Key and API Secret in the server-side JSON request as mysynctax_key and mysynctax_secret.

Submit an e-Invoice through API

With MySyncTax, choose the normal receipt QR flow or the ERP invoice flow with customer data described in the MySyncTax API documentation. The language guides show how to send JSON and store the response.

For direct LHDN integration, Submit Documents uses POST /api/v1.0/documentsubmissions/. A 202 response reports initial acceptance; check subsequent validation results before marking an invoice valid.

Integration practices: LHDN publishes current guidance for token reuse, polling, API limits and response handling. Check these references whenever you build or maintain an integration.

Delete Invoice

Use this API to request deletion of an invoice from MySyncTax by its unique ID. The API validates your integration credentials and checks the invoice submission status before processing the request.

Endpoint

POST https://mysynctax.com/v5/api/myinvois/delete/{mysynctax_uniqueId}

Request parameters

  • mysynctax_unique_id (string): unique invoice identifier passed in the URL.
  • mysynctax_key (string): integration API key assigned to your company.
  • mysynctax_secret (string): integration API secret assigned to your company.

Request example

Send both integration credentials in the JSON request body.

{
  "mysynctax_key": "YOUR_MYSYNCTAX_KEY",
  "mysynctax_secret": "YOUR_MYSYNCTAX_SECRET"
}

cURL example

Use the same HTTP request from any server-side language. Store credentials securely and use the correct base URL for your environment.

curl --request POST "https://mysynctax.com/v5/api/myinvois/delete/{mysynctax_uniqueId}" \
  --header "Content-Type: application/json" \
  --data '{
    "mysynctax_key": "YOUR_MYSYNCTAX_KEY",
    "mysynctax_secret": "YOUR_MYSYNCTAX_SECRET"
  }'

Response example

This response indicates that deletion was rejected because the invoice has already been submitted to LHDN.

{
  "success": false,
  "message": "Invoice cannot be deleted because it has already been submitted.",
  "unique_id": "50dc9929XXXXXXXXXXXXXXXXXXXXXXXXXX",
  "invoice_no": "MZXXX-XXXXXXXX",
  "submission_status": "Submitted"
}

The response includes success (boolean), message, unique_id, invoice_no and submission_status.

Important: Use POST, pass the invoice unique ID in the URL, and include both credentials in the JSON body. An invoice already submitted to LHDN cannot be deleted through this API. The supplied URL contains /dev/; confirm that this is the correct base path for your environment.

Common questions

MyInvois LHDN API Integration FAQ

These answers clarify the difference between setup credentials, MySyncTax credentials and the application-integration stage.

What is MyInvois LHDN API integration?

MyInvois LHDN API integration connects an ERP, POS, accounting platform or business application with Malaysia's MyInvois system so software can perform supported e-Invoice operations through an API-based workflow instead of relying only on manual portal activity.

What credentials are needed for MyInvois API integration?

ERP registration in MyInvois provides the LHDN Client ID and client secrets. In the MySyncTax workflow shown on this page, MySyncTax separately generates an API Key and API Secret for your application integration. Keep both credential sets separate and secure.

Is the LHDN Client ID the same as the MySyncTax API Key?

No. The LHDN Client ID and client secrets belong to the MyInvois ERP registration. The MySyncTax API Key and API Secret are separate developer credentials generated for the MySyncTax application integration.

How do I get a MyInvois Client ID?

Sign in to MyInvois, open the taxpayer profile, go to the ERP section and register an ERP system. MyInvois then provides the Client ID and client secrets for that ERP registration. See Register an ERP System in MyInvois.

How do I register an ERP in MyInvois?

From the taxpayer profile in MyInvois, open Representatives, choose the ERP tab, select Register ERP, name the ERP, choose the client-secret expiration option and complete the registration. Securely save the Client ID and both client secrets.

What is a MyInvois Client Secret?

A MyInvois Client Secret is a private credential paired with the ERP Client ID for system authentication. Store it securely and never expose it in public source code, frontend JavaScript, screenshots or public repositories.

What is the difference between the MyInvois API and MySyncTax API?

The MyInvois API is LHDN's official e-Invoice API platform. MySyncTax provides its own integration layer and developer credentials for applications using the MySyncTax workflow described in this guide. The LHDN Client ID and secrets are therefore different from the MySyncTax API Key and API Secret.

How do I integrate MyInvois with PHP?

Complete the taxpayer and ERP setup first, then continue to the MyInvois API Integration PHP guide for server-side authentication, HTTP requests, request payloads, response handling and errors.

How do I integrate MyInvois with Laravel?

Complete the taxpayer and ERP setup first, then continue to the MyInvois API Integration Laravel guide for configuration, Laravel HTTP client requests, service logic, responses and error handling.

Can POS systems integrate with the MyInvois API?

Yes. A POS system can integrate when its backend can securely authenticate, prepare the required e-Invoice data and call the relevant integration APIs. Keep credentials on the server side rather than exposing them in the POS frontend.

Can accounting software integrate with MyInvois?

Yes. Accounting and ERP software can integrate with MyInvois when they implement the required authentication, document structures, submission flow and response handling.

How do I submit an e-Invoice through API?

Choose the MySyncTax endpoint for your invoice workflow, authenticate with your MySyncTax credentials, send the required JSON and save the response references. Direct LHDN integrations use the separate MyInvois Submit Documents API and its document format. See the official submission reference on this page.

What happens when an invoice submission is rejected?

Check the submission and document status, inspect the validation error details, correct the source data or document structure, and submit a corrected document according to the current MyInvois SDK guidance. Your application should retain useful references and log enough detail for troubleshooting without exposing sensitive credentials.

Can I integrate MyInvois using C# or VB.NET?

Yes. MyInvois integration uses HTTP APIs, so .NET applications can integrate using C# or VB.NET. Continue to the C# guide or VB.NET guide.

Should I test the integration before using production?

Yes. Validate authentication, document preparation, submission, status handling and error handling in the environment appropriate to your implementation before relying on the integration in production. Refer to the current official LHDN MyInvois SDK for the latest environment and API requirements.