Malaysia v2: Create Receipt API

Create receipts for high-volume B2C sales and consolidate them into one e-invoice later, in the Malaysia LHDN API v2 (legacy): endpoint, headers, request fields, responses and code examples.

The Create Receipt API is for cases where issuing an e-invoice for every transaction is not practical, such as B2C (business-to-consumer) sales in supermarkets, retail stores and other high-volume businesses.

In a B2C flow, individual consumers make frequent, small purchases and usually do not need an e-invoice at the point of sale. A supermarket may serve thousands of customers a day, and an e-invoice for each sale would be impractical.

Instead, you issue receipts to customers during the day. A receipt is the customer’s proof of purchase, and you do not send each one to the tax authority straight away.

At the end of the day, or another period, the receipts are consolidated into a single e-invoice that summarizes all the transactions in that period. That e-invoice goes to the tax authority to meet the compliance requirements.

This approach:

  1. Saves work: you do not generate and submit an e-invoice for every B2C sale. Receipts are created at once, and the e-invoice is generated in bulk later.
  2. Keeps you compliant: a consolidated e-invoice at the end of each day, or another interval, meets the legal requirements.
  3. Keeps checkout fast: customers get their receipt at checkout.

It suits businesses with a high volume of low-value transactions.

You create a receipt by sending its data as JSON in a POST request.

Document types

CodeDocumentValue to send
01InvoiceINV
02Credit NoteCRD

Endpoint

EnvironmentHost
Sandboxhttps://malaysia-sandbox.complyance.io
Productionhttps://malaysia-prod.complyance.io
Create a receipthttp
POST https://malaysia-sandbox.complyance.io/createReciept
POST https://malaysia-prod.complyance.io/createReciept

The path is spelled createReciept.

Headers

HeaderValueDescriptionConditionality
x-api-keyyour-api-keyAPI key that authorizes the requestMandatory
Content-Typeapplication/jsonSays the request body is JSONOptional

Code examples

These examples show the endpoint and headers. Send the request body as JSON.

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

Request body

Send the receipts as a JSON array in receiptDataList. Each receipt number must be unique.

Request bodyjson
{
    "receiptDataList": [
        {
            "documentType": "INV",
            "recieptNumber": "RCPT-2025-0001",
            "mobileNumber": "60123456789",
            "originalEInvoiceReferenceNumber": "",
            "recieptIssueDate": "2025-01-07",
            "documentIssueTime": "22:30:00Z",
            "typeOfBuyer": "BUSINESS",
            "currency": "MYR",
            "currencyExchangeRate": "",
            "supplierId": "",
            "sellerTinNumber": "C20000000000",
            "sellerRegistrationIdType": "BRN",
            "sellerRegistrationId": "202001234567",
            "supplierSstRegistrationNumber": "",
            "supplierTourismTaxRegistrationNumber": "",
            "buyerId": "",
            "buyerTinNumber": "",
            "buyerRegistrationIdType": "",
            "buyerRegistrationId": "",
            "buyerSstRegistrationNumber": "",
            "isShippingAndBuyerAddressSame": true,
            "shippingRecipientName": "",
            "shippingRecipientTin": "",
            "shippingRecipientRegistrationType": "",
            "shippingRecipientRegistrationNumber": "",
            "totalExcludingTax": "700",
            "taxTotal": "0",
            "documentTotal": "700",
            "invoiceAmountExemptedFromTax": "0",
            "invoiceTaxExemptionReason": "Goods acquired with SST exemption under Sales Tax Act 2018. Reference No: (C01-2345-67890123)",
            "invoiceAdditionalDiscountAmount": "0",
            "invoiceAdditionalChargeAmount": "00",
            "totalPayableAmount": "700",
            "paymentMeans": "07",
            "sellerAddress": {
                "addressLine1": "Lot 66",
                "addressLine2": "Bangunan Merdeka",
                "addressLine3": "Persiaran Jaya",
                "postalCode": "",
                "city": "Kuala Lumpur",
                "state": "08",
                "country": "MYS"
            },
            "buyerAddress": {
                "addressLine1": "",
                "addressLine2": "",
                "addressLine3": "",
                "postalCode": "",
                "city": "",
                "state": "",
                "country": ""
            },
            "shippingRecipientAddress": {
                "addressLine1": "",
                "addressLine2": " ",
                "addressLine3": " ",
                "postalCode": "",
                "city": "",
                "state": "",
                "country": ""
            },
            "supplierDetails": {
                "organizationName": "Acme Trading Sdn Bhd",
                "email": "finance@acme.example",
                "industryCode": "01111",
                "industryDescription": "Growing of maize",
                "phoneNumber": "60123456789"
            },
            "buyerDetails": {
                "organizationName": "",
                "email": "",
                "phoneNumber": ""
            },
            "documentLineItems": [
                {
                    "lineItemId": "1",
                    "commodityClassificationCode": "10",
                    "description": "Laptop peripherals",
                    "unitPrice": "100",
                    "quantity": "7",
                    "lineItemSubtotal": "700",
                    "discountPercent": "0",
                    "discountAmount": "0",
                    "chargePercent": "0",
                    "chargeAmount": "0",
                    "lineTotalExcludingTax": "700",
                    "taxType": "06",
                    "taxPercentage": "0",
                    "totalTax": "0",
                    "taxExemptionReason": "Goods acquired with SST exemption under Sales Tax Act 2018. Reference No: (C01-2345-67890123)",
                    "amountExemptedFromTax": "0",
                    "lineItemTotal": "700"
                }
            ]
        }
    ]
}

