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 |
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 |
- Shell
- Javascript
- Ruby
- Python
- PHP
- Java
- Go
curl --location 'https://malaysia-prod.complyance.io/createReciept \
--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/createReciept', {
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/createReciept', {}, headers
puts response.body
import requests
headers = {
'x-api-key': 'k4PW_J0s8DtBSdvYnadXn',
'Content-Type': 'application/json'
}
response = requests.post('https://malaysia-prod.complyance.io/createReciept', 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/createReciept', [
'headers' => $headers
]);
echo $response->getBody()->getContents();
?>
URL url = new URL("https://malaysia-prod.complyance.io/createReciept");
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/createReciept", 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()
}
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 | documentId | Mandatory | Document reference number used by Supplier for internal tracking purpose | 50 | |
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 | invoiceStartDate | Optional | Start date of the transaction interval | 10 (format: yyyy-mm-dd) | |
receiptDataList | invoiceEndDate | Optional | End date of the transaction interval | 10 (format: yyyy-mm-dd) | |
receiptDataList | invoiceFrequency | Optional | Frequency of the invoice (e.g., Daily, Weekly, Biweekly, Monthly, Bimonthly, Quarterly, Half-yearly, Yearly, Others / Not Applicable) | 50 | |
receiptDataList | supplierId | Optional | Identification Number of a Specific Supplier in an Invoice | 20 | |
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 | buyerId | Optional | Identification Number of a Specific Buyer in an Invoice | ||
receiptDataList | buyerTinNumber | Mandatory | Buyer’s TIN assigned by LHDNM | 14 | |
receiptDataList | buyerRegistrationIdType | Mandatory | Buyer’s Registration / Identification Number / Passport Number | ||
receiptDataList | buyerSstRegistrationNumber | Mandatory | SST registration number of the Buyer. Input “NA” if unavailable or not provided. | ||
receiptDataList | isShippingAndBuyerAddressSame | Mandatory | Indicates whether the shipping and buyer address are the same | Boolean value | |
receiptDataList | shippingRecipientName | Mandatory where applicable | Name of shipping recipient of the products included in the e-Invoice | 300 | |
receiptDataList | shippingRecipientTin | Mandatory where applicable | TIN of the shipping recipient assigned by LHDNM | 14 | |
receiptDataList | shippingRecipientRegistrationType | Mandatory where applicable | Supplier’s Registration / Identification Number / Passport Number | ||
receiptDataList | shippingRecipientRegistrationNumber | Mandatory where applicable | SST registration number of the Buyer. Not applicable to non-SST-registered Buyers. Input “NA” if unavailable or not provided. | ||
receiptDataList | invoiceAdditionalDiscountAmount | Mandatory where applicable | Amount deducted from the original price of a product or service. Attach currencyID attribute to XML element. | ||
receiptDataList | invoiceAdditionalChargeAmount | Mandatory where applicable | Charge associated with the product or service imposed before tax. Attach currencyID attribute to XML element. | ||
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 | invoiceAmountExemptedFromTax | Mandatory where applicable | Total tax-exempt amount for sales/service tax purposes. | ||
receiptDataList | invoiceTaxExemptionReason | Mandatory where applicable | Description of tax exemption on the invoice level. Limited special characters: period (.), dash (-), comma (,), parenthesis (). | ||
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 | |
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 |
Supplier Details
ObjectName | Field Name | Conditionality | Informatics | Field Max Length | Sample Value |
---|---|---|---|---|---|
supplierDetails | organizationName | Mandatory | Name of business or individual who will be the supplier providing the goods / services in a commercial transaction. | 300 | |
supplierDetails | Optional | E-mail address of the Supplier (Following the email standards (RFC 5321 and RFC 5322)). | 320 | ||
supplierDetails | industryCode | Mandatory | 5-digit numeric code that represents the Supplier’s business nature and activity | 5 | |
supplierDetails | industryDescription | Mandatory | Description of the Supplier’s business activity | 300 | |
supplierDetails | phoneNumber | Mandatory | The telephone number of the Supplier (e.g., office, mobile, fax) | 20 |
buyerDetails
ObjectName | Field Name | Conditionality | Informatics | Field Max Length | Sample Value |
---|---|---|---|---|---|
buyerDetails | organizationName | Optional | Name of business or individual who will be the supplier providing the goods / services in a commercial transaction. | 300 | |
buyerDetails | Optional | E-mail address of the Supplier (Following the email standards (RFC 5321 and RFC 5322)). | 320 | ||
buyerDetails | phoneNumber | Optional | The telephone number of the Supplier (e.g., office, mobile, fax) | 20 |
Seller's Address
ObjectName | Field Name | Conditionality | Informatics | Field Max Length | Sample Value |
---|---|---|---|---|---|
sellerAddress | addressLine1 | Mandatory | This 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 | |
sellerAddress | addressLine2 | Optional | An additional address line in an address that can be used to give further details supplementing the main line. | 150 | |
sellerAddress | addressLine3 | Optional | An additional address line in an address that can be used to give further details supplementing the main line. | 150 | |
sellerAddress | postalCode | Optional | The identifier for an addressable group of properties according to the relevant postal service. | 50 | |
sellerAddress | city | Mandatory | The common name of the city, town or village, where the Supplier, Buyer and Shipping Recipient address is located. | 50 | |
sellerAddress | state | Mandatory | The state of a country. | 50 | |
sellerAddress | country | Mandatory | A code that identifies the country. | 3 |
Buyer’s Address
ObjectName | Field Name | Conditionality | Informatics | Field Max Length | Sample Value |
---|---|---|---|---|---|
buyerAddress.addressLine1 | Address Line 1 | Mandatory | The main address line in an address structure. Input "NA" if unavailable | 150 | Lot 66 |
buyerAddress.addressLine2 | Address Line 2 | Optional | An additional address line for further details | 150 | Bangunan Merdeka |
buyerAddress.addressLine3 | Address Line 3 | Optional | An additional address line for further details | 150 | Persiaran Jaya |
buyerAddress.postalCode | Postal Zone | Optional | The identifier for a postal zone | 50 | 50480 |
buyerAddress.city | City Name | Mandatory | The common name of the city | 50 | Kuala Lumpur |
buyerAddress.state | State | Mandatory | The state of a country | 50 | 14 |
buyerAddress.country | Country | Mandatory | A code identifying the country | 3 | MYS |
Shipping Details
ObjectName | Field Name | Conditionality | Informatics | Field Max Length | Sample Value |
---|---|---|---|---|---|
shippingRecipientAddress | addressLine1 | Mandatory where applicable | This 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 | |
shippingRecipientAddress | addressLine2 | Optional | An additional address line in an address that can be used to give further details supplementing the main line. | 150 | |
shippingRecipientAddress | addressLine3 | Optional | An additional address line in an address that can be used to give further details supplementing the main line. | 150 | |
shippingRecipientAddress | postalCode | Optional | The identifier for an addressable group of properties according to the relevant postal service. | 50 | |
shippingRecipientAddress | city | Mandatory where applicable | The common name of the city, town or village, where the Supplier, Buyer and Shipping Recipient address is located. | 50 | |
shippingRecipientAddress | state | Mandatory where applicable | The state of a country. | 50 | |
shippingRecipientAddress | country | Mandatory where applicable | A code that identifies the country. | 3 |
Invoice Line Item
ObjectName | Field Name | Conditionality | Informatics | Field Max Length | Sample Value |
---|---|---|---|---|---|
documentLineItems.lineItemId | Line ID | Optional | Identification of a Specific Line in an Invoice | 20 | 1 |
documentLineItems.commodityClassificationCode | Classification | Mandatory | Category of products or services being billed | 3 | 1 |
documentLineItems.description | Description of Product or Service | Mandatory | Details of products or services being billed | 300 | Laptop Peripherals |
documentLineItems.unitPrice | Unit Price | Mandatory | Price assigned to a single unit of a product or service | 4 | |
documentLineItems.quantity | Quantity | Optional | Number of units of a product or service | 1 | |
documentLineItems.lineItemSubtotal | Subtotal | Mandatory | Amount of each individual item, excluding any taxes or charges | 100 | |
documentLineItems.lineTotalExcludingTax | Total Excluding Tax | Mandatory | Sum of amount payable excluding any applicable taxes | 1436.5 | |
documentLineItems.taxType | Tax Type | Mandatory | Type of taxes that will be applicable | 2 | 1 |
documentLineItems.taxPercentage | Tax Rate | Mandatory | The appropriate tax rate that is applicable | 6 | |
documentLineItems.totalTax | Tax Amount | Mandatory | The amount of tax payable | 292.2 | |
documentLineItems.taxCode | Details of Tax Exemption | Optional | Description of tax exemption applicable | 300 | SST exemption |
documentLineItems.taxExemptionReason | Amount Exempted from Tax | Conditional Mandatory | Total amount of tax exempted for SST purposes | 1460.5 | |
documentLineItems.chargeAmount | Charge Amount | Optional | Charge associated with the product or service imposed after tax | 1000 | |
documentLineItems.discountAmount | Discount Amount | Optional | Amount deducted from the original price of a product | 1000 | |
documentLineItems.lineItemTotal | lineItemTotal | Mandatory | Sum of amount payable inclusive of total taxes chargeable | 1060 | |
invoiceAdditionalChargeAmount | Optional | Additional Charges at Invoice Level | |||
invoiceAdditionalDiscountAmount | Optional | Additional Discount at Invoice Level | |||
invoiceAmountExemptedFromTax | Amount Exempted from Tax | Mandatory if tax exemption is applicable | Total amount of tax exempted for sales tax or service tax purposes. Please add currencyID attribute to the XML element. | 10 | |
invoiceTaxExemptionReason | TaxExemptionReason | Mandatory if tax exemption is 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.). | Goods acquired with SST exemption under Sales Tax Act 2018. Reference No: ABC.TAX(S)012-3/4/56(7) | |
paymentMeans | PaymentMeansCode | 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.) | 1 | |
invoiceAdditionalDiscountAmount | Discount Amount | Optional | Additional Charges at Invoice Level | 1000 | |
totalExcludingTax | Total Excluding Tax | Mandatory | Sum of amount payable excluding any applicable taxes | 1436.5 | |
taxTotal | Total Tax Amount | Mandatory | Total amount of tax payable | 1234 | |
documentTotal | Invoice Total Amount Including Tax | Mandatory | Sum of amount payable inclusive of total taxes chargeable | 1436.5 | |
totalPayableAmount | Total Payable Amount | Mandatory | Sum of amount payable excluding any amount paid in advance and rounding | 1436.5 |
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": {
"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 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-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.