# MyInvois e-Invoice

Source: https://xmlvalid.com/schemas/my-myinvois

> An e-invoice for LHDN's MyInvois System: invoices, credit, debit and refund notes and their self-billed forms, checked against UBL 2.1 and the MyInvois validations.

Malaysia requires e-invoices in phases by annual turnover, starting with businesses above RM100 million on 1 August 2024. An e-invoice is submitted to the MyInvois System of LHDN (HASiL), which validates it and gives it a unique identifier.
Every MyInvois document is a UBL 2.1 Invoice: InvoiceTypeCode 01 is an invoice, 02 a credit note, 03 a debit note, 04 a refund note, and 11 to 14 the same documents self-billed by the buyer. Its listVersionID is the version: 1.1 is signed with the issuer's certificate, 1.0 is not, and 1.2 and 1.3 are their forms for the Voluntary Disclosure programme, until 31 December 2027.

- Type: XSD + Schematron
- Version: MyInvois document types 1.0 to 1.3
- Namespace: `urn:oasis:names:specification:ubl:schema:xsd:Invoice-2`
- Root element: `Invoice`
- Publisher: LHDN (Inland Revenue Board of Malaysia) (Published by LHDN for implementers), source: https://sdk.myinvois.hasil.gov.my/documents/
- Rules: [MyInvois validations of LHDN (Malaysia) MyInvois SDK of 25 September 2026](https://xmlvalid.com/rules/sets/my-myinvois)
- Validate against it: https://xmlvalid.com/validate?schema=my-myinvois

## Notes

- Rules run only when the document matches the schema. Documents over 50 MB are checked against the schema only.
- The rules are xmlvalid's, written from the MyInvois SDK: the fields it marks mandatory, the formats of the core fields, the code tables (classification, MSIC, state, country, currency, tax type, payment mode, unit of measure), currencies and exchange rate, the general TINs, and in a signed version the document digest, the RSA signature and the certificate digest. Ids are LHDN's error codes where it has one (CF, CV, DC, DS, ERR); the mathematical mappings of the SDK are warnings.
- Not checked: whether a TIN or registration number is registered, the submitter against the certificate, the referenced documents, duplicates and the time of submission, which need the MyInvois System.
- The schema is UBL 2.1 with one change: the certificate serial number in the signature (X509SerialNumber) is read as an integer of any length, as libxml2 reads integers of up to 24 digits.
- The examples are by xmlvalid.com with made-up companies and TINs: a signed invoice (version 1.1, with a test certificate), a credit note, a consolidated e-invoice to the general public and a self-billed import from a foreign supplier in USD.