Request fields

Receipt details

Each field below belongs to an object in receiptDataList.

Field nameConditionalityDescriptionMax length
documentTypeMandatoryThe document type (for example INV, CRD, DBT, RFD, SLF_INV, SLF_CRD, SLF_DBT, SLF_REF).3 to 7
recieptNumberMandatoryReceipt reference number for internal tracking. Example: test6.50
recieptIssuedateMandatoryDate the receipt is issued. Must be the current date. Format: yyyy-mm-dd.10
mobileNumberOptionalMobile number used to convert the receipt to an e-invoice. Example: +60123456789.15
originalEInvoiceReferenceNumberMandatory where applicableLHDNM unique identifier number of the original invoice or document being adjusted.26
documentIssueDateMandatoryDate the e-invoice is issued. Must be the current date.10 (format: yyyy-mm-dd)
typeOfBuyerMandatoryThe type of buyer: BUSINESS for business entities or INDIVIDUAL for personal customers.
documentIssueTimeMandatoryTime the e-invoice is issued. Must be UTC time.15 (format: hh:mm:ss)
currencyMandatoryThe currency of the monetary values in the e-invoice.3
sellerTinNumberMandatorySupplier’s TIN, assigned by LHDNM.14
sellerRegistrationIdTypeMandatorySupplier’s registration, identification or passport number type.
sellerRegistrationIdMandatoryFor businesses: business registration number. For Malaysian individuals: MyKad or MyTentera identification number. For non-Malaysian individuals: passport number, MyPR or MyKAS identification number. MyPR and MyKAS use the NRIC scheme.
supplierSstRegistrationNumberMandatory where applicableSupplier’s SST registration number. Not applicable to suppliers that are not SST-registered. Only the special characters dash (-) and semicolon (;) are allowed. Up to 2 SST numbers, separated by a semicolon. Enter “NA” if not SST-registered.35
supplierTourismTaxRegistrationNumberMandatory where applicableSupplier’s tourism tax registration number. Only applies to registrants such as hotel operators. Only the special character dash (-) is allowed. Enter “NA” if not registered.17
totalExcludingTaxMandatorySum of the amount payable, excluding taxes. Attach the currencyID attribute to the XML element.
taxTotalMandatoryTotal amount of tax payable.
documentTotalMandatoryInvoice total amount including tax.
totalPayableAmountMandatorySum of the amount payable, including taxes and adjustments, excluding advance payments. Attach the currencyID attribute to the XML element.
paymentMeansOptionalHow funds are transferred (for example cash, cheque, bank transfer, credit card, e-wallet).2

Response fields

Parameter nameTypeLengthDescription
submissionUidstringNAThe number LHDN generates as the official identifier for a submission.
documentUlidstringThe number Complyance generates for the document, for tracking.
uuidstringGovernment acknowledgement number for the invoice sent to LHDN.
invoiceCodeNumberstringDocument reference number the supplier uses for internal tracking.

Response

Success response

When the receipt is created, the API returns a success message.

Responsejson
{
    "message": "Receipt saved successfully",
    "data": null
}

Error response

When something goes wrong, the API returns an error message. This example is for a receipt number that was already used.

Error responsejson
{
    "errorMessages": null,
    "errorsList": null,
    "batchId": null,
    "errorCode": "409",
    "success": true,
    "valid": true,
    "errors": [
        {
            "code": "E-RCPT-409",
            "message": "RecieptNumber Random number -02 is already available with the status CREATED",
            "location": "receiptDataList[0].recieptNumber",
            "suggestion": "Use a different receipt number that hasn't been used before",
            "affectedFields": [
                "recieptNumber"
            ]
        }
    ],
    "metadata": {
        "validationTime": "2025-06-03T09:43:25.569727Z[UTC]",
        "totalErrors": 1
    }
}

Status codes

Status codeDescription
200Success: the request was processed.
202Accepted: the request was accepted and is still processing.

Notes

  • The x-api-key must be valid, or the request fails with an authentication error.
  • Check that all required fields are formatted correctly, especially dates and tax information.