Skip to content

Runtime Code Lists ​

The official MyInvois code tables ship as typed runtime arrays under a separate subpath, so they stay out of your main bundle unless imported:

typescript
import {
  TAX_TYPES,            // { code: '01', description: 'Sales Tax' }, ...
  CLASSIFICATION_CODES,
  STATE_CODES,
  COUNTRY_CODES,
  CURRENCY_CODES,
  E_INVOICE_TYPES,
  PAYMENT_MODES,
  UNIT_TYPES,           // 2000+ UOM codes
  MSIC_CODES,           // 1000+ industry codes, with categoryReference
} from '@ripwords/myinvois-client/codes'

Every entry's code is checked against the same TypeScript union types the document builder uses, so the lists and the compile-time types cannot drift apart.

Lists and their official sources ​

ExportEntriesOfficial documentation
TAX_TYPES7Tax types
CLASSIFICATION_CODES45Classification codes
STATE_CODES17State codes
COUNTRY_CODES253Country codes
CURRENCY_CODES180Currency codes
E_INVOICE_TYPES8e-Invoice types
PAYMENT_MODES8Payment methods
UNIT_TYPES2162Unit types
MSIC_CODES1174MSIC codes

The tables are regenerated from the official SDK JSON files (https://sdk.myinvois.hasil.gov.my/files/*.json) with bun run scripts/generate-codes.ts — rerun it when LHDN updates a table.

Example: populate a dropdown ​

typescript
import { STATE_CODES } from '@ripwords/myinvois-client/codes'

const options = STATE_CODES.map(s => ({ value: s.code, label: s.name }))
// [{ value: '01', label: 'Johor' }, ..., { value: '14', label: 'Wilayah Persekutuan Kuala Lumpur' }, ...]