Skip to main content

Create Receipt

The "Create Receipt" process is designed for scenarios where generating an individual invoice for every transaction is not feasible, such as in B2C (Business-to-Consumer) transactions. This is particularly applicable to businesses like supermarkets, retail stores, or any high-volume consumer-facing business where numerous transactions occur daily.

In a typical B2C flow, individual consumers make frequent, small-scale purchases, often without the need for a detailed e-invoice to be generated at the point of sale. For example, in a supermarket, thousands of customers may purchase items daily. Generating an individual e-invoice for every single transaction would be cumbersome and inefficient.

Instead, you can simply issue receipts to customers during the day to document their purchases. These receipts serve as proof of transaction for the customer, without needing to send each one to the tax authorities immediately.

At the end of the day (or a specified period), the receipts are consolidated, and you can generate a single e-invoice summarizing all the transactions made during that period. This e-invoice is then sent to the government or relevant tax authorities to fulfill compliance requirements.

Key Benefits of This Approach:

  1. Efficiency: You don’t need to generate and submit an e-invoice for every individual B2C transaction. Instead, receipts are created instantly, while the e-invoice can be generated in bulk later.
  2. Compliance: At the end of each day (or another specified interval), a consolidated e-invoice ensures that the business meets legal requirements without overwhelming the system with each transaction.
  3. Customer Satisfaction: Receipts are generated quickly for customers at checkout, ensuring a smooth transaction process, while the business remains compliant with e-invoicing regulations.

This flow is particularly useful for businesses with a high volume of low-value transactions, as it simplifies operations while still ensuring proper tax reporting and compliance.

This API allows you to create a receipt by sending the required data in JSON format using a POST request. Below is the detailed documentation of the API endpoint and how to use the cURL command.


e-Invoice Types

CodeExamplesAcceptable Values
01InvoiceINV

API URLs

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

Headers

Header NameValueDescriptionConditionality
x-api-keyk4PW_J0s8DtBSdvYnadXnAPI key to authorize the requestMandatory
Content-Typeapplication/jsonSpecifies that the request body is in JSON formatOptional

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

Request Body

The request body should be sent as a JSON array containing receipt information. Below is the structure of the JSON data:

