Skip to main content

Unify

Overview

The Unify API allows you to validate and process Business-to-Business (B2B) invoices. The API supports various document types such as invoices, credit notes, and debit notes and self-billed invoices ensures compliance with relevant tax and invoicing regulations.

e-Invoice Types

CodeExamplesAcceptable Values
01InvoiceINV
02Credit NoteCRD
03Debit NoteDBT
04Refund NoteRFD
11Self-billed InvoiceSLF_INV
12Self-billed Credit NoteSLF_CRD
13Self-billed Debit NoteSLF_DBT
14Self-billed Refund NoteSLF_REF

API URLs

PropertyValue
Sandboxhttps://malaysia-sandbox.complyance.io
Productionhttps://malaysia-prod.complyance.io/
Endpoint/unify
MethodPOST

This endpoint validates and processes invoice data, including seller and buyer details, line items, and tax information.

Headers

HeaderTypeDescriptionExampleConditionality
x-api-keystringYour API key1aN3AQ8ZsggJ0UABAHXVBMandatory
invoiceMethodstringSpecify the invoice method (e.g., non-peppol, peppol)non-peppoloptional
Content-TypestringSet as application/jsonapplication/jsonoptional

curl --location 'https://malaysia-prod.complyance.io/unify' \
--header 'x-api-key: k4PW_J0s8DtBSdvYnadXn' \
--header 'Content-Type: application/json'

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

ObjectNameField NameConditionalityInformaticsField Max LengthSample Value
invoiceDataListdocumentTypeMandatoryIdentify the document type (e.g., INV, CRD, DBT, RFD, SLF_INV, SLF_CRD, SLF_DBT, SLF_REF.)3 to 7
invoiceDataListdocumentIdMandatoryDocument reference number used by Supplier for internal tracking purpose50
invoiceDataListoriginalEInvoiceReferenceNumberMandatory where applicableLHDNM Unique Identifier Number of the original invoice/document that is being affected/adjusted.26
invoiceDataListdocumentIssueDateMandatoryDate of issuance of the e-Invoice (Note that the date must be the current date)10 (format: yyyy-mm-dd)
invoiceDataListdocumentIssueTimeMandatoryTime of issuance of the e-Invoice (Note that the time must be the UTC time)15 (format: hh:mm:ss)
invoiceDataListcurrencyMandatorySpecific currency that is used to represent the monetary value stated in the e-Invoice3
invoiceDataListinvoiceStartDateOptionalStart date of the transaction interval10 (format: yyyy-mm-dd)
invoiceDataListinvoiceEndDateOptionalEnd date of the transaction interval10 (format: yyyy-mm-dd)
invoiceDataListinvoiceFrequencyOptionalFrequency of the invoice (e.g., Daily, Weekly, Biweekly, Monthly, Bimonthly, Quarterly, Half-yearly, Yearly, Others / Not Applicable)50
invoiceDataListsupplierIdOptionalIdentification Number of a Specific Supplier in an Invoice20
invoiceDataListsellerTinNumberMandatorySupplier’s TIN assigned by LHDNM14
invoiceDataListsellerRegistrationIdTypeMandatorySupplier’s Registration / Identification Number / Passport Number
invoiceDataListsellerRegistrationIdMandatoryFor 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.
invoiceDataListsupplierSstRegistrationNumberMandatory where applicableSST 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
invoiceDataListsupplierTourismTaxRegistrationNumberMandatory where applicableTourism 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
invoiceDataListbuyerIdOptionalIdentification Number of a Specific Buyer in an Invoice
invoiceDataListbuyerTinNumberMandatoryBuyer’s TIN assigned by LHDNM14
invoiceDataListbuyerRegistrationIdTypeMandatoryBuyer’s Registration / Identification Number / Passport Number
invoiceDataListbuyerSstRegistrationNumberMandatorySST 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.
invoiceDataListisShippingAndBuyerAddressSameMandatoryIndicates whether the shipping and buyer address are the sameBoolean value
invoiceDataListshippingRecipientNameMandatory where applicableName of shipping recipient of the products included in the e-Invoice in a commercial transaction300
invoiceDataListshippingRecipientTinMandatory where applicableTIN of the shipping recipient assigned by LHDNM14
invoiceDataListshippingRecipientRegistrationTypeMandatory where applicableSupplier’s Registration / Identification Number / Passport Number
invoiceDataListshippingRecipientRegistrationNumberMandatory where applicableSST 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.
invoiceDataListinvoiceAdditionalDiscountAmountMandatory where applicableAmount deducted from the original price of a product or service. Please add currencyID attribute to the XML element.
invoiceDataListinvoiceAdditionalChargeAmountMandatory where applicableCharge 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.
invoiceDataListtotalExcludingTaxMandatorySum 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.
invoiceDataListtaxTotalMandatoryTotal amount of tax payable
invoiceDataListdocumentTotalMandatoryInvoice Total Amount Including Tax
invoiceDataListinvoiceAmountExemptedFromTaxMandatory where applicableTotal amount of tax exempted for sales tax or service tax purposes on the invoice level.
invoiceDataListinvoiceTaxExemptionReasonMandatory where applicableDescription 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 “()”.
invoiceDataListtotalPayableAmountMandatorySum 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.
invoiceDataListpaymentMeansOptionalChosen 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

