- BeaconX e-Invoice API Documentation
- API Endpoints
- B2B e-Invoicing
- B2C Receipt
- TaxPayer
- Lists
- Articles
Create Document(s)
POST
/einvoices/create
LHDN
1.
2.
3.
Request
Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.Example:
Authorization: Bearer ********************
Body Params application/json
array of:
supplier
object (Supplier)
optional
code
string
required
name
string
required
tin
string
required
EI0000000020 - for foreign (non Malaysian) buyers
EI0000000030 - for foreign (non Malaysian) suppliers
EI0000000040 - for buyers that belong to categories of Government, Authorities, Statutories or exempt institutions without TIN
id_type
string
required
id_number
string
required
email
string
required
phone
string
required
address1
string
required
address2
string
required
address3
string
required
city
string
required
postcode
string
required
state
string
required
country
string
required
sst_number
string
required
ttx_number
string
required
msic1
string
required
msic1_desc
string
required
is_foreign
string
required
buyer
object (Buyer)
required
is_foreign
boolean
deprecated
Default:
false
email
string
required
tin
string | null
required
name
string | null
required
id_type
string | null
required
id_number
string | null
required
phone
string
required
address1
string | null
optional
address2
string
required
state
string
required
country
string
required
city
string
required
postcode
string
required
address 3
string
required
sst_number
string
required
code
string
required
Default:
gen_random_uuid()
membership_id
string
required
shipping
object (Shipping)
required
code
string
required
id_type
string
required
tin
string
required
id_number
string
required
name
string
required
email
string
required
address1
string
required
address2
string
required
address3
string
required
city
string
required
postcode
string
required
state
string
required
01 Johor
02 Kedah
03 Kelantan
04 Melaka
05 Negeri Sembilan
06 Pahang
07 Pulau Pinang
08 Perak
09 Perlis
10 Selangor
11 Terengganu
12 Sabah
13 Sarawak
14 Wilayah Persekutuan Kuala Lumpur
15 Wilayah Persekutuan Labuan
16 Wilayah Persekutuan Putrajaya
17 Not Applicable
country
string
required
annex
object
required
custom_form_number
string
required
incoterms
string
required
fta
string
required
certified_exporter_number
string
required
custom_k2_number
string
required
other_charges_description
string
required
other_charges_amount
string
required
status
string
required
source
string
required
Label for source system name, only used for internal record purpose. Defaults to "ERP".
type
string
required
02 Credit Note
03 Debit Note
04 Refund Note
11 Self-billed Invoice
12 Self-billed Credit Note
13 Self-billed Debit Note
14 Self-billed Refund Note
reference_number
string
required
invoice_number
string
required
original_einvoice_ref_number
string
required
When issuing CN / DN / RN, reference to the original document number is supported. Use comma to separate multiple Invoice Numbers.
original_einvoice_inv_number
string
optional
Used when printing in CN/DN/RN. If filled, PDF printout will display this instead of original_einvoice_ref_number.
po_number
string
required
Purchase Order (PO) Number for internal record purpose.
pos_id
string
required
Point of Sale (POS) Terminal ID. Optional
created_at
string
required
Date / Time document was created in source system.
issued_at
string
required
outlet_code
string
required
dept_code
string
required
system_company_name
string
optional
system_company_id
string
optional
outlet_id
string
optional
dept_id
string
optional
job_type
string
optional
currency_code
string
required
currency_rate
number
required
frequency
string
required
Frequency of Billing Period.
billing_period_start
string
required
Billing period start date. Format YYYY-MM-DD.
billing_period_end
string
required
Billing period end date. Format YYYY-MM-DD.
subtotal
number
required
discount_rate
number
deprecated
discount_amount
number
required
service_fee_rate
number
deprecated
service_fee_amount
number
required
total_excl_tax
number
required
sales_tax_amount
number
required
service_tax_amount
number
required
gst_amount
number
required
ttx_amount
number
required
hvgt_amount
number
required
lvst_amount
number
required
total_tax_amount
number
required
total_incl_tax
number
required
rounding
number
required
total_payable_amount
number
required
payment_mode
string
required
Applicable for retail purchases.
02 Cheque
03 Bank Transfer
04 Credit Card
05 Debit Card
06 e-Wallet / Digital Wallet
07 Digital Bank
08 Others
suppliers_bank_account_number
string
required
Supplier's Bank Account Number that facilitates payment, where applicable.
payment_terms
string
required
An agreed-upon payment terms and conditions. e.g. "Cash Upfront"
prepayment_amount
number
required
Amount paid upfront. Default to 0
prepayment_datetime
string
required
Date/Time of amount paid upfront.
prepayment_reference_number
string
required
Transaction reference number of prepayment.
bill_reference_number
string
required
Bill reference number.
footer_notes
string
optional
Invoice footer notes to be included in invoice for PDF printout
so_number
string
optional
Sales Order number for internal reference - Used in PDF printout
do_number
string
optional
Delivery Order number for internal reference - Used in PDF printout
template
string
optional
Template name of the invoice format. - Used for PDF printout. Defaults to "default".
created_by
string
required
The email address of the user to be informed when validation error occurs.
items
array [object {34}]
required
id
string
required
classification
string
required
product_tariff_code
string
required
For export/import of goods, HS Code to be filled.
code
string
required
Product/item/service code for internal reference.
description
string
required
long_description
string
required
To be used in PDF printout template
quantity
number
required
measurement
string
required
unit_price
number
required
subtotal
number
required
discount_rate
number
required
discount_amount
number
required
service_fee_rate
number
required
service_fee_amount
number
required
total_excl_tax
number
required
sales_tax_rate
number
required
sales_tax_amount
number
required
service_tax_rate
number
required
service_tax_amount
number
required
gst_rate
number
required
gst_amount
number
required
ttx_rate
number
required
ttx_amount
number
required
hvgt_rate
number
required
hvgt_amount
number
required
lvst_rate
number
required
lvst_amount
number
required
total_tax_amount
number
required
total_incl_tax
number
required
details_tax_exemption
string
required
Details related to tax exemption
tax_exempt_amount
number
required
country_of_origin
string
required
For import/export of goods, specify the country of origin
total_sales
number
optional
commission_rate
number
optional
Example
{
"supplier": {
"code": "",
"id_type": "BRN",
"tin": "C0123456789",
"id_number": "201900000000",
"name": "BEACON SYSTEMS SDN BHD",
"email": "info@beaconx.com.my",
"address1": "1, Jalan Beacon",
"address2": "",
"address3": "",
"city": "Kuala Lumpur",
"postcode": "57000",
"state": "14",
"country": "MYS",
"sst_number": "NA",
"ttx_number": "",
"phone": "",
"msic1": "00000",
"msic1_desc": "NOT APPLICABLE",
"is_foreign": "true"
},
"buyer": {
"code": "",
"id_type": "BRN",
"tin": "C61901366810",
"id_number": "201903007118",
"name": "MY COMPANY SDN BHD",
"email": "kendall.purdy@reilly.net",
"address1": "72684 Murl Light Apt. 668",
"address2": "",
"address3": "",
"city": "Lake Tedfort",
"postcode": "29311",
"state": "01",
"country": "MYS",
"sst_number": "W10-1060-26389071",
"phone": "0125168978",
"membership_id": "",
"is_foreign": "false"
},
"shipping": {
"code": "",
"id_type": "",
"tin": "",
"id_number": "",
"name": "",
"email": "",
"address1": "",
"address2": "",
"address3": "",
"city": "",
"postcode": "",
"state": "",
"country": "MYS"
},
"annex": {
"custom_form_number": "",
"incoterms": "",
"fta": "",
"certified_exporter_number": "",
"custom_k2_number": "",
"other_charges_description": "",
"other_charges_amount": ""
},
"status": "valid",
"source": "ERP",
"type": "01",
"reference_number": "INV/6990761",
"invoice_number": "INV/6990761",
"original_einvoice_ref_number": "",
"original_einvoice_inv_number": "",
"po_number": "PO/8555",
"pos_id": "",
"created_at": "",
"issued_at": "2024-10-21",
"posted_at": "2024-10-23",
"system_company_name": "",
"system_company_id": "",
"outlet_id": "",
"outlet_code": "HQ",
"dept_id": "",
"dept_code": "",
"job_type": "",
"created_by": "user@beaconx.com.my",
"currency_code": "MYR",
"currency_rate": 1,
"frequency": "",
"billing_period_start": "",
"billing_period_end": "",
"subtotal": 447.92,
"discount_rate": 0,
"discount_amount": 0,
"total_excl_tax": 447.92,
"sales_tax_amount": 0,
"service_tax_amount": 0,
"gst_amount": 0,
"ttx_amount": 0,
"hvgt_amount": 0,
"lvst_amount": 0,
"exempt_amount": 0,
"total_tax_amount": 0,
"total_incl_tax": 200,
"service_fee_rate": 0,
"service_fee_amount": 0,
"rounding": 0,
"total_payable_amount": 200,
"payment_mode": "",
"suppliers_bank_account_number": "",
"payment_terms": "",
"prepayment_amount": "",
"prepayment_datetime": "",
"prepayment_reference_number": "",
"bill_reference_number": "",
"footer_notes": "",
"so_number": "",
"do_number": "",
"template": "",
"items": [
{
"details_tax_exemption": "",
"tax_exempt_amount": 0,
"id": "1",
"classification": "022",
"product_tariff_code": "",
"code": "",
"description": "1-3000",
"long_description": "",
"quantity": 1,
"measurement": "EA",
"unit_price": 100,
"subtotal": 100,
"discount_rate": 0,
"discount_amount": 0,
"service_fee_rate": 0,
"service_fee_amount": 0,
"total_excl_tax": 100,
"sales_tax_rate": 0,
"sales_tax_amount": 0,
"service_tax_rate": 0,
"service_tax_amount": 0,
"gst_rate": 0,
"gst_amount": 0,
"ttx_rate": 0,
"ttx_amount": 0,
"hvgt_rate": 0,
"hvgt_amount": 0,
"lvst_rate": 0,
"lvst_amount": 0,
"total_incl_tax": 100,
"country_of_origin": "",
"total_sales": "",
"commission_rate": ""
},
{
"details_tax_exemption": "",
"tax_exempt_amount": 0,
"id": "2",
"classification": "022",
"product_tariff_code": "",
"code": "",
"description": "1-4000",
"long_description": "",
"quantity": 1,
"measurement": "EA",
"unit_price": 100,
"subtotal": 100,
"discount_rate": 0,
"discount_amount": 0,
"service_fee_rate": 0,
"service_fee_amount": 0,
"total_excl_tax": 100,
"sales_tax_rate": 0,
"sales_tax_amount": 0,
"service_tax_rate": 0,
"service_tax_amount": 0,
"gst_rate": 0,
"gst_amount": 0,
"ttx_rate": 0,
"ttx_amount": 0,
"hvgt_rate": 0,
"hvgt_amount": 0,
"lvst_rate": 0,
"lvst_amount": 0,
"total_incl_tax": 100,
"country_of_origin": "",
"total_sales": "",
"commission_rate": ""
}
]
}
Request samples
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://einvoice-api.beaconx.com.my/einvoices/create' \
--header 'Content-Type: application/json' \
--data-raw '{
"supplier": {
"code": "",
"id_type": "BRN",
"tin": "C0123456789",
"id_number": "201900000000",
"name": "BEACON SYSTEMS SDN BHD",
"email": "info@beaconx.com.my",
"address1": "1, Jalan Beacon",
"address2": "",
"address3": "",
"city": "Kuala Lumpur",
"postcode": "57000",
"state": "14",
"country": "MYS",
"sst_number": "NA",
"ttx_number": "",
"phone": "",
"msic1": "00000",
"msic1_desc": "NOT APPLICABLE",
"is_foreign": "true"
},
"buyer": {
"code": "",
"id_type": "BRN",
"tin": "C61901366810",
"id_number": "201903007118",
"name": "MY COMPANY SDN BHD",
"email": "kendall.purdy@reilly.net",
"address1": "72684 Murl Light Apt. 668",
"address2": "",
"address3": "",
"city": "Lake Tedfort",
"postcode": "29311",
"state": "01",
"country": "MYS",
"sst_number": "W10-1060-26389071",
"phone": "0125168978",
"membership_id": "",
"is_foreign": "false"
},
"shipping": {
"code": "",
"id_type": "",
"tin": "",
"id_number": "",
"name": "",
"email": "",
"address1": "",
"address2": "",
"address3": "",
"city": "",
"postcode": "",
"state": "",
"country": "MYS"
},
"annex": {
"custom_form_number": "",
"incoterms": "",
"fta": "",
"certified_exporter_number": "",
"custom_k2_number": "",
"other_charges_description": "",
"other_charges_amount": ""
},
"status": "valid",
"source": "ERP",
"type": "01",
"reference_number": "INV/6990761",
"invoice_number": "INV/6990761",
"original_einvoice_ref_number": "",
"original_einvoice_inv_number": "",
"po_number": "PO/8555",
"pos_id": "",
"created_at": "",
"issued_at": "2024-10-21",
"posted_at": "2024-10-23",
"system_company_name": "",
"system_company_id": "",
"outlet_id": "",
"outlet_code": "HQ",
"dept_id": "",
"dept_code": "",
"job_type": "",
"created_by": "user@beaconx.com.my",
"currency_code": "MYR",
"currency_rate": 1,
"frequency": "",
"billing_period_start": "",
"billing_period_end": "",
"subtotal": 447.92,
"discount_rate": 0,
"discount_amount": 0,
"total_excl_tax": 447.92,
"sales_tax_amount": 0,
"service_tax_amount": 0.00,
"gst_amount": 0,
"ttx_amount": 0,
"hvgt_amount": 0,
"lvst_amount": 0,
"exempt_amount": 0,
"total_tax_amount": 0.0,
"total_incl_tax": 200.00,
"service_fee_rate": 0,
"service_fee_amount": 0,
"rounding": 0,
"total_payable_amount": 200.00,
"payment_mode": "",
"suppliers_bank_account_number": "",
"payment_terms": "",
"prepayment_amount": "",
"prepayment_datetime": "",
"prepayment_reference_number": "",
"bill_reference_number": "",
"footer_notes": "",
"so_number": "",
"do_number": "",
"template": "",
"items": [
{
"details_tax_exemption": "",
"tax_exempt_amount": 0,
"id": "1",
"classification": "022",
"product_tariff_code": "",
"code": "",
"description": "1-3000",
"long_description": "",
"quantity": 1,
"measurement": "EA",
"unit_price": 100,
"subtotal": 100,
"discount_rate": 0,
"discount_amount": 0,
"service_fee_rate": 0,
"service_fee_amount": 0,
"total_excl_tax": 100,
"sales_tax_rate": 0,
"sales_tax_amount": 0,
"service_tax_rate": 0.0,
"service_tax_amount": 0,
"gst_rate": 0,
"gst_amount": 0,
"ttx_rate": 0,
"ttx_amount": 0,
"hvgt_rate": 0,
"hvgt_amount": 0,
"lvst_rate": 0,
"lvst_amount": 0,
"total_incl_tax": 100,
"country_of_origin": "",
"total_sales": "",
"commission_rate": ""
},
{
"details_tax_exemption": "",
"tax_exempt_amount": 0,
"id": "2",
"classification": "022",
"product_tariff_code": "",
"code": "",
"description": "1-4000",
"long_description": "",
"quantity": 1,
"measurement": "EA",
"unit_price": 100,
"subtotal": 100,
"discount_rate": 0,
"discount_amount": 0,
"service_fee_rate": 0,
"service_fee_amount": 0,
"total_excl_tax": 100,
"sales_tax_rate": 0,
"sales_tax_amount": 0,
"service_tax_rate": 0.0,
"service_tax_amount": 0,
"gst_rate": 0,
"gst_amount": 0,
"ttx_rate": 0,
"ttx_amount": 0,
"hvgt_rate": 0,
"hvgt_amount": 0,
"lvst_rate": 0,
"lvst_amount": 0,
"total_incl_tax": 100,
"country_of_origin": "",
"total_sales": "",
"commission_rate": ""
}
]
}'
Responses
🟢200Success
application/json
Body
array of:
invoice_number
string
optional
reference_number
string
optional
pos_id
string
optional
status
string
optional
Invalid - Failed validation. This reflects an actual status in LHDN as Cancelled as well.
InProgress - Pending status update from LHDN
Submitted - Submitted to LHDN. This reflects an actual status in LHDN as Cancelled as well.
InQueue - Pending to be submitted to LHDN
PendingApproval - On Hold until user manually approves it to be submitted to LHDN
Void - The document is in a void status.
Draft - The document is in a draft mode. (This can only happen if document is created manually via UI and saved as Draft)
Cancelled - The document is in a Cancelled status. This reflects an actual status in LHDN as Cancelled as well.
issued_at
string
optional
outlet_code
string
optional
currency_code
string
optional
currency_rate
integer
optional
supplier
object
optional
tin
string
required
name
string
required
email
string
required
address
string
required
city
string
required
postcode
string
required
state
string
required
contact
string
required
id_number
string
required
sst_number
string
required
ttx_number
string
required
buyer
object
optional
tin
string
required
name
string
required
email
string
required
address
string
required
city
string
required
postcode
string
required
state
string
required
contact
string
required
id_number
string
required
sst_number
string
required
membership_id
string
required
items
array [object {10}]
optional
id
integer
required
quantity
integer
required
subtotal
number
required
unit_price
number
required
description
string
required
measurement
string
required
discount_rate
integer
required
total_excl_tax
number
required
total_incl_tax
number
required
discount_amount
integer
required
quantity
integer
optional
sub_total
number
optional
discount_amount
integer
optional
total_excl_tax
number
optional
service_charge_rate
integer
optional
service_charge_amount
integer
optional
sst_rate
number
optional
sst_amount
number
optional
total_incl_tax
number
optional
rounding
number
optional
total
integer
optional
Examples
{
"status": "OK",
"message": "",
"data": {
"attention": [
{
"reference_number": "10050",
"payload": {
"buyer": {
"code": null,
"id_type": "BRN",
"tin": "C61901366810",
"id_number": "201903007118",
"name": "MEDHURST, GRIMES AND SIPES SDN. BHD.",
"email": "kendall.purdy@reilly.net",
"address1": "72684 Murl Light Apt. 668",
"address2": null,
"address3": null,
"city": "Lake Tedfort",
"postcode": "29311",
"state": "01",
"country": "MYS",
"sst_number": "W10-1060-26389071",
"phone": "0125168978",
"membership_id": null,
"is_foreign": "false"
},
"shipping": {
"code": null,
"id_type": null,
"tin": null,
"id_number": null,
"name": null,
"email": null,
"address1": null,
"address2": null,
"address3": null,
"city": null,
"postcode": null,
"state": null,
"country": "MYS"
},
"annex": {
"custom_form_number": null,
"incoterms": null,
"fta": null,
"certified_exporter_number": null,
"custom_k2_number": null,
"other_charges_description": null,
"other_charges_amount": null
},
"status": "valid",
"source": "ERP",
"type": "01",
"reference_number": "10050",
"invoice_number": "INV/6990761",
"original_einvoice_reference_number": null,
"po_number": "PO/8555",
"pos_id": null,
"issued_at": "2024-04-10",
"outlet_code": "HQ",
"currency_code": "MYR",
"currency_rate": null,
"frequency": null,
"billing_period_start": null,
"billing_period_end": null,
"subtotal": "447.92",
"discount_rate": "0",
"discount_amount": "0",
"total_excl_tax": "447.92",
"sales_tax_amount": "0",
"service_tax_amount": "35.83",
"gst_amount": "0",
"ttx_amount": "0",
"hvgt_amount": "0",
"lvst_amount": "0",
"total_tax_amount": "35.83",
"total_incl_tax": "483.75",
"service_fee_rate": "0",
"service_fee_amount": "0",
"rounding": "0",
"total_payable_amount": "483.75",
"payment_mode": null,
"suppliers_bank_account_number": null,
"payment_terms": null,
"prepayment_amount": null,
"prepayment_datetime": null,
"prepayment_reference_number": null,
"bill_reference_number": null,
"items": [
{
"id": "1",
"classification": "022",
"product_tariff_code": null,
"code": "123",
"description": "ullam et ex qui",
"long_description": "ullam et ex qui ullam et ex qui ullam et ex qui \n ullam et ex qui",
"quantity": "8",
"measurement": "UNIT",
"unit_price": "55.99",
"subtotal": "447.92",
"discount_rate": "0",
"discount_amount": "0",
"fee_rate": "0.00",
"fee_amount": "0",
"charge_rate": "0",
"charge_amount": "0.00",
"total_excl_tax": "447.92",
"sales_tax_rate": "0",
"sales_tax_amount": "0",
"service_tax_rate": "0.08",
"service_tax_amount": "35.83",
"gst_rate": "0",
"gst_amount": "0",
"ttx_rate": "0",
"ttx_amount": "0",
"hvgt_rate": "0",
"hvgt_amount": "0",
"lvst_rate": "0",
"lvst_amount": "0",
"total_incl_tax": "483.75",
"details_tax_exemption": null,
"exempt_tax_amount": null,
"country_of_origin": null
}
]
},
"lhdn_uin": "",
"lhdn_validated_at": "",
"lhdn_long_id": "",
"id": "9c0d00a3-3515-4857-8329-9925e58e2703",
"internal_error_message": "[\"The supplier field is required.\",\"The supplier.id type field is required.\",\"The supplier.tin field is required.\",\"The supplier.id number field is required.\",\"The supplier.name field is required.\",\"The supplier.email field is required.\",\"The supplier.address1 field is required.\"]"
}
],
"in_queue": [],
"rejected": []
}
}
Modified at 2025-04-24 04:21:57