{
"receiptDataList": [
{
"documentType": "INV",
"recieptNumber": "{{random number}}",
"mobileNumber": "7860720590",
"originalEInvoiceReferenceNumber": "",
"recieptIssueDate": "2025-01-07",
"documentIssueTime": "22:30:00Z",
"typeOfBuyer": "BUSINESS",
"currency": "MYR",
"currencyExchangeRate": "",
"supplierId": "",
"sellerTinNumber": "C58794843040",
"sellerRegistrationIdType": "BRN",
"sellerRegistrationId": "198801006871",
"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": "mohit",
"email": "email@supplier.com",
"industryCode": "01111",
"industryDescription": "Growing of maize",
"phoneNumber": "60123456789"
},
"buyerDetails": {
"organizationName": "",
"email": "",
"phoneNumber": ""
},
"documentLineItems": [
{
"lineItemId": "1",
"commodityClassificationCode": "10",
"description": "BOP JETTING SUB, SLEEVE, 8\", REV E, BJS-8000-002 (BJS-8000-002-E)",
"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 Parameter Fields

Receipt Details

ObjectNameField NameConditionalityInformaticsField Max LengthSample Value
receiptDataListdocumentTypeMandatoryIdentify the document type (e.g., INV, CRD, DBT, RFD, SLF_INV, SLF_CRD, SLF_DBT, SLF_REF.)3 to 7
receiptDataListdocumentIdMandatoryDocument reference number used by Supplier for internal tracking purpose50
receiptDataListoriginalEInvoiceReferenceNumberMandatory where applicableLHDNM Unique Identifier Number of the original invoice/document that is being affected/adjusted.26
receiptDataListdocumentIssueDateMandatoryDate of issuance of the e-Invoice (Note that the date must be the current date)10 (format: yyyy-mm-dd)
receiptDataListtypeOfBuyerMandatorytypeOfBuyer: Specifies the type of buyer, either BUSINESS for business entities or INDIVIDUAL for personal customers.
receiptDataListdocumentIssueTimeMandatoryTime of issuance of the e-Invoice (Note that the time must be the UTC time)15 (format: hh:mm:ss)
receiptDataListcurrencyMandatorySpecific currency that is used to represent the monetary value stated in the e-Invoice3
receiptDataListinvoiceStartDateOptionalStart date of the transaction interval10 (format: yyyy-mm-dd)
receiptDataListinvoiceEndDateOptionalEnd date of the transaction interval10 (format: yyyy-mm-dd)
receiptDataListinvoiceFrequencyOptionalFrequency of the invoice (e.g., Daily, Weekly, Biweekly, Monthly, Bimonthly, Quarterly, Half-yearly, Yearly, Others / Not Applicable)50
receiptDataListsupplierIdOptionalIdentification Number of a Specific Supplier in an Invoice20
receiptDataListsellerTinNumberMandatorySupplier’s TIN assigned by LHDNM14
receiptDataListsellerRegistrationIdTypeMandatorySupplier’s Registration / Identification Number / Passport Number
receiptDataListsellerRegistrationIdMandatoryFor 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.
receiptDataListsupplierSstRegistrationNumberMandatory where applicableSST registration number of the Supplier. Not applicable to non-SST-registered suppliers. Special characters allowed: dash (-) and semicolon (;). Maximum 2 SST numbers separated by a semicolon. Input “NA” if not SST-registered.35
receiptDataListsupplierTourismTaxRegistrationNumberMandatory where applicableTourism tax registration number of the Supplier. Only applicable to registrants like hotel operators. Special characters allowed: dash (-). Input “NA” if not registered.17
receiptDataListbuyerIdOptionalIdentification Number of a Specific Buyer in an Invoice
receiptDataListbuyerTinNumberMandatoryBuyer’s TIN assigned by LHDNM14
receiptDataListbuyerRegistrationIdTypeMandatoryBuyer’s Registration / Identification Number / Passport Number
receiptDataListbuyerSstRegistrationNumberMandatorySST registration number of the Buyer. Input “NA” if unavailable or not provided.
receiptDataListisShippingAndBuyerAddressSameMandatoryIndicates whether the shipping and buyer address are the sameBoolean value
receiptDataListshippingRecipientNameMandatory where applicableName of shipping recipient of the products included in the e-Invoice300
receiptDataListshippingRecipientTinMandatory where applicableTIN of the shipping recipient assigned by LHDNM14
receiptDataListshippingRecipientRegistrationTypeMandatory where applicableSupplier’s Registration / Identification Number / Passport Number
receiptDataListshippingRecipientRegistrationNumberMandatory where applicableSST registration number of the Buyer. Not applicable to non-SST-registered Buyers. Input “NA” if unavailable or not provided.
receiptDataListinvoiceAdditionalDiscountAmountMandatory where applicableAmount deducted from the original price of a product or service. Attach currencyID attribute to XML element.
receiptDataListinvoiceAdditionalChargeAmountMandatory where applicableCharge associated with the product or service imposed before tax. Attach currencyID attribute to XML element.
receiptDataListtotalExcludingTaxMandatorySum of amount payable, excluding taxes. Attach currencyID attribute to XML element.
receiptDataListtaxTotalMandatoryTotal amount of tax payable
receiptDataListdocumentTotalMandatoryInvoice Total Amount Including Tax
receiptDataListinvoiceAmountExemptedFromTaxMandatory where applicableTotal tax-exempt amount for sales/service tax purposes.
receiptDataListinvoiceTaxExemptionReasonMandatory where applicableDescription of tax exemption on the invoice level. Limited special characters: period (.), dash (-), comma (,), parenthesis ().
receiptDataListtotalPayableAmountMandatorySum of amount payable, inclusive of taxes and adjustments, excluding advance payments. Attach currencyID attribute to XML element.
receiptDataListpaymentMeansOptionalMechanism for funds transfer (e.g., cash, cheque, bank transfer, credit card, e-Wallet)2
receiptDataListrecieptNumberMandatoryReceipt reference number for internal tracking50test6
receiptDataListrecieptIssuedateMandatoryDate of receipt issuance (must be current date)1010 (format : yyyy-mm-dd)
receiptDataListmobileNumberOptionalMobile number used for converting the receipt to an e-Invoice15+609390164128

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

buyerDetails

ObjectNameField NameConditionalityInformaticsField Max LengthSample Value
buyerDetailsorganizationNameOptionalName of business or individual who will be the supplier providing the goods / services in a commercial transaction.300
buyerDetailsemailOptionalE-mail address of the Supplier (Following the email standards (RFC 5321 and RFC 5322)).320
buyerDetailsphoneNumberOptionalThe 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.

Response

Success Response

Upon successful receipt creation, the API will return a success message along with the receipt details.

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

Sample Error Response

In case of any errors, the API will return an appropriate error message.

{
"errorMessages": {
"0": {
"receiptDataList[0]-supplierDetails-phoneNumber": "supplier's mobile number is mandatory- Please provide a valid mobile number",
"receiptDataList[0]-lineItems[0]-description": "Line item description cannot be empty",
"receiptDataList[0]-documentTotal": "documentTotal cannot be empty",
"receiptDataList[0]-lineItems[0]-lineItemTotal": "Line item total cannot be null",
"receiptDataList[0]-totalPayableAmount": "totalPayableAmount cannot be empty"
}
},
"batchId": null,
"errorCode": null
}

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.


Notes

  • Ensure the x-api-key is valid, or the request will fail with an authentication error.
  • Verify that all required fields are properly formatted, especially dates and tax information.