Supplier Details

ObjectNameField NameConditionalityInformaticsField Max LengthSample Value
supplierDetailsorganizationNameMandatoryName of business or individual who will be the supplier providing the goods / services in a commercial transaction.300
supplierDetailsemailOptionalE-mail address of the Supplier (Following the email standards (RFC 5321 and RFC 5322)).320
supplierDetailsindustryCodeMandatory5-digit numeric code that represents the Supplier’s business nature and activity5
supplierDetailsindustryDescriptionMandatoryDescription of the Supplier’s business activity300
supplierDetailsphoneNumberMandatoryThe telephone number of the Supplier (e.g., office, mobile, fax)20

Seller's Address

ObjectNameField NameConditionalityInformaticsField Max LengthSample Value
sellerAddressaddressLine1MandatoryThis is the main address line in an address structure that can be used to give the main address line information. A possible value for this field is “NA” and then all other address fields would not be provided except for the state field which would is mapped to the field.150
sellerAddressaddressLine2OptionalAn additional address line in an address that can be used to give further details supplementing the main line.150
sellerAddressaddressLine3OptionalAn additional address line in an address that can be used to give further details supplementing the main line.150
sellerAddresspostalCodeOptionalThe identifier for an addressable group of properties according to the relevant postal service.50
sellerAddresscityMandatoryThe common name of the city, town or village, where the Supplier, Buyer and Shipping Recipient address is located.50
sellerAddressstateMandatoryThe state of a country.50
sellerAddresscountryMandatoryA code that identifies the country.3

Buyer’s Address

ObjectNameField NameConditionalityInformaticsField Max LengthSample Value
buyerAddress.addressLine1Address Line 1MandatoryThe main address line in an address structure. Input "NA" if unavailable150Lot 66
buyerAddress.addressLine2Address Line 2OptionalAn additional address line for further details150Bangunan Merdeka
buyerAddress.addressLine3Address Line 3OptionalAn additional address line for further details150Persiaran Jaya
buyerAddress.postalCodePostal ZoneOptionalThe identifier for a postal zone5050480
buyerAddress.cityCity NameMandatoryThe common name of the city50Kuala Lumpur
buyerAddress.stateStateMandatoryThe state of a country5014
buyerAddress.countryCountryMandatoryA code identifying the country3MYS

Shipping Details

