FastPath- Prompt this to Claude
Works in Claude Code (myinvois skill) or any MCP client running mcp-myinvois. Copy, paste, done or do it manually with the steps below.
What you need before starting
- Your TIN (Tax Identification Number) e.g.
C1234567890for a company. Don't know it? Check MyTax, or e-Daftar. - A MyTax account as the company's director or appointed representative. If the company is new to MyTax, the director must register a digital certificate first (guided on the login page).
- Node.js ≥ 18 on this machine for the CLI you'll verify with. Check:
node --version
Log in to the sandbox MyTax
The sandbox has its own portal note the preprod- prefix:
Log in with your personal ID, then verify with your digital certificate password.
Switch to the company role, open MyInvois
You land on the MyTax dashboard as an individual. To act for the company, pick its role first, then open the MyInvois portal.
MyInvois opens in a new tab at preprod.myinvois.hasil.gov.my
Taxpayer profile → Register ERP
Inside the MyInvois portal, open your Taxpayer Profile (top-right avatar → View Taxpayer Profile). The ERP registration lives there.
“ERP” just means any system that talks to the API your CLI counts. Name it
something you'll recognise, e.g. yourcompany-cli. Pick the longest client-secret
expiry offered.
authenticated TIN and documents TIN is not matching and you'll have
to re-register under the company role.Copy the Client ID and Client Secret
After registering, the portal shows your credentials once:
Generate your ~/.myinvois.env
Credential file builder
Everything here stays in this page no network calls, nothing stored. View source to verify.
Prove the connection works
From the einvoice repo folder:
Expected: { "env": "sandbox", "token": "eyJhbGciOi…(cached)" }
Then validate your own company's TIN against its BRN this exercises a real business API:
Expected: "valid": true
invalid_client? Wrong environment (sandbox keys against prod
or vice-versa) or a typo in the secret. Re-check step 06.