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
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 Endpoint

Method: POST
URL: https://malaysia.complyance.io/dev/createReciept


Headers

Header NameValueDescription
x-api-keyk4PW_J0s8DtBSdvYnadXnAPI key to authorize the request
Content-Typeapplication/jsonSpecifies that the request body is in JSON format

Request Body

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

[
{
"documentType": "INV",
"recieptNumber": "test6",
"recieptIssuedate": "2024-08-15",
"mobileNumber": "+609390164128",
"currency": "MYR",
"currencyExchangeRate": "1",
"invoiceFrequency": "MONTHLY",
"invoiceStartDate": "2024-08-19",
"invoiceEndDate": "2024-08-23",
"supplierId": "1",
"supplierName": "sellerName",
"sellerTinNumber": "C21540299050",
"sellerRegistrationIdType": "BRN",
"sellerRegistrationId": "BRN: 202001234567",
"supplierSstRegistrationNumber": "A01-2345-67891012",
"supplierTourismTaxRegistrationNumber": "123-4567-89012345",
"buyerId": "1",
"buyerTinNumber": "C21540299050",
"buyerSstRegistrationNumber": "234234234",
"totalExcludingTax": "1000",
"totalTaxableAmount": "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",
"roundingAmount": "0",
"paymentMeans": "1",
"paymentTerms": "1",
"sellerAddress": {
"addressLine1": "Lot 66",
"addressLine2": "Bangunan Merdeka",
"addressLine3": "Persiaran Jaya",
"postalCode": "50480",
"city": "Kuala Lumpur",
"state": "11",
"country": "MYS"
},
"supplierDetails": {
"organizationName": "Name of Supplier",
"email": "email@supplier.com",
"industryCode": "01111",
"industryDescription": "Growing of maize",
"phoneNumber": "\n+60-123456789"
},
"documentLineItems": [
{
"lineItemId": "1",
"commodityClassificationCode": "1",
"productTariffCode": "9800.00.0010",
"lineItemCountryOfOrigin": "GBR",
"description": "Laptop Peripherals",
"unitPrice": "100",
"lineItemMeasurement": "Kg",
"quantity": "10",
"lineItemSubtotal": "1000",
"discountPercent": "0",
"discountAmount": "0",
"chargePercent": "0",
"chargeAmount": "0",
"lineTotalExcludingTax": "1000",
"taxType": "1",
"taxPercentage": "6",
"totalTax": "60.00",
"taxExemptionReason": "Goods acquired with SST exemption under Sales Tax Act 2018. Reference No: (C01-2345-67890123)",
"amountExemptedFromTax": "0",
"lineItemTotal": "1000"
}
]
}
]

cURL Command

Command PartDescription
curl --locationSpecifies the URL and method (POST request).
'https://malaysia.complyance.io/dev/createReciept'API endpoint URL for receipt creation.
--header 'x-api-key: k4PW_J0s8DtBSdvYnadXn'Provides the API key for authentication.
--header 'Content-Type: application/json'Specifies that the content type is JSON.
--data '...'Sends the JSON body data as specified above.

Request Parameter Fields

Invoice Details

ObjectNameField NameConditionalityInformaticsField Max LengthSample Value
Invoice Details
documentTypee-Invoice Type CodeMandatoryIdentifies the document type (e.g., INV, CRD, DBT, RFD)2INV
recieptNumberReceipt Reference NumberMandatoryString: Receipt reference number used by Supplier for internal tracking purpose50test6
recieptIssuedateReceipt Issuance DateMandatoryString: Date of issuance of the receipt (Note that the date must be the current date)102024-08-15
mobileNumberMobile NumberMandatoryString: Mobile number used for converting the receipt to an e-Invoice15+609390164128
currencyInvoice Currency CodeMandatorySpecific currency that is used to represent the monetary value stated in the e-Invoice3MYR
currencyExchangeRateCurrency Exchange RateMandatoryThe exchange rate between the local currency and foreign currency101
invoiceFrequencyFrequency of BillingOptionalFrequency of the invoice (e.g., Daily, Weekly, Monthly)50Monthly
invoiceStartDateBilling Period Start DateOptionalStart date of the transaction102024-08-19
invoiceEndDateBilling Period End DateOptionalEnd date of the transaction interval102024-08-23