ObjectNameField NameConditionalityInformaticsField Max LengthSample Value
shippingRecipientAddressaddressLine1Mandatory where applicableThis is the main address line in an address structure that can be used to give the main address line information. A possible value for this field is “NA” and then all other address fields would not be provided except for the state field which would is mapped to the field.150
shippingRecipientAddressaddressLine2OptionalAn additional address line in an address that can be used to give further details supplementing the main line.150
shippingRecipientAddressaddressLine3OptionalAn additional address line in an address that can be used to give further details supplementing the main line.150
shippingRecipientAddresspostalCodeOptionalThe identifier for an addressable group of properties according to the relevant postal service.50
shippingRecipientAddresscityMandatory where applicableThe common name of the city, town or village, where the Supplier, Buyer and Shipping Recipient address is located.50
shippingRecipientAddressstateMandatory where applicableThe state of a country.50
shippingRecipientAddresscountryMandatory where applicableA code that identifies the country.3

Invoice Line Item

ObjectNameField NameConditionalityInformaticsField Max LengthSample Value
documentLineItems.lineItemIdLine IDOptionalIdentification of a Specific Line in an Invoice201
documentLineItems.commodityClassificationCodeClassificationMandatoryCategory of products or services being billed31
documentLineItems.descriptionDescription of Product or ServiceMandatoryDetails of products or services being billed300Laptop Peripherals
documentLineItems.unitPriceUnit PriceMandatoryPrice assigned to a single unit of a product or service4
documentLineItems.quantityQuantityOptionalNumber of units of a product or service1
documentLineItems.lineItemSubtotalSubtotalMandatoryAmount of each individual item, excluding any taxes or charges100
documentLineItems.lineTotalExcludingTaxTotal Excluding TaxMandatorySum of amount payable excluding any applicable taxes1436.5
documentLineItems.taxTypeTax TypeMandatoryType of taxes that will be applicable21
documentLineItems.taxPercentageTax RateMandatoryThe appropriate tax rate that is applicable6
documentLineItems.totalTaxTax AmountMandatoryThe amount of tax payable292.2
documentLineItems.taxCodeDetails of Tax ExemptionOptionalDescription of tax exemption applicable300SST exemption
documentLineItems.taxExemptionReasonAmount Exempted from TaxConditional MandatoryTotal amount of tax exempted for SST purposes1460.5
documentLineItems.chargeAmountCharge AmountOptionalCharge associated with the product or service imposed after tax1000
documentLineItems.discountAmountDiscount AmountOptionalAmount deducted from the original price of a product1000
documentLineItems.lineItemTotallineItemTotalMandatorySum of amount payable inclusive of total taxes chargeable1060
invoiceAdditionalChargeAmountOptionalAdditional Charges at Invoice Level
invoiceAdditionalDiscountAmountOptionalAdditional Discount at Invoice Level
invoiceAmountExemptedFromTaxAmount Exempted from TaxMandatory if tax exemption is applicableTotal amount of tax exempted for sales tax or service tax purposes. Please add currencyID attribute to the XML element.10
invoiceTaxExemptionReasonTaxExemptionReasonMandatory if tax exemption is applicableDescription of tax exemption applicable on the invoice level. (e.g., Buyer’s sales tax exemption certificate number, special exemption as per gazette orders, etc.).Goods acquired with SST exemption under Sales Tax Act 2018. Reference No: ABC.TAX(S)012-3/4/56(7)
paymentMeansPaymentMeansCodeOptionalChosen 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.)1
invoiceAdditionalDiscountAmountDiscount AmountOptionalAdditional Charges at Invoice Level1000
totalExcludingTaxTotal Excluding TaxMandatorySum of amount payable excluding any applicable taxes1436.5
taxTotalTotal Tax AmountMandatoryTotal amount of tax payable1234
documentTotalInvoice Total Amount Including TaxMandatorySum of amount payable inclusive of total taxes chargeable1436.5
totalPayableAmountTotal Payable AmountMandatorySum of amount payable excluding any amount paid in advance and rounding1436.5

