Skip to contentSkip to content
A secure e-invoice moving through a pre-production sandbox workflow
How-to guides

How to Create an LHDN MyInvois Pre-Production Account

7 min read

Key takeaways

  • Pre-production is LHDN's testing environment. It keeps your integration work away from live production submissions.
  • You create the LHDN ERP connection from MyInvois under View Taxpayer Profile → Register ERP.
  • The values you need are the LHDN Client ID and Client Secret. They are different from production credentials and from MyInvois Bridge API credentials.
  • In MyInvois Bridge, save them under the company's MyInvois credentials and choose Sandbox (testing) before you run a test.

If you want to test LHDN e-Invoice integration without touching production, start with the MyInvois pre-production environment. The setup is straightforward once you know which portal to open, which taxpayer profile to select, and where the ERP credentials are generated.

The short answer

Open the MyTax testing environment, choose MyInvois → Preprod, switch to the correct taxpayer, then open View Taxpayer Profile and register an ERP system. LHDN generates a Client ID and Client Secret for that ERP connection. Add those LHDN credentials to MyInvois Bridge as Sandbox (testing) credentials, not production credentials.

What you need before you start

  • Access to the MyTax testing/pre-production environment.
  • The correct taxpayer or company profile that will issue the e-Invoices.
  • A user role that can view the taxpayer profile and register an ERP system.
  • A secure place to store the Client ID and Client Secret after they are generated.

Pre-production is not production

Use pre-production to learn, connect, validate, and test. It is not the place for live customer tax documents, and pre-production credentials will not authenticate against the production API.

Step 1: Open MyInvois Preprod

Sign in to the MyTax testing environment. From the MyTax menu, open MyInvois and select Preprod. This takes you to the testing version of the MyInvois Portal rather than the live production portal.

Step 2: Select the right taxpayer

After the portal opens, switch to the taxpayer or business that will own the integration. Check the business name and TIN before you register anything. The credentials belong to that taxpayer, so selecting the wrong profile can lead to authentication or issuer-mismatch errors later.

Check the TIN before copying credentials

The taxpayer selected in MyInvois must match the business you configure in MyInvois Bridge. A valid Client ID and Client Secret for another taxpayer are still the wrong credentials for this company.

Step 3: Register your ERP system

  1. 1Open View Taxpayer Profile from the profile menu.
  2. 2Scroll to the ERP section or choose View and Register ERP, depending on the current portal label.
  3. 3Choose Register ERP and complete the registration shown by the portal.

This is the self-provisioning step that creates the machine-to-machine credentials an ERP or integration tool uses to authenticate with MyInvois. If you cannot see the ERP option, check your role or ask the taxpayer administrator to complete the step.

Step 4: Copy the Client ID and Client Secret

When the ERP registration is complete, copy the Client ID and Client Secret values into your secure password manager or secrets store. Treat the secret like a password. Do not paste it into a public ticket, commit it to source control, or send it through an unsecured chat.

EnvironmentUseAPI hostCredentials
Sandbox / pre-productionTesting and integration workpreprod-api.myinvois.hasil.gov.myPre-production Client ID + Client Secret
ProductionLive e-Invoice submissionsapi.myinvois.hasil.gov.myProduction Client ID + Client Secret
Keep the two environments separate. The API host is shown for reference; the portal login and ERP registration happen in MyTax/MyInvois.

Step 5: Add the credentials to MyInvois Bridge

In MyInvois Bridge, open your company's MyInvois settings and add a credential set. Choose Sandbox (testing), then enter the LHDN Client ID and Client Secret you generated in pre-production. Save the credential set before trying a submission.

Do not confuse the two credential pairs

LHDN credentials let MyInvois Bridge authenticate with LHDN. MyInvois Bridge API credentials are a separate pair used when your own ERP or software calls the Bridge API. For the dashboard setup in this guide, enter the LHDN pair under MyInvois credentials.

Step 6: Test the connection

  1. 1Confirm that the environment is still Sandbox (testing).
  2. 2Run the connection or authentication check in MyInvois Bridge.
  3. 3Create or submit a representative test document and wait for the LHDN status.
  4. 4If the test is accepted or rejected with a useful validation reason, record what you learned before preparing the production cutover.

Common problems and quick fixes

  • 403 or invalid client: confirm that the Client ID and Client Secret came from the pre-production portal, not production.
  • Issuer TIN does not match: switch to the correct taxpayer in MyInvois and check the company selected in MyInvois Bridge.
  • Register ERP is missing: ask a taxpayer administrator to check your MyInvois role and permissions.
  • The secret no longer works: check whether it expired, was rotated, or was regenerated. Update the saved credential set with the current value.
  • The API request is going to the wrong host: pre-production uses preprod-api.myinvois.hasil.gov.my; production uses api.myinvois.hasil.gov.my.

Official references

Are pre-production e-Invoices real tax documents?

No. Pre-production is for testing the integration and document flow. Keep production credentials and live submissions separate.

Can I use production credentials in the sandbox?

No. LHDN uses separate credentials for each environment. Register the ERP in pre-production and use that Client ID and Client Secret for sandbox testing.

What if I cannot see Register ERP?

The option may depend on your taxpayer role. Ask the taxpayer administrator to open the profile or confirm that your user is authorized to register an ERP system.

What credentials do I enter in MyInvois Bridge?

For the dashboard connection, enter the Client ID and Client Secret issued by LHDN for the matching taxpayer and environment. Do not enter your separate MyInvois Bridge API client credentials in this form.

Ready to test your LHDN workflow?

Connect your pre-production credentials to MyInvois Bridge, run a representative test, and move to production only when your team is confident.