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:
- 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.
- 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.
- 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
| Code | Examples | Acceptable Values |
|---|---|---|
| 01 | Invoice | INV |
| 02 | Credit Note | CRD |
API URLs
| Property | Value |
|---|---|
| Sandbox | https://malaysia-sandbox.complyance.io |
| Production | https://malaysia-prod.complyance.io/ |
| Endpoint | /createReciept |
| Method | POST |
Headers
| Header Name | Value | Description | Conditionality |
|---|---|---|---|
x-api-key | k4PW_J0s8DtBSdvYnadXn | API key to authorize the request | Mandatory |
Content-Type | application/json | Specifies that the request body is in JSON format | Optional |
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
| ObjectName | Field Name | Conditionality | Informatics | Field Max Length | Sample Value |
|---|---|---|---|---|---|
| receiptDataList | documentType | Mandatory | Identify the document type (e.g., INV, CRD, DBT, RFD, SLF_INV, SLF_CRD, SLF_DBT, SLF_REF.) | 3 to 7 | |
| receiptDataList | recieptNumber | Mandatory | Receipt reference number for internal tracking | 50 | test6 |
| receiptDataList | recieptIssuedate | Mandatory | Date of receipt issuance (must be current date) | 10 | 10 (format : yyyy-mm-dd) |
| receiptDataList | mobileNumber | Optional | Mobile number used for converting the receipt to an e-Invoice | 15 | +609390164128 |
| receiptDataList | originalEInvoiceReferenceNumber | Mandatory where applicable | LHDNM Unique Identifier Number of the original invoice/document that is being affected/adjusted. | 26 | |
| receiptDataList | documentIssueDate | Mandatory | Date of issuance of the e-Invoice (Note that the date must be the current date) | 10 (format: yyyy-mm-dd) | |
| receiptDataList | typeOfBuyer | Mandatory | typeOfBuyer: Specifies the type of buyer, either BUSINESS for business entities or INDIVIDUAL for personal customers. | ||
| receiptDataList | documentIssueTime | Mandatory | Time of issuance of the e-Invoice (Note that the time must be the UTC time) | 15 (format: hh:mm:ss) | |
| receiptDataList | currency | Mandatory | Specific currency that is used to represent the monetary value stated in the e-Invoice | 3 | |
| receiptDataList | sellerTinNumber | Mandatory | Supplier's TIN assigned by LHDNM | 14 | |
| receiptDataList | sellerRegistrationIdType | Mandatory | Supplier's Registration / Identification Number / Passport Number | ||
| receiptDataList | 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. | ||
| receiptDataList | supplierSstRegistrationNumber | Mandatory where applicable | SST 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 | |
| receiptDataList | supplierTourismTaxRegistrationNumber | Mandatory where applicable | Tourism tax registration number of the Supplier. Only applicable to registrants like hotel operators. Special characters allowed: dash (-). Input "NA" if not registered. | 17 | |
| receiptDataList | totalExcludingTax | Mandatory | Sum of amount payable, excluding taxes. Attach currencyID attribute to XML element. | ||
| receiptDataList | taxTotal | Mandatory | Total amount of tax payable | ||
| receiptDataList | documentTotal | Mandatory | Invoice Total Amount Including Tax | ||
| receiptDataList | totalPayableAmount | Mandatory | Sum of amount payable, inclusive of taxes and adjustments, excluding advance payments. Attach currencyID attribute to XML element. | ||
| receiptDataList | paymentMeans | Optional | Mechanism for funds transfer (e.g., cash, cheque, bank transfer, credit card, e-Wallet) | 2 |
Response Schema
| Parameter Name | Type | Length | Description |
|---|---|---|---|
| submissionUid | string | NA | The number generated by LHDN and serves as the official identifier for submissions. |
| documentUlid | string | The number generated on the compliance side for internal tracking purposes and is primarily useful for internal operations. | |
| uuid | string | Government acknowledgment number for the invoice triggered to LHDN. | |
| invoiceCodeNumber | string | Document 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": 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
}
}The API may return the following success responses depending on the validation result or submission status:
| Status Code | Description |
|---|---|
200 | Success – The request was processed successfully. |
202 | Accepted – The request has been accepted but is still processing. |
Notes
- Ensure the
x-api-keyis valid, or the request will fail with an authentication error. - Verify that all required fields are properly formatted, especially dates and tax information.