LHDN e-Invoicing Unify API | Malaysia Tax Documentation
Overview
The Unify API for LHDN (Lembaga Hasil Dalam Negeri) enables tax-compliant e-invoicing for Malaysian businesses. This API specifically handles LHDN's requirements for B2B transactions, supporting comprehensive document types including invoices, credit notes, debit notes, and self-billed invoices. It ensures proper tax calculations, validation rules, and compliance with LHDN's e-invoicing mandate.
e-Invoice Types
Code | Examples | Acceptable Values |
---|---|---|
01 | Invoice | INV |
02 | Credit Note | CRD |
03 | Debit Note | DBT |
04 | Refund Note | RFD |
11 | Self-billed Invoice | SLF_INV |
12 | Self-billed Credit Note | SLF_CRD |
13 | Self-billed Debit Note | SLF_DBT |
14 | Self-billed Refund Note | SLF_REF |
API URLs
Property | Value |
---|---|
Sandbox | https://malaysia-sandbox.complyance.io |
Production | https://malaysia-prod.complyance.io/ |
Endpoint | /unify |
Method | POST |
This endpoint validates and processes invoice data, including seller and buyer details, line items, and tax information.
Headers
Header | Type | Description | Example | Conditionality |
---|---|---|---|---|
x-api-key | string | Your API key | 1aN3AQ8ZsggJ0UABAHXVB | Mandatory |
invoiceMethod | string | Specify the invoice method (e.g., non-peppol , peppol ) | non-peppol | optional |
Content-Type | string | Set as application/json | application/json | optional |
- Shell
- Javascript
- Ruby
- Python
- PHP
- Java
- Go
curl --location 'https://malaysia-prod.complyance.io/unify' \
--header 'x-api-key: k4PW_J0s8DtBSdvYnadXn' \
--header 'Content-Type: application/json'
const headers = {
'x-api-key': 'k4PW_J0s8DtBSdvYnadXn',
'Content-Type': 'application/json'
};
fetch('https://malaysia-prod.complyance.io/unify', {
method: 'POST',
headers: headers
})
.then(function(response) {
return response.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
headers = {
'x-api-key' => 'k4PW_J0s8DtBSdvYnadXn',
'Content-Type' => 'application/json'
}
response = RestClient.post 'https://malaysia-prod.complyance.io/unify', {}, headers
puts response.body
import requests
headers = {
'x-api-key': 'k4PW_J0s8DtBSdvYnadXn',
'Content-Type': 'application/json'
}
response = requests.post('https://malaysia-prod.complyance.io/unify', headers=headers)
print(response.json())
<?php
$headers = [
'x-api-key' => 'k4PW_J0s8DtBSdvYnadXn',
'Content-Type' => 'application/json'
];
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', 'https://malaysia-prod.complyance.io/unify', [
'headers' => $headers
]);
echo $response->getBody()->getContents();
?>
URL url = new URL("https://malaysia-prod.complyance.io/unify");
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestMethod("POST");
con.setRequestProperty("x-api-key", "k4PW_J0s8DtBSdvYnadXn");
con.setRequestProperty("Content-Type", "application/json");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"net/http"
)
func main() {
headers := map[string][]string{
"x-api-key": []string{"k4PW_J0s8DtBSdvYnadXn"},
"Content-Type": []string{"application/json"},
}
req, err := http.NewRequest("POST", "https://malaysia-prod.complyance.io/unify", nil)
if err != nil {
// Handle error
}
for key, values := range headers {
for _, value := range values {
req.Header.Add(key, value)
}
}
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
// Handle error
}
defer resp.Body.Close()
}
Example Request:
{
"invoiceDataList": [
{
"documentType": "INV",
"documentId": "Invoice-01",
"originalEInvoiceReferenceNumber": "",
"documentIssueDate": "2025-01-06",
"documentIssueTime": "02:30:00Z",
"currency": "MYR",
"currencyExchangeRate": "1",
"supplierId": "1",
"sellerTinNumber": "C58794843040",
"sellerRegistrationIdType": "BRN",
"sellerRegistrationId": "198801006871",
"supplierSstRegistrationNumber": "A01-2345-67891012",
"supplierTourismTaxRegistrationNumber": "123-4567-89012345",
"buyerId": "1",
"buyerTinNumber": "C21540299050",
"buyerRegistrationIdType": "BRN",
"buyerRegistrationId": "200901037548",
"buyerSstRegistrationNumber": "234234234",
"isShippingAndBuyerAddressSame": false,
"shippingRecipientName": "Greenz Sdn. Bhd.",
"shippingRecipientTin": "C21540299050",
"shippingRecipientRegistrationType": "BRN",
"shippingRecipientRegistrationNumber": "200901037548",
"totalExcludingTax": "1000",
"taxTotal": "60",
"documentTotal": "1060",
"invoiceAmountExemptedFromTax": "0",
"invoiceTaxExemptionReason": "Goods acquired with SST exemption under Sales Tax Act 2018. Reference No: (C01-2345-67890123)",
"invoiceAdditionalDiscountAmount": "0",
"invoiceAdditionalChargeAmount": "0",
"totalPayableAmount": "1060",
"paymentMeans": "1",
"sellerAddress": {
"addressLine1": "Lot 66",
"addressLine2": "Bangunan Merdeka",
"addressLine3": "Persiaran Jaya",
"postalCode": "50480",
"city": "Kuala Lumpur",
"state": "14",
"country": "MYS"
},
"buyerAddress": {
"addressLine1": "Lot 66",
"addressLine2": "Bangunan Merdeka",
"addressLine3": "Persiaran Jaya",
"postalCode": "50480",
"city": "Kuala Lumpur",
"state": "14",
"country": "MYS"
},
"shippingRecipientAddress": {
"addressLine1": "Lot 66",
"addressLine2": "Bangunan Merdeka",
"addressLine3": "Persiaran Jaya",
"postalCode": "50480",
"city": "Kuala Lumpur",
"state": "14",
"country": "MYS"
},
"supplierDetails": {
"organizationName": "Name of Supplier",
"email": "email@supplier.com",
"industryCode": "01111",
"industryDescription": "Growing of maize",
"phoneNumber": "+60-123456789"
},
"buyerDetails": {
"organizationName": "ABC company",
"email": "name@buyer.com",
"phoneNumber": "+60-123456789"
},
"documentLineItems": [
{
"lineItemId": "1",
"commodityClassificationCode": "1",
"description": "BOP JETTING SUB, SLEEVE, 8\", REV E, BJS-8000-002 (BJS-8000-002-E)",
"unitPrice": "100",
"quantity": "10",
"lineItemSubtotal": "1000",
"discountPercent": "0",
"discountAmount": "0",
"chargePercent": "0",
"chargeAmount": "0",
"lineTotalExcludingTax": "1000",
"taxType": "1",
"taxPercentage": "6",
"totalTax": "60",
"taxExemptionReason": "Goods acquired with SST exemption under Sales Tax Act 2018. Reference No: (C01-2345-67890123)",
"amountExemptedFromTax": "0",
"lineItemTotal": "1060"
}
]
}
]
}
Request Parameter Fields
Invoice Details
Invoice Data List
ObjectName | Field Name | Conditionality | Informatics | Field Max Length | Sample Value |
---|---|---|---|---|---|
invoiceDataList | documentType | Mandatory | Identify the document type (e.g., INV, CRD, DBT, RFD, SLF_INV, SLF_CRD, SLF_DBT, SLF_REF.) | 3 to 7 | |
invoiceDataList | documentId | Mandatory | Document reference number used by Supplier for internal tracking purpose | 50 | |
invoiceDataList | originalEInvoiceReferenceNumber | Mandatory where applicable | LHDNM Unique Identifier Number of the original invoice/document that is being affected/adjusted. | 26 | |
invoiceDataList | documentIssueDate | Mandatory | Date of issuance of the e-Invoice (Note that the date must be the current date) | 10 (format: yyyy-mm-dd) | |
invoiceDataList | documentIssueTime | Mandatory | Time of issuance of the e-Invoice (Note that the time must be the UTC time) | 15 (format: hh:mm:ss) | |
invoiceDataList | currency | Mandatory | Specific currency that is used to represent the monetary value stated in the e-Invoice | 3 | |
invoiceDataList | invoiceStartDate | Optional | Start date of the transaction interval | 10 (format: yyyy-mm-dd) | |
invoiceDataList | invoiceEndDate | Optional | End date of the transaction interval | 10 (format: yyyy-mm-dd) | |
invoiceDataList | invoiceFrequency | Optional | Frequency of the invoice (e.g., Daily, Weekly, Biweekly, Monthly, Bimonthly, Quarterly, Half-yearly, Yearly, Others / Not Applicable) | 50 | |
invoiceDataList | supplierId | Optional | Identification Number of a Specific Supplier in an Invoice | 20 | |
invoiceDataList | sellerTinNumber | Mandatory | Supplier's TIN assigned by LHDNM | 14 | |
invoiceDataList | sellerRegistrationIdType | Mandatory | Supplier's Registration / Identification Number / Passport Number | ||
invoiceDataList | sellerRegistrationId | Mandatory | For businesses: Business registration number. For Malaysian individual: MyKad / MyTentera identification number. For non-Malaysian individual: Passport number / MyPR / MyKAS identification number. Note: For MyPR and MyKAS to use NRIC scheme. | ||
invoiceDataList | supplierSstRegistrationNumber | Mandatory where applicable | SST registration number of the Supplier. This is not applicable to Supplier that are not SST-registered. The input of special characters is not allowed, except for dash (-) and semicolon (;). A maximum of two SST registration numbers is allowed, separated by a semicolon. Supplier to input "NA" if supplier is not registered for SST. | 35 | |
invoiceDataList | supplierTourismTaxRegistrationNumber | Mandatory where applicable | Tourism tax registration number of the Supplier. This is only applicable to tourism tax registrant, which may consist of hotel operators and online travel operators. The input of special characters is not allowed, except for dash (-). Supplier to input "NA" if supplier is not registered for tourism tax. | 17 | |
invoiceDataList | buyerId | Optional | Identification Number of a Specific Buyer in an Invoice | ||
invoiceDataList | buyerTinNumber | Mandatory | Buyer's TIN assigned by LHDNM | 14 | |
invoiceDataList | buyerRegistrationIdType | Mandatory | Buyer's Registration / Identification Number / Passport Number | ||
invoiceDataList | buyerSstRegistrationNumber | Mandatory | SST registration number of the Buyer. This is not applicable to Buyers that are not SST-registered. The input of special characters is not allowed, except for dash (-) and semicolon (;). A maximum of two SST registration numbers is allowed, separated by a semicolon. Supplier to input "NA" if buyer's SST registration number is not available or not provided. | ||
invoiceDataList | isShippingAndBuyerAddressSame | Mandatory | Indicates whether the shipping and buyer address are the same | Boolean value | |
invoiceDataList | shippingRecipientName | Mandatory where applicable | Name of shipping recipient of the products included in the e-Invoice in a commercial transaction | 300 | |
invoiceDataList | shippingRecipientTin | Mandatory where applicable | TIN of the shipping recipient assigned by LHDNM | 14 | |
invoiceDataList | shippingRecipientRegistrationType | Mandatory where applicable | Supplier's Registration / Identification Number / Passport Number | ||
invoiceDataList | shippingRecipientRegistrationNumber | Mandatory where applicable | SST registration number of the Buyer. This is not applicable to Buyers that are not SST-registered. The input of special characters is not allowed, except for dash (-) and semicolon (;). A maximum of two SST registration numbers is allowed, separated by a semicolon. Supplier to input "NA" if buyer's SST registration number is not available or not provided. | ||
invoiceDataList | invoiceAdditionalDiscountAmount | Mandatory where applicable | Amount deducted from the original price of a product or service. Please add currencyID attribute to the XML element. | ||
invoiceDataList | invoiceAdditionalChargeAmount | Mandatory where applicable | Charge associated with the product or service (be it in the form of percentage (%) or prevailing specified rate) imposed before tax. Please add currencyID attribute to the XML element. | ||
invoiceDataList | totalExcludingTax | Mandatory | Sum of amount payable (inclusive of applicable discounts and charges), excluding any applicable taxes (e.g., sales tax, service tax). Please add currencyID attribute to the XML. | ||
invoiceDataList | taxTotal | Mandatory | Total amount of tax payable | ||
invoiceDataList | documentTotal | Mandatory | Invoice Total Amount Including Tax | ||
invoiceDataList | invoiceAmountExemptedFromTax | Mandatory where applicable | Total amount of tax exempted for sales tax or service tax purposes on the invoice level. | ||
invoiceDataList | invoiceTaxExemptionReason | Mandatory where applicable | Description of tax exemption applicable on the invoice level (e.g., Buyer's sales tax exemption certificate number, special exemption as per gazette orders, etc.). The input is limited to the following special characters: period ".", dash "-", comma ",", and parenthesis "()". | ||
invoiceDataList | totalPayableAmount | Mandatory | Sum of amount payable (inclusive of total taxes chargeable and any rounding adjustment) excluding any amount paid in advance. Please add currencyID attribute to the XML element. | ||
invoiceDataList | paymentMeans | Optional | Chosen mechanism through which funds are transferred from buyer to supplier (e.g., cash, cheque, bank transfer, credit card, debit card, e-Wallet/ Digital Wallet, etc.) | 2 |