E-Invoicing Glossary

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?
No. If you use certified e-invoicing software, an integrated accounting system, or a Peppol Access Point, the software generates UBL automatically from your invoice data. You only need to ensure your invoice records contain all required information (TIN, MSIC code, SST details, etc.). Developers building direct API integrations will need to construct UBL documents programmatically, for which LHDN provides sample files, schema files (XSD), and documentation on the MyInvois developer portal.
What fields are mandatory in UBL for Malaysia?
Mandatory fields under Malaysia's UBL 2.1 profile include: invoice ID (unique reference number), issue date, invoice type code, supplier TIN, supplier name, supplier address, supplier MSIC code, buyer TIN (for B2B), buyer name, line items with descriptions and unit prices, subtotal, tax total (SST amount and rate), total payable amount, and currency (MYR for domestic invoices). Additional fields are required for specific scenarios such as consolidated invoices or invoices involving foreign currency.
Is UBL the same as an XML invoice?
UBL is a specific XML standard — not all XML invoices are UBL. An XML invoice is simply any invoice expressed in XML format, which could follow any proprietary or bespoke schema. UBL 2.1 is a particular, internationally standardised XML schema maintained by OASIS. MyInvois requires UBL 2.1 XML specifically (or its JSON equivalent), not just any XML document. An invoice in a custom XML format would be rejected by MyInvois unless it conforms to the UBL 2.1 schema constraints defined by LHDN.

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.