Response Schema

Parameter NameTypeLengthDescription
submissionUidstringNAThe number generated by LHDN and serves as the official identifier for submissions.
documentUlidstringThe number generated on the compliance side for internal tracking purposes and is primarily useful for internal operations.
uuidstringGovernment acknowledgment number for the invoice triggered to LHDN.
invoiceCodeNumberstringDocument reference number used by Supplier for internal tracking purpose.

Success Handling:

Success Response Example

When a submission is successful, the system returns a JSON response with details of the accepted documents.

{
"submissionUid": "RX6B21HC498ZENSDT46CDD7J10",
"acceptedDocuments": [
{
"documentUlid": "01J7DDBTBYG1G5JQEDVY8C1H6S",
"uuid": "3A2FR8X29FZ3H12ET46CDD7J10",
"invoiceCodeNumber": "ML-ST-2424",
"xmlEncoded": "PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9InllcyI/Pgo8SW52b2ljZSB4bWxucz0idXJuOm9hc2lzOm5hbWVzOnNwZWNpZmljYXRpb246dWJsOnNjaGVtYTp4c2Q6SW52b2ljZS0yIiB4bWxuczpjYWM9InVybjpvYXNpczpuYW1lczpzcGVjaWZpY2F0aW9uOnVibDpzY2hlbWE6eHNkOkNvbW1vbkFnZ3JlZ2F0ZUNvbXBvbmVudHMtMiIgeG1sbnM6Y2JjPSJ1cm46b2FzaXM6bmFtZXM6c3BlY2lmaWNhdGlvbnU6dWJsOnNjaGVtYTp4c2Q6Q29tbW9uQmFzaWNDb21wb25lbnRzLTIiIHhtbG5zOm5zND0iaHR0cDovL3d3dy53My5vcmcvMjAwMC8wOS94bWxkc2ljIj4KCTxVQkxFeHRlbnNpb25zIHhtbG5zPSJ1cm46b2FzaXM6bmFtZXM6c3BlY2lmaWNhdGlvbnU6dWJsOnNjaGVtYTp4c2Q6Q29tbW9uRXh0ZW5zaW9uQ29tcG9uZW50cy0yIiB4bWxuczppbmZvPSJodHRwOi8vd3d3LmV4YW1wbGUuY29tL2luZm8uYXNkIj4KCQk8VGVzdERhdGE+U29tZSBkYXRhIGhlcmUuPC9UZXN0RGF0YT4KCQk8U2lnbmF0dXJlPgoJCQk8U2lnbmF0dXJlSW5mbz5EYXRhPC9TaWduYXR1cmVJbmZvPgoJCTwvU2lnbmF0dXJlPgo8L0ludm9pY2U+Cg=="
}
],
"rejectedDocuments": [],
"timestamp": "2023-08-14T08:15:30Z"
}

Error Handling:

Error Response Example

When an error occurs during submission, the system returns a JSON response containing details of the error.

{
"errorMessages": {
"0": {
"invoiceDataList[0]-buyerAddress-postalCode": "Buyer postalcode cannot be empty",
"invoiceDataList[0]-sellerAddress-state": "seller State must be a valid 2 digit number from 00 to 17",
"invoiceDataList[0]-sellerAddress-postalCode": "seller postalcode cannot be empty"
}
},
"batchId": null,
"errorCode": null
}

The API may return the following error responses depending on the validation result or request issues:

Error CodeDescription
400Bad Request – Invalid data in the request.
401Unauthorized – Invalid or missing API key.
500Internal Server Error – Server encountered an error.

The API may return the following success responses depending on the validation result or submission status:

Status CodeDescription
200Success – The request was processed successfully.
202Accepted – The request has been accepted but is still processing.

  • Ensure that your document types are accepted based on the specifications of your jurisdiction.
  • Confirm that the invoice format complies with the standards to avoid any delays.