Skip to content

MyInvois ClientMalaysia e-invoicing for TypeScript

Document building, XAdES (JSON) signing, submission, polling, taxpayer validation and built-in rate limiting for the LHDN MyInvois API.

Install ​

bash
npm install @ripwords/myinvois-client
# or: bun add / pnpm add / yarn add @ripwords/myinvois-client

At a glance ​

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

const client = MyInvoisClient.fromP12(
  clientId,
  clientSecret,
  'sandbox', // or 'production'
  'path/to/certificate.p12',
  passphrase,
)

const { data, status } = await client.submitDocument([invoice])
if (status === 202) {
  const result = await client.getSubmissionStatus(data.submissionUid)
  console.log(result.status) // 'Valid' | 'PartiallyValid' | 'Invalid' | ...
}

Scope: Malaysia MyInvois only. Singapore's InvoiceNow / Peppol e-invoicing is a different system and out of scope.

Agents: a machine-readable summary of this site lives at llms.txt.