Supplier Details

ObjectNameField NameConditionalityInformaticsField Max LengthSample Value
Supplier Details
supplierIdSupplier IDMandatoryIdentification Number of a Specific Supplier in an Invoice201
supplierNameSupplier’s NameMandatoryName of business or individual who will be the issuer of the e-Invoice in a commercial transaction300sellerName
sellerTinNumberSupplier’s TINMandatorySupplier’s (i.e., issuer’s) TIN assigned by IRBM14C21540299050
sellerRegistrationIdTypeSupplier’s Registration scheme IDMandatoryBusiness registration number / MyKad / Passport number depending on entity12BRN
sellerRegistrationIdSupplier’s Registration NumberMandatorySupplier’s business registration or identification number20BRN: 202001234567
supplierSstRegistrationNumberSST Registration NumberMandatorySales tax / service tax (SST) registration number of the Supplier20A01-2345-67891012
supplierTourismTaxRegistrationNumberTourism Tax Registration NumberOptionalTourism tax registration number of the Supplier20123-4567-89012345
supplierDetails.organizationNameSupplier’s NameMandatoryOrganization name of the supplier300Name of Supplier
supplierDetails.emailSupplier’s e-mailOptionalE-mail address of the Supplier320email@supplier.com
supplierDetails.industryCodeSupplier’s MSIC CodeMandatory5-digit numeric code representing the Supplier’s business nature and activity501111
supplierDetails.industryDescriptionSupplier’s Business Activity DescriptionMandatoryDescription of the Supplier’s business activity300Growing of maize
supplierDetails.phoneNumberSupplier’s Contact NumberMandatoryThe telephone number of the Supplier15+60-123456789

Supplier’s Address

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

Buyer Details

ObjectNameField NameConditionalityInformaticsField Max LengthSample Value
Buyer Details
buyerIdBuyer IDMandatoryIdentification Number of a Specific Buyer in an Invoice201
buyerTinNumberBuyer’s TINMandatoryBuyer’s TIN assigned by IRBM14C21540299050
buyerSstRegistrationNumberBuyer’s SST Registration NumberMandatorySST registration number of the Buyer20234234234

Invoice Line Item

ObjectNameField NameConditionalityInformaticsField Max LengthSample Value
documentLineItems.lineItemIdLine IDMandatoryIdentification of a Specific Line in an Invoice201
documentLineItems.commodityClassificationCodeClassificationMandatoryCategory of products or services being billed31
documentLineItems.productTariffCodeTariff CodeMandatoryProduct or service classification code based on tariff9800.00.0010
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 service100
documentLineItems.quantityQuantityMandatoryNumber of units of a product or service10
documentLineItems.lineItemSubtotalSubtotalMandatoryAmount of each individual item, excluding any taxes or charges1000
documentLineItems.taxTypeTax TypeMandatoryType of taxes that will be applicable21
documentLineItems.taxPercentageTax RateMandatoryThe appropriate tax rate that is applicable6
documentLineItems.totalTaxTax AmountMandatoryThe amount of tax payable60
documentLineItems.taxExemptionReasonTax Exemption ReasonOptionalDescription of tax exemption applicable300Goods acquired with SST exemption
documentLineItems.amountExemptedFromTaxAmount Exempted from TaxOptionalTotal amount of tax exempted0

Response

Success Response

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

{
"message": "Receipt saved successfully"
}

Sample Error Response

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

{
"errorsList": [
{
"errors": [
{
"invoiceDataList[0]-sellerTinNumber": "sellerTinNumber should not Exceed 14 digits ex:'A04512299050'"
},
{
"invoiceDataList[0]-currency": "currency cannot be empty"
},
{
"invoiceDataList[0]-recieptIssuedate": "recieptIssuedate cannot be empty"
},
{
"invoiceDataList[0]-invoiceEndDate": "InvoiceEndDate should be after to invoiceStartDate"
},
{
"invoiceDataList[0]-buyerTinNumber": "buyerTinNumber should not Exceed 14 digits ex:'A04512299050'"
}
]
}
]
}

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.