UBL 2.1 (Universal Business Language)
UBL 2.1 is the international XML/JSON standard used for structuring MyInvois e-invoices, defining all mandatory fields and document format.
What is UBL 2.1 (Universal Business Language)?
Universal Business Language (UBL) is an internationally standardised library of XML business document schemas developed by OASIS (Organization for the Advancement of Structured Information Standards). Malaysia's MyInvois platform uses UBL version 2.1 as the foundational structure for all e-invoices, credit notes, and debit notes. The UBL 2.1 standard defines a common vocabulary of XML elements and their relationships, ensuring that any system capable of reading UBL can parse a Malaysian e-invoice without custom integration.
In the MyInvois context, LHDN has published a specific "Malaysia UBL 2.1 Invoice Schema" that is a constrained profile of the international UBL 2.1 standard. This means the Malaysian schema takes the UBL 2.1 framework and adds local requirements: mandatory fields for TIN, MSIC code, SST registration number, supply type classification, and other Malaysia-specific data elements. The schema is published on the MyInvois developer portal along with sample invoice files and validation tools.
Malaysia's MyInvois supports two serialisation formats: XML (the classic UBL format) and JSON (a JavaScript Object Notation representation of the same data structure). Both formats carry identical information and both are accepted by the MyInvois API. Most enterprise accounting systems and ERP platforms use the XML format, while newer cloud-native applications and middleware solutions often prefer JSON due to its lighter weight and easier handling in web APIs. The choice between XML and JSON is largely a technical preference — both must conform to the same UBL 2.1 schema constraints.
The mandatory fields in a UBL 2.1 invoice for Malaysia include: invoice number, invoice date, invoice type code, supplier's TIN and legal name, supplier's address and MSIC code, buyer's TIN and legal name (for B2B), line items with description and unit price, subtotal, applicable SST (Sales Tax and/or Service Tax) amounts and rates, total payable amount, and currency code. Optional fields cover additional reference numbers, delivery addresses, payment terms, and attachments. LHDN's schema validation will reject an invoice if any mandatory field is absent or formatted incorrectly.
Businesses rarely need to write UBL directly. Certified e-invoicing software, ERP integrations, and Peppol Access Points all generate UBL-compliant invoices automatically from the data entered by users. What businesses do need to understand is that their invoice data — customer details, item descriptions, prices, tax codes — must be complete and accurate before it is transformed into UBL, because any gap in the source data will cause a validation failure at MyInvois.
Related Terms
Frequently Asked Questions
Do I need to write UBL myself?↓
What fields are mandatory in UBL for Malaysia?↓
Is UBL the same as an XML invoice?↓
Ready to implement e-invoicing?
Find certified MyInvois-compliant software or check your readiness with our free calculator.
EInvoicingMalaysia.com is an independent directory. We are not affiliated with LHDN or the Malaysian government. Glossary definitions are for informational purposes and do not constitute legal or tax advice. Always refer to the official LHDN e-Invoice Guidelines at hasil.gov.my for authoritative